Home > Back-end >  CXF web service framework, publishing services, targetNamespace problem
CXF web service framework, publishing services, targetNamespace problem

Time:12-31

1 service interface,
 
@ WebService
Public interface IHelloWorld {
Public String getHellow (@ the WebParam (name="name") String name);
}

2 implementation class
 
@ WebService (endpointInterface="com. Web. Hellow. IHelloWorld", serviceName="hellow")
Public class HelloWorld implements IHelloWorld {
Public String getHellow (String name) {
String STR="hello, world; Hello, "+ name;
return str;
}
}

3 exposed Web service
 
Public static void main (String [] args) {
String address="http://localhost:8000/hellow";
The HelloWorld hellow=new HelloWorld ();
The Endpoint. The publish (address, hellow);
}

Generate WSDL, right above the following


TargetNamespace as the default (package name inversion)
=============================================================
The above are no problem, I want to modify the targetNamespace for "http://aaa/", the following code
 
@ WebService (targetNamespace="http://aaa/")
Public interface IHelloWorld {
Public String getHellow (@ the WebParam (name="name") String name);
}

- service exposed to generate WSDL following

There are several problems as follows:
1. The targetNamespace is not modified, and the green line namespace is modified
2. WSDL great changes have taken place in the content of the

Hope the great god detail explain


CodePudding user response:

CodePudding user response:

reference 1st floor qq_30930805 response:

Show me you smile what, hurriedly is why

CodePudding user response:

 
@ WebService (endpointInterface="com. Web. Hellow. IHelloWorld", serviceName="hellow", targetNamespace="http://aaa/")
Public class HelloWorld implements IHelloWorld {
Public String getHellow (String name) {
String STR="hello, world; Hello, "+ name;
return str;
}
}

CodePudding user response:

The
reference 3 floor lijianjun0608 response:
 
@ WebService (endpointInterface="com. Web. Hellow. IHelloWorld", serviceName="hellow", targetNamespace="http://aaa/")
Public class HelloWorld implements IHelloWorld {
Public String getHellow (String name) {
String STR="hello, world; Hello, "+ name;
return str;
}
}


Solve the first problem, the targetNamespace modify a success, but your second question, why set the targetNamespace, WSDL message changed a lot

CodePudding user response:

There is no need to tangle, are put in the implementation class is best to write won't scan problem. Comments do not put in the interface will be all right

CodePudding user response:

I couldn't change the targetNamespace, you is how to change

CodePudding user response:

Brother: how do you do? I couldn't call after changed

CodePudding user response:

Can found all of them are not found at the end of the this method can only in the original poster said, write the targetNamespace webservice annotations on the interface, but the landlord said that the second question, I now is through the, didn't find what's the problem,

CodePudding user response:

refer to 7th floor a name like to marry a wife is difficult to reply:
brother changed after: how do you do? I can't call ah
after you modify how to adjust the, is to modify the client
  • Related