Hi. I've deployed a contract-first web service using CXF.

The server into which it is deployed performs 302 redirections from http to
ssl, so any request to http://server/app/* returns an HTTP 302 error code
and redirects to https://server/app/*.

In the original WSDL there are references to XSD elements in another
namespace, so the generated WSDL (the one
http://server/app/services/MyService?wsdl provides) contains a
`<wsdl:import>` element.

If I try to invoke the WS by manually building a SOAP request in a String
and send it over an SSL socket, the WS responds correctly. I've got all
necessary certificates in my keystore.

However, when I try to build a client using CXF's wsdl2java pointing to `
https://server/app/services/MyService?wsdl`, I get the following error:

    [Fatal Error] MyService?wsdl=MyServicePortType.wsdl:1:50: White spaces
are required between publicId and systemId.

    WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException:
    Fail to create wsdl definition from :
https://server/app/services/MyService?wsdl
    Caused by : WSDLException (at /wsdl:definitions/wsdl:import):
    faultCode=PARSER_ERROR: Problem parsing '
http://server:80/app/services/MyService?wsdl=MyServicePortType.wsdl'.:
    org.xml.sax.SAXParseException: White spaces are required between
publicId and systemId.

The trace is referring to the `<wsdl:import>` statement. Its `location`
attribute is `
http://server:80/app/services/MyService?wsdl=MyServicePortType.wsdl`. My
guess is that the error is thrown because of the 302 redirection.

The original WSDL is URL-agnostic, and the service's URL is defined
relative. It is accessed through the CXF servlet.

Should I specify somewhere in the service's autogenerated classes or wsdl
that the service is to be deployed on SSL? And how could I do it?

Reply via email to