You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Spam <sp...@rockhopper.org> on 2009/10/02 17:48:02 UTC

CXF - Simple and JAX-WS frontends interoperability

Hi all,

I've written a two web services using Simple frontend.

For the first service (called 'WSClaimService') the (runtime) generated
WSDL looks like:
    <xs:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"

For the second service (called 'WSUserService') the (runtime) generated
WSDL looks like:
    <xsd:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"

--> Could someone explain me what a such difference?

Starting from these wsdl I've generated using "WSDLToJava" the java
stubs to implement the web services using JAX-WS frontend.

Due to the "elementFormDefault" value, each function parameters are
associated with a TargetNamespace:
            @WebParam(name = "arg0", targetNamespace =
"http://myNamespace.be")

As a consequence the server implemented (generated by "WSDLToJava" with
-all option) fail to start with following error:
            javax.xml.bind.JAXBException: {http://myNamespace.be/}arg0
is not a valid property on class be.eft.cbkv3.ws.OpenSession

--> Is there a reason why the automatically generated server
implementation fail to start? (either WSDL is invalid and generation
should fail, or WSDL is valid and startup should be successful)

I've modified the WSDL of 'WSUserService' to set elementFormDefault to
"unqualified", as a consequence the @WebParam is generated with
targetNamespace= "".
And server implementation successfully start and web service is OK.

I tried to use the Simple Frontend for client side and JAXWS server side
implementation and it works perfectly.

Then, I tried to use the JAXWS client side implementation with Simple
frontend based server implementation, but all arguments to openSession
are set to 'null' on the server (whatever the value in the xml request).

In fact the Simple frontend client side implementation is generating the
following request:
     <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
     <soap:Body>
         <ns1:openSession xmlns:ns1="http://myNamespace.be/">
              <arg0 xmlns="http://myNamespace.be/">login</arg0>
              <arg1 xmlns="http://myNamespace.be/">password</arg1>
              <arg2 xmlns="http://myNamespace.be/">0</arg2>
              <arg3 xmlns="http://myNamespace.be/">localhost</arg3>
          </ns1:openSession>
      </soap:Body>
      </soap:Envelope>

While the JAXWS client side implementation is generating the following
request:  
-   <#>    <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
-     <#>   <soap:Body>
-           <#><ns2:openSession xmlns:ns2="http://myNamespace.be/">
                 <arg0>cbkadm</arg0>
                 <arg1>admin</arg1>
                 <arg2>0</arg2>
                 <arg3>localhost</arg3>
         </ns2:openSession>
   </soap:Body>
   </soap:Envelope>

Adding the targetNamespace to @WebParam doesn't fix this issue.

--> Is there a way to 'ask' JAXWS client side implementation to provide
the namespace? Is there a way to 'ask' Simple server side implementation
to support missing namespace?
      That's strange the targetNamespace is not provided by JAXWS client
side implementation even if provided in @WebParam, right?

Any help would be appreciate.
Don't hesitate if you need more information.

Best regards.
Johann