2

My toolset consists of Eclipse, CXF 2.5.1 and OpenJDK 6.

While generating a webclient from a wsdl I get errors referring to its name which contains a slash: 'soap/SomeService' is not a valid value for 'QName' / 'NCName'.

Replacing that slash with a dot I can generate the client but (after reverting that) I get an exception while invoking the service.

I tried to replace the slash with %2F but that didn't work either.

The source wsdl:

<wsdl:service name="soap/SomeService">
    <wsdl:port binding="impl:soap/SomeServiceSoapBinding" name="soap/SomeService">
        <wsdlsoap:address location="http://domain/axis/services/soap/SomeService"/>
    </wsdl:port>
</wsdl:service>

The generated soap service file:

@WebServiceClient(name = "soap/SomeService", 
                  wsdlLocation = "http://domain/axis/services/soap/SomeService?wsdl",
                  targetNamespace = "http://soap.some.service.net") 
public class SoapSomeService extends javax.xml.ws.Service {

    public final static URL WSDL_LOCATION;

    public final static QName SERVICE = new QName("http://soap.some.service.net", "soap/SomeService");
    public final static QName SoapSomeService = new QName("http://soap.some.service.net", "soap/SomeService");
    static {
        URL url = null;
        try {
            url = new URL("http://domain/axis/services/soap/SomeService?wsdl");
        } catch (MalformedURLException e) {
            java.util.logging.Logger.getLogger(SoapSomeService.class.getName())
                .log(java.util.logging.Level.INFO, 
                     "Can not initialize the default wsdl from {0}", "http://domain/axis/services/soap/SomeService?wsdl");
        }
        WSDL_LOCATION = url;
    }
    ...

The stack trace:

Caused by: javax.xml.ws.WebServiceException: Illegal endpoint address: ${endpoint.servicemanager}
    at com.sun.xml.internal.ws.api.EndpointAddress.create(EndpointAddress.java:133)
    at com.sun.xml.internal.ws.client.RequestContext.setEndPointAddressString(RequestContext.java:143)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at com.sun.xml.internal.ws.api.PropertySet$MethodAccessor.set(PropertySet.java:285)
    at com.sun.xml.internal.ws.api.PropertySet.put(PropertySet.java:345)
    at com.sun.xml.internal.ws.client.RequestContext.put(RequestContext.java:254)
    at com.sun.xml.internal.ws.client.RequestContext$MapView.put(RequestContext.java:352)
    at com.sun.xml.internal.ws.client.RequestContext$MapView.put(RequestContext.java:311)
    at ecard.gina.soap.SoapServiceManager.init(SoapServiceManager.java:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:346)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:299)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:132)
    ... 30 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 1: ${endpoint.servicemanager}
    at java.net.URI$Parser.fail(URI.java:2825)
    at java.net.URI$Parser.checkChars(URI.java:2998)
    at java.net.URI$Parser.parseHierarchical(URI.java:3082)
    at java.net.URI$Parser.parse(URI.java:3040)
    at java.net.URI.<init>(URI.java:595)
    at com.sun.xml.internal.ws.api.EndpointAddress.<init>(EndpointAddress.java:115)
    at com.sun.xml.internal.ws.api.EndpointAddress.create(EndpointAddress.java:131)
    ... 48 more
2
  • What exactly do you mean by 'it's name'? Can you show the WSDL? My guess is that you're just not allowed to use the slash in a QName as per XML specification: w3.org/TR/REC-xml-names/#NT-QName
    – home
    Jan 16, 2012 at 11:46
  • @home Yeah, I already fear that slashes are not allowed. Nevertheless, the developers of that system used a slash (if I understood that wsdl correctly).
    – Alex
    Jan 16, 2012 at 12:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.