When creating a web-service using CXF (configuration in Spring), my resulting WSDL is missing the address location in port tag. This is problematic for client side. If CXF is used for client creation, endpoint must be set programatically in client code. If Axis is used (the consumer of my web-service wants to be able to use Axis 1), there is an error saying
Error in generating Java from WSDL: java.io.IOException:
Emitter failure. Cannot find endpoint address in port FooServiceSOAPPort
in service FooServiceLocator
Instead of being forced to create the client using CXF or Axis2 and manually setting the endpoint in client code, I would like to have the following child element:
<soap:address location="http://localhost:9000/services/foo"/>
under the tag <wsdl:port binding="..." name="...>
in my WSDL (generated by CXF from my service code).
If I save the WSDL as local file and I manually add the line above, client is generated without any problems using Axis, no manual endpoint setting is needed on the client side and everything is OK. So, how do I make the address location line appear in WSDL generated by CXF?
Here's my Spring config (relevant endpoint tag):
<jaxws:endpoint xmlns:hel="http://user.services/"
name="Foo"
address="/services/foo"
implementor="services.foo.FooImpl"/>
Here's my service interface:
@WebService
public interface Foo {
String method1(String arg1);
}
and implementation
@WebService(endpointInterface = "services.foo.Foo")
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
public class FooImpl implements Foo {
@WebMethod(operationName = "method1")
public String method1(String arg1) {
return "OK";
}
}
publishedEndpointUrl
property in jaxws:endpoint should be the one to do the trick, but I can't get it to work. Perhaps I missed something... All I want is to have the<soap:address location="...">
in my generated WSDL using CXF. – slouc