0
votes

I have a web service that follows some of the semantics of a SOAP service, but they don't provide a WSDL for said service. Instead, they provide an XSD, by which I'm reverse-engineering a WSDL out of. Things seemed to be going well, even so far as to be able to

  1. create a WSDL
  2. Import the XSD as part of the WSDL using the xsd:import tag
  3. Create Java wrappers with CXF
  4. Call the service.

Now, what I get when I call the service is an exception:

INFO: Creating Service {http://service.something.net/xml}QueryService from WSDL: file:/C:/mydocs/Work/project/my-service.wsdl
Aug 09, 2011 1:22:34 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://service.something.net/xml}QueryService#{http://servicesomething..../xml}QueryRequest has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: "http://service.something.net/xml", the namespace on the "QueryResponse" element, is not a valid SOAP version.

The WSDL can be found in this gist, and the XSD is something I got from the vendor.

What does the error mean? What might I have done wrong in my .wsdl file generation?

Edit 1

I have manually tested the service from the vendor service, and the response seems okay to me:

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Body>
        <QueryResponse xmlns="http://service.something.net/xml">
        ....
        </QueryResponse>
    </Body>
</Envelope>

Unless I'm missing something, there should not be any reason why CXF even wants the QueryResponse to be a SOAP element, since it's namespace isn't SOAP but http://service.something.net/xml.

1

1 Answers

1
votes

Where you are importing your XSD:

<wsdl:types>
    <xsd:schema targetNamespace="http://service.something.net/xml">
        <xsd:include schemaLocation="My-XSD.xsd" />
    </xsd:schema>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:import namespace="http://service.something.net/xml"
            schemaLocation="My-XSD.xsd">
        </xsd:import>
    </xsd:schema>
</wsdl:types>

try this instead:

<wsdl:types>
    <xs:schema targetNamespace="http://service.something.net/xml" 
               elementFormDefault="qualified">
        <xs:import schemaLocation="My-XSD.xsd"/>
    </xs:schema>
</wsdl:types>

Basically you shouldn't need the include, just the import. Also you want to specify fully qualified element form.

Hope this works.