You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jackdawson <ab...@gmail.com> on 2008/09/26 23:32:36 UTC

Axis2 and CXF - Handling WSDLs differently

Hello all,
I found something bizarre which made to wonder why.

Here is what I found:
        1.) When I used Axis2 Eclipse Codegen plugins (Generate Java source
code from WSDL file) to generate code from this WSDL, it didn't allow me.
                It kept throwing me an error -
                        "An error occurred while completing the process -
java.lang.InterruptedException
                         No element type is defind for the message xxxxx"
        2.) Then, I switched to CXF 2.0.8 and tried to generate the client
as I did with Axis2 and surprisingly, it got through and created the client
side stubs.    
                CXF doesn't see this WSDL as a bad one.
       
                Please correct me if I'm wrong. To my knowledge, when you
define "type" attribute for the "message" and not the "element" attribute
then it has to be an "rpc" style.
                Axis2 knows it but CXF ignores it.
               
                Can anyone let me know why there's a difference in handling
the WSDLs?
                If I modify the WSDL as Axis2 wants me to and generate just
the client and hit the service (which is already existing), will I still be
able to succeed?
               
Here is the WSDL I'm talking about:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:login.safe.two.us"
        xmlns:apachesoap="http://xml.apache.org/xml-soap"
        xmlns:impl="urn:login.safe.two.us"
        xmlns:intf="urn:login.safe.two.us"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <wsdl:types>
                <schema elementFormDefault="qualified"
                        targetNamespace="urn:login.safe.two.us"
                        xmlns="http://www.w3.org/2001/XMLSchema">
                       
                        <complexType name="TestLoginType">
                                <sequence>
                                        <element name="eid" maxOccurs="1"
minOccurs="1" type="xsd:string" />
                                        <element name="key" nillable="true"
type="xsd:string" />
                                </sequence>
                        </complexType>
                       
                        <complexType name="TestLoginTypeResponse">
                                <sequence>
                                        <element name="failedReason"
nillable="true" type="xsd:string" />
                                        <element name="status"
type="xsd:boolean" />
                                </sequence>
                        </complexType>
                       
                </schema>
        </wsdl:types>
       
        <wsdl:message name="testLoginRequest">
                <wsdl:part name="testLoginRequestAttributes"
type="impl:TestLoginType"/>
        </wsdl:message>
       
        <wsdl:message name="testLoginResponse">
                <wsdl:part name="testLoginResponseAttributes"
type="impl:TestLoginTypeResponse"/>
        </wsdl:message>
       
        <wsdl:portType name="LoginServicePortType">
                <wsdl:operation name="testLogin">
                        <wsdl:input message="impl:testLoginRequest"
name="testLoginRequest" />
                        <wsdl:output message="impl:testLoginResponse"
name="testLoginResponse" />
                </wsdl:operation>
        </wsdl:portType>

        <wsdl:binding name="LoginServiceSoapBinding"
type="impl:LoginServicePortType">
                <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
                <wsdl:operation name="testLogin">
                        <wsdlsoap:operation soapAction="" />
                        <wsdl:input name="testLoginRequest">
                                <wsdlsoap:body use="literal" />
                        </wsdl:input>
                        <wsdl:output name="testLoginResponse">
                                <wsdlsoap:body use="literal" />
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>

        <wsdl:service name="LoginService">
                <wsdl:port binding="impl:LoginServiceSoapBinding"
name="LoginService">
                        <wsdlsoap:address
location="http://JISLOGINDEV:8080/JisAuthentication/services/safelogin" />
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>



                Thanks.
-- 
View this message in context: http://www.nabble.com/Axis2-and-CXF---Handling-WSDLs-differently-tp19696717p19696717.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Axis2 and CXF - Handling WSDLs differently

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 29 September 2008 11:10:34 am jackdawson wrote:
> Actually, I was using the Eclipse STP with CXF.
>
> Do you think its the STP then that's not validating the WSDL?

Most likely yes.   In all likelyhood, they aren't passing the -validate flag 
into the tools when it calls them.

That said, the STP stuff is kind of being deprecated.   I wouldn't expect it 
to get fixed there.

See:
http://oisinh.wordpress.com/2008/09/26/developing-web-services-with-eclipse-and-cxf/


Dan



>
> Thanks.
>
> dkulp wrote:
> > If you run wsdl2java with the -validate flag, you get:
> >
> > WSDLToJava Error: A document-literal binding in a DESCRIPTIOI was using 
the Eclipse STP with CXF. 

Do you think its the STP then that's not validating the WSDL?

Thanks.N MUST refer,
> > in
> > each of its soapbind:body element(s),only to wsdl:part element(s) that
> > have
> > been defined using the element attribute.
> >
> >
> > Dan
> >
> > On Friday 26 September 2008 5:32:36 pm jackdawson wrote:
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <wsdl:definitions targetNamespace="urn:login.safe.two.us"
> >>         xmlns:apachesoap="http://xml.apache.org/xml-soap"
> >>         xmlns:impl="urn:login.safe.two.us"
> >>         xmlns:intf="urn:login.safe.two.us"
> >>         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> >>         xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> >>         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >>         <wsdl:types>
> >>                 <schema elementFormDefault="qualified"
> >>                         targetNamespace="urn:login.safe.two.us"
> >>                         xmlns="http://www.w3.org/2001/XMLSchema">
> >>                        
> >>                         <complexType name="TestLoginType">
> >>                                 <sequence>
> >>                                         <element name="eid"
> >> maxOccurs="1" minOccurs="1" type="xsd:string" />
> >>                                         <element name="key"
> >> nillable="true"
> >> type="xsd:string" />
> >>                                 </sequence>I was using the Eclipse STP 
with CXF. 

Do you think its the STP then that's not validating the WSDL?

Thanks.
> >>                         </complexType>
> >>                        
> >>                         <complexType name="TestLoginTypeResponse">
> >>                                 <sequence>
> >>                                         <element name="failedReason"
> >> nillable="true" type="xsd:string" />
> >>                                         <element name="status"
> >> type="xsd:boolean" />
> >>                                 </sequence>
> >>                         </complexType>
> >>                        
> >>                 </schema>
> >>         </wsdl:types>
> >>        
> >>         <wsdl:message name="testLoginRequest">
> >>                 <wsdl:part name="testLoginRequestAttributes"
> >> type="impl:TestLoginType"/>
> >>         </wsdl:message>
> >>        
> >>         <wsdl:message name="testLoginResponse">
> >>                 <wsdl:part name="testLoginResponseAttributes"
> >> type="impl:TestLoginTypeResponse"/>
> >>         </wsdl:message>
> >>        
> >>         <wsdl:portType name="LoginServicePortType">
> >>                 <wsdl:operation name="testLogin">
> >>                         <wsdl:input message="impl:testLoginRequest"
> >> name="testLoginRequest" />
> >>                         <wsdl:output message="impl:testLoginResponse"
> >> name="testLoginResponse" />
> >>                 </wsdl:operation>
> >>         </wsdl:portType>
> >>
> >>         <wsdl:binding name="LoginServiceSoapBinding"
> >> type="impl:LoginServicePortType">
> >>                 <wsdlsoap:binding style="document"
> >> transport="http://schemas.xmlsoap.org/soap/http" />
> >>                 <wsdl:operation name="testLogin">
> >>                         <wsdlsoap:operation soapAction="" />
> >>                         <wsdl:input name="testLoginRequest">
> >>                                 <wsdlsoap:body use="literal" />
> >>                         </wsdl:input>
> >>                         <wsdl:output name="testLoginResponse">
> >>                                 <wsdlsoap:body use="literal" />
> >>                         </wsdl:output>
> >>                 </wsdl:operation>
> >>         </wsdl:binding>
> >>
> >>         <wsdl:service name="LoginService">
> >>                 <wsdl:port binding="impl:LoginServiceSoapBinding"
> >> name="LoginService">
> >>                         <wsdlsoap:address
> >> location="http://JISLOGINDEV:8080/JisAuthentication/services/safelogin"
> >> />
> >>                 </wsdl:port>
> >>         </wsdl:service>
> >> </wsdl:definitions>
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Axis2 and CXF - Handling WSDLs differently

Posted by jackdawson <ab...@gmail.com>.
Actually, I was using the Eclipse STP with CXF. 

Do you think its the STP then that's not validating the WSDL?

Thanks.





dkulp wrote:
> 
> 
> If you run wsdl2java with the -validate flag, you get:
> 
> WSDLToJava Error: A document-literal binding in a DESCRIPTION MUST refer,
> in 
> each of its soapbind:body element(s),only to wsdl:part element(s) that
> have 
> been defined using the element attribute.
> 
> 
> Dan
> 
> 
> On Friday 26 September 2008 5:32:36 pm jackdawson wrote:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <wsdl:definitions targetNamespace="urn:login.safe.two.us"
>>         xmlns:apachesoap="http://xml.apache.org/xml-soap"
>>         xmlns:impl="urn:login.safe.two.us"
>>         xmlns:intf="urn:login.safe.two.us"
>>         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>>         xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>>         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>         <wsdl:types>
>>                 <schema elementFormDefault="qualified"
>>                         targetNamespace="urn:login.safe.two.us"
>>                         xmlns="http://www.w3.org/2001/XMLSchema">
>>                        
>>                         <complexType name="TestLoginType">
>>                                 <sequence>
>>                                         <element name="eid" maxOccurs="1"
>> minOccurs="1" type="xsd:string" />
>>                                         <element name="key"
>> nillable="true"
>> type="xsd:string" />
>>                                 </sequence>
>>                         </complexType>
>>                        
>>                         <complexType name="TestLoginTypeResponse">
>>                                 <sequence>
>>                                         <element name="failedReason"
>> nillable="true" type="xsd:string" />
>>                                         <element name="status"
>> type="xsd:boolean" />
>>                                 </sequence>
>>                         </complexType>
>>                        
>>                 </schema>
>>         </wsdl:types>
>>        
>>         <wsdl:message name="testLoginRequest">
>>                 <wsdl:part name="testLoginRequestAttributes"
>> type="impl:TestLoginType"/>
>>         </wsdl:message>
>>        
>>         <wsdl:message name="testLoginResponse">
>>                 <wsdl:part name="testLoginResponseAttributes"
>> type="impl:TestLoginTypeResponse"/>
>>         </wsdl:message>
>>        
>>         <wsdl:portType name="LoginServicePortType">
>>                 <wsdl:operation name="testLogin">
>>                         <wsdl:input message="impl:testLoginRequest"
>> name="testLoginRequest" />
>>                         <wsdl:output message="impl:testLoginResponse"
>> name="testLoginResponse" />
>>                 </wsdl:operation>
>>         </wsdl:portType>
>>
>>         <wsdl:binding name="LoginServiceSoapBinding"
>> type="impl:LoginServicePortType">
>>                 <wsdlsoap:binding style="document"
>> transport="http://schemas.xmlsoap.org/soap/http" />
>>                 <wsdl:operation name="testLogin">
>>                         <wsdlsoap:operation soapAction="" />
>>                         <wsdl:input name="testLoginRequest">
>>                                 <wsdlsoap:body use="literal" />
>>                         </wsdl:input>
>>                         <wsdl:output name="testLoginResponse">
>>                                 <wsdlsoap:body use="literal" />
>>                         </wsdl:output>
>>                 </wsdl:operation>
>>         </wsdl:binding>
>>
>>         <wsdl:service name="LoginService">
>>                 <wsdl:port binding="impl:LoginServiceSoapBinding"
>> name="LoginService">
>>                         <wsdlsoap:address
>> location="http://JISLOGINDEV:8080/JisAuthentication/services/safelogin"
>> />
>>                 </wsdl:port>
>>         </wsdl:service>
>> </wsdl:definitions>
> 
> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Axis2-and-CXF---Handling-WSDLs-differently-tp19696717p19725780.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Axis2 and CXF - Handling WSDLs differently

Posted by Daniel Kulp <dk...@apache.org>.
If you run wsdl2java with the -validate flag, you get:

WSDLToJava Error: A document-literal binding in a DESCRIPTION MUST refer, in 
each of its soapbind:body element(s),only to wsdl:part element(s) that have 
been defined using the element attribute.


Dan


On Friday 26 September 2008 5:32:36 pm jackdawson wrote:
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="urn:login.safe.two.us"
>         xmlns:apachesoap="http://xml.apache.org/xml-soap"
>         xmlns:impl="urn:login.safe.two.us"
>         xmlns:intf="urn:login.safe.two.us"
>         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>         xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>         <wsdl:types>
>                 <schema elementFormDefault="qualified"
>                         targetNamespace="urn:login.safe.two.us"
>                         xmlns="http://www.w3.org/2001/XMLSchema">
>                        
>                         <complexType name="TestLoginType">
>                                 <sequence>
>                                         <element name="eid" maxOccurs="1"
> minOccurs="1" type="xsd:string" />
>                                         <element name="key" nillable="true"
> type="xsd:string" />
>                                 </sequence>
>                         </complexType>
>                        
>                         <complexType name="TestLoginTypeResponse">
>                                 <sequence>
>                                         <element name="failedReason"
> nillable="true" type="xsd:string" />
>                                         <element name="status"
> type="xsd:boolean" />
>                                 </sequence>
>                         </complexType>
>                        
>                 </schema>
>         </wsdl:types>
>        
>         <wsdl:message name="testLoginRequest">
>                 <wsdl:part name="testLoginRequestAttributes"
> type="impl:TestLoginType"/>
>         </wsdl:message>
>        
>         <wsdl:message name="testLoginResponse">
>                 <wsdl:part name="testLoginResponseAttributes"
> type="impl:TestLoginTypeResponse"/>
>         </wsdl:message>
>        
>         <wsdl:portType name="LoginServicePortType">
>                 <wsdl:operation name="testLogin">
>                         <wsdl:input message="impl:testLoginRequest"
> name="testLoginRequest" />
>                         <wsdl:output message="impl:testLoginResponse"
> name="testLoginResponse" />
>                 </wsdl:operation>
>         </wsdl:portType>
>
>         <wsdl:binding name="LoginServiceSoapBinding"
> type="impl:LoginServicePortType">
>                 <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http" />
>                 <wsdl:operation name="testLogin">
>                         <wsdlsoap:operation soapAction="" />
>                         <wsdl:input name="testLoginRequest">
>                                 <wsdlsoap:body use="literal" />
>                         </wsdl:input>
>                         <wsdl:output name="testLoginResponse">
>                                 <wsdlsoap:body use="literal" />
>                         </wsdl:output>
>                 </wsdl:operation>
>         </wsdl:binding>
>
>         <wsdl:service name="LoginService">
>                 <wsdl:port binding="impl:LoginServiceSoapBinding"
> name="LoginService">
>                         <wsdlsoap:address
> location="http://JISLOGINDEV:8080/JisAuthentication/services/safelogin" />
>                 </wsdl:port>
>         </wsdl:service>
> </wsdl:definitions>



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Axis2 and CXF - Handling WSDLs differently

Posted by Glen Mazza <gl...@gmail.com>.
I'm not sure, perhaps you should try your WSDL with GlassFish Metro aka the
JAX-WS RI and see what it says.

The WS-I BP provides design rules (suggestions) for web services that wish
to be compliant with it, but it is not the WSDL specification itself.  My
read of 2203 and 2204 is that says how you should identify messages if you
are using doc/lit vs. rpc/lit, but that is not the determinant of whether
you are using doc/lit or rpc/lit--that is still defined in the binding
section.  Stated another way, while it's true that in Canada you need to buy
things with Canadian dollars, attempting to buy things with Canadian money
does not automatically mean you're in Canada, nor does such an attempt
automatically transport you to Canada.

I believe CXF's wsdl2java has a validation option that checks several of the
WS-I BP rules (not by any means all though).  If we're missing this
particular test in the validation processing you might want to submit a JIRA
enhancement request for us to include it.  But I don't think we can reject
outright a legal (i.e., WSDL-spec compliant) WSDL that does not follow a
particular WS-I BP design recommendation, because WSDLs are not required to
follow the WS-I BP.

Glen


jackdawson wrote:
> 
> Thanks for the reply, Glen.
> 
> I don't want to start a war here but this is what I received from Axis2
> mailing list:
> 
> "This WSDL looks  invalid. As you have said when a message part refers to
> a type directly it is RPC whereas when it refers to an element its known
> as document. Now the messages parts of your WSDL is RPC but your binsind
> says that its document. I feel that the WSDL is incorrect and hence Axis2
> is right in saying that the element is missing."
> 
> I wanted to find a base for this statement and here it is.
> Reference:
> Initially, I thought the same way as you did. But when I looked at the
> WS-I basic profile at 
> http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLMSGS
> http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLMSGS  and read the 
> 
> a) R2203
> b) R2204
> 
> I had to update my knowledge on the styles and usages.
> 
> Please let me know your comments on this. We can talk more on this if
> needed.
> I really appreciate it.
> 
> Thanks.
> 

-- 
View this message in context: http://www.nabble.com/Axis2-and-CXF---Handling-WSDLs-differently-tp19696717p19717752.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Axis2 and CXF - Handling WSDLs differently

Posted by jackdawson <ab...@gmail.com>.
Thanks for the reply, Glen.

I don't want to start a war here but this is what I received from Axis2
mailing list:

"This WSDL looks  invalid. As you have said when a message part refers to a
type directly it is RPC whereas when it refers to an element its known as
document. Now the messages parts of your WSDL is RPC but your binsind says
that its document. I feel that the WSDL is incorrect and hence Axis2 is
right in saying that the element is missing."

Reference:
Initially, I thought the same way as you did. But when I looked at the WS-I
basic profile at 
http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLMSGS
http://www.ws-i.org/Profiles/BasicProfile-1.1.html#WSDLMSGS  and read the 

a) R2203
b) R2204

I had to update my knowledge on the styles and usages.

Please let me know your comments on this. We can talk more on this if
needed.
I really appreciate it.

Thanks.











Glen Mazza wrote:
> 
> 
> jackdawson wrote:
>> 
>> Hello all,
>> I found something bizarre which made to wonder why.
>> 
>> Here is what I found:
>>         1.) When I used Axis2 Eclipse Codegen plugins (Generate Java
>> source code from WSDL file) to generate code from this WSDL, it didn't
>> allow me.
>>                 It kept throwing me an error -
>>                         "An error occurred while completing the process -
>> java.lang.InterruptedException
>>                          No element type is defind for the message xxxxx"
>>         2.) Then, I switched to CXF 2.0.8 and tried to generate the
>> client as I did with Axis2 and surprisingly, it got through and created
>> the client side stubs.    
>>                 CXF doesn't see this WSDL as a bad one.
>> 
>> ...snip...
>> 
> 
> These questions might be better suited for the Axis mailing list.  Axis2
> is not a pure JAX-WS implementation, so they may process a WSDL
> differently.  I think whether the JAX-WS objects are generated in doc/lit
> or rpc/lit format is defined by the wsdl:binding section, not by message
> attribute values.
> 
> Glen
> 
> 

-- 
View this message in context: http://www.nabble.com/Axis2-and-CXF---Handling-WSDLs-differently-tp19696717p19715089.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Axis2 and CXF - Handling WSDLs differently

Posted by Glen Mazza <gl...@gmail.com>.

jackdawson wrote:
> 
> Hello all,
> I found something bizarre which made to wonder why.
> 
> Here is what I found:
>         1.) When I used Axis2 Eclipse Codegen plugins (Generate Java
> source code from WSDL file) to generate code from this WSDL, it didn't
> allow me.
>                 It kept throwing me an error -
>                         "An error occurred while completing the process -
> java.lang.InterruptedException
>                          No element type is defind for the message xxxxx"
>         2.) Then, I switched to CXF 2.0.8 and tried to generate the client
> as I did with Axis2 and surprisingly, it got through and created the
> client side stubs.    
>                 CXF doesn't see this WSDL as a bad one.
> 
> ...snip...
> 

These questions might be better suited for the Axis mailing list.  Axis2 is
not a pure JAX-WS implementation, so they may process a WSDL differently.  I
think whether the JAX-WS objects are generated in doc/lit or rpc/lit format
is defined by the wsdl:binding section, not by message attribute values.

Glen

-- 
View this message in context: http://www.nabble.com/Axis2-and-CXF---Handling-WSDLs-differently-tp19696717p19708707.html
Sent from the cxf-user mailing list archive at Nabble.com.