You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Anton Pirker <he...@gmiatlich.net> on 2007/04/11 09:26:48 UTC

Unexpected subelement when calling adb stub method

Hi all!

I am new to Axis2 and trying to implement an SSO service. I have an WSDL 
from which i generated my java stub.
When i call the generated ssoLogin-Method i allways get an "Unexpected 
subelement".

This is what the WSDL looks like: (only the important parts)


------ snip ---------
      <operation name="ssoLogin" parameterOrder="ssoLoginUser c_login 
c_password c_client">
         <input message="typens:ssoLoginRequest"/>
         <output message="typens:ssoLoginResponse"/>
      </operation>

      <message name="ssoLoginResponse">
         <part name="ssoLoginRet" type="typens:ssoLoginRet"/>
      </message>

      <xsd:complexType name="ssoLoginRet">
        <xsd:all>
          <xsd:element minOccurs="0" maxOccurs="1" name="login" 
type="xsd:string"/>
          <xsd:element minOccurs="0" maxOccurs="1" name="email" 
type="xsd:string"/>
          <xsd:element minOccurs="0" maxOccurs="1" name="hash" 
type="xsd:string"/>
          <xsd:element minOccurs="0" maxOccurs="1" name="token" 
type="xsd:string"/>
           ...
        </xsd:all>
      </xsd:complexType>
------ snap ---------


and this is the response i get (copied from the log):
------ snip ---------
<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:ns1="urn:ssoService"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                   
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <ns1:ssoLoginResponse>
         <ns1:ssoLoginRet xsi:type="ns1:ssoLoginRet">
            <login xsi:type="xsd:string">a.pirker</login>
            <email xsi:type="xsd:string">anton.pirker@bla.com</email>
            <hash 
xsi:type="xsd:string">bd3eb6079db946622fcbc84f5204f01a</hash>
            <token 
xsi:type="xsd:string">a2047ad88fc3bd91b1034e544a0934c1</token>
         </ns1:ssoLoginRet>
      </ns1:ssoLoginResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------ snap ---------    


I do not see the error. i have an output message loginResponse which 
contains a part of type loginRet. And that is exactly what i am getting...
What am i missing?

My setup: Yesterdays snapshot of Axis2 on Windows.
Build the Stub with following command: [axis2-dir]\bin> wsdl2java.bat 
-uri Authentification.wsdl -p at.ignaz.sso -d adb -s -o sso


Any help is greatly appreciated!

Thanks in advance,
Anton

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: addendum: Re: Unexpected subelement when calling adb stub method

Posted by Anne Thomas Manes <at...@gmail.com>.
Anton,

The only problem I see with the WSDL is the inclusion of the
encodingStyle attribute in the <soap:body> declarations in the
binding. Remove these and try regenerating the service and the client
stub.

The error, "Unexpected subelement" is caused by the fact that the
ssoLoginRet element is qualified in the return message. When using RPC
style, the generated accessor elements for the message part must be
unqualified. If Axis2 manages to get past that point, it would
generate the same error when it encounters the children of ssoLoginRet
because those elements are unqualified, but they should be qualified.
(Your schema specifies elementFormDefault="qualified").

Anne


On 4/12/07, Anton Pirker <he...@gmiatlich.net> wrote:
> Hi!
>
> I got the WSDL from a client of mine.
> Here you have the complete WSDL. (see attachment)
>
> But xmlspy says the wsdl is valid and well-formed, so i thought
> everything is ok...
>
>
> anton
>
>
> Anne Thomas Manes wrote:
> > Anton,
> >
> > I just looked at the binding again, and realized that it says
> > use="literal" and also specifies encodingStyle. This is not a valid
> > WSDL. You cannot specify an encoding style when use="literal".
> >
> > Where did you get this WSDL?
> >
> > It would be helpful if you provided us with the complete WSDL.
> >
> > Anne
> >
> > On 4/12/07, Anne Thomas Manes <at...@gmail.com> wrote:
> >> The service requires that you send a message encoded using
> >> rpc/encoding. Because Axis2 does not support SOAP encoding, you can't
> >> use it to build a client for this service. Try Axis 1.4 instead.
> >>
> >> Anne
> >>
> >> On 4/11/07, Anton Pirker <he...@gmiatlich.net> wrote:
> >> > Hi Anne!
> >> >
> >> > Anne Thomas Manes wrote:
> >> > > Axis2 does not support rpc/encoding.
> >> >
> >> > Does this mean that i can completely forget to implement a client for
> >> > the service?
> >> >
> >> > Or can i just change the binding from rpc to document and everything
> >> > will be fine?
> >> > (i will try this tomorrow morning in the office, from my home-office i
> >> > do not have access to the service)
> >> >
> >> >
> >> >
> >> > Anton
> >> >
> >> >
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >> >
> >> >
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: addendum: Re: Unexpected subelement when calling adb stub method

Posted by Anton Pirker <he...@gmiatlich.net>.
Hi!

I got the WSDL from a client of mine.
Here you have the complete WSDL. (see attachment)

But xmlspy says the wsdl is valid and well-formed, so i thought 
everything is ok...


anton


Anne Thomas Manes wrote:
> Anton,
>
> I just looked at the binding again, and realized that it says
> use="literal" and also specifies encodingStyle. This is not a valid
> WSDL. You cannot specify an encoding style when use="literal".
>
> Where did you get this WSDL?
>
> It would be helpful if you provided us with the complete WSDL.
>
> Anne
>
> On 4/12/07, Anne Thomas Manes <at...@gmail.com> wrote:
>> The service requires that you send a message encoded using
>> rpc/encoding. Because Axis2 does not support SOAP encoding, you can't
>> use it to build a client for this service. Try Axis 1.4 instead.
>>
>> Anne
>>
>> On 4/11/07, Anton Pirker <he...@gmiatlich.net> wrote:
>> > Hi Anne!
>> >
>> > Anne Thomas Manes wrote:
>> > > Axis2 does not support rpc/encoding.
>> >
>> > Does this mean that i can completely forget to implement a client for
>> > the service?
>> >
>> > Or can i just change the binding from rpc to document and everything
>> > will be fine?
>> > (i will try this tomorrow morning in the office, from my home-office i
>> > do not have access to the service)
>> >
>> >
>> >
>> > Anton
>> >
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> > For additional commands, e-mail: axis-user-help@ws.apache.org
>> >
>> >
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>


Re: addendum: Re: Unexpected subelement when calling adb stub method

Posted by Anne Thomas Manes <at...@gmail.com>.
Anton,

I just looked at the binding again, and realized that it says
use="literal" and also specifies encodingStyle. This is not a valid
WSDL. You cannot specify an encoding style when use="literal".

Where did you get this WSDL?

It would be helpful if you provided us with the complete WSDL.

Anne

On 4/12/07, Anne Thomas Manes <at...@gmail.com> wrote:
> The service requires that you send a message encoded using
> rpc/encoding. Because Axis2 does not support SOAP encoding, you can't
> use it to build a client for this service. Try Axis 1.4 instead.
>
> Anne
>
> On 4/11/07, Anton Pirker <he...@gmiatlich.net> wrote:
> > Hi Anne!
> >
> > Anne Thomas Manes wrote:
> > > Axis2 does not support rpc/encoding.
> >
> > Does this mean that i can completely forget to implement a client for
> > the service?
> >
> > Or can i just change the binding from rpc to document and everything
> > will be fine?
> > (i will try this tomorrow morning in the office, from my home-office i
> > do not have access to the service)
> >
> >
> >
> > Anton
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: addendum: Re: Unexpected subelement when calling adb stub method

Posted by Anne Thomas Manes <at...@gmail.com>.
The service requires that you send a message encoded using
rpc/encoding. Because Axis2 does not support SOAP encoding, you can't
use it to build a client for this service. Try Axis 1.4 instead.

Anne

On 4/11/07, Anton Pirker <he...@gmiatlich.net> wrote:
> Hi Anne!
>
> Anne Thomas Manes wrote:
> > Axis2 does not support rpc/encoding.
>
> Does this mean that i can completely forget to implement a client for
> the service?
>
> Or can i just change the binding from rpc to document and everything
> will be fine?
> (i will try this tomorrow morning in the office, from my home-office i
> do not have access to the service)
>
>
>
> Anton
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: addendum: Re: Unexpected subelement when calling adb stub method

Posted by Anton Pirker <he...@gmiatlich.net>.
Hi Anne!

Anne Thomas Manes wrote:
> Axis2 does not support rpc/encoding.

Does this mean that i can completely forget to implement a client for 
the service?

Or can i just change the binding from rpc to document and everything 
will be fine?
(i will try this tomorrow morning in the office, from my home-office i 
do not have access to the service)



Anton




---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: addendum: Re: Unexpected subelement when calling adb stub method

Posted by Anne Thomas Manes <at...@gmail.com>.
Axis2 does not support rpc/encoding.

On 4/11/07, Anton Pirker <he...@gmiatlich.net> wrote:
> Hi again!
>
> In my first mail i forget the Binding of the WSDL. Maybe this is also
> important:
>
> ------ snip ---------
>    <binding name="ssoServiceBinding" type="typens:ssoServicePort">
>       <soap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>       <operation name="ssoLogin">
>          <soap:operation soapAction="urn:ssoServiceAction"/>
>          <input>
>             <soap:body use="literal" namespace="urn:ssoService"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>          </input>
>          <output>
>             <soap:body use="literal" namespace="urn:ssoService"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>          </output>
>       </operation>
>    </binding>
> ------ snap ---------
>
> Anton Pirker wrote:
> > Hi all!
> >
> > I am new to Axis2 and trying to implement an SSO service. I have an
> > WSDL from which i generated my java stub.
> > When i call the generated ssoLogin-Method i allways get an "Unexpected
> > subelement".
> >
> > This is what the WSDL looks like: (only the important parts)
> >
> >
> > ------ snip ---------
> >      <operation name="ssoLogin" parameterOrder="ssoLoginUser c_login
> > c_password c_client">
> >         <input message="typens:ssoLoginRequest"/>
> >         <output message="typens:ssoLoginResponse"/>
> >      </operation>
> >
> >      <message name="ssoLoginResponse">
> >         <part name="ssoLoginRet" type="typens:ssoLoginRet"/>
> >      </message>
> >
> >      <xsd:complexType name="ssoLoginRet">
> >        <xsd:all>
> >          <xsd:element minOccurs="0" maxOccurs="1" name="login"
> > type="xsd:string"/>
> >          <xsd:element minOccurs="0" maxOccurs="1" name="email"
> > type="xsd:string"/>
> >          <xsd:element minOccurs="0" maxOccurs="1" name="hash"
> > type="xsd:string"/>
> >          <xsd:element minOccurs="0" maxOccurs="1" name="token"
> > type="xsd:string"/>
> >           ...
> >        </xsd:all>
> >      </xsd:complexType>
> > ------ snap ---------
> >
> >
> > and this is the response i get (copied from the log):
> > ------ snip ---------
> > <SOAP-ENV:Envelope
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> >                   xmlns:ns1="urn:ssoService"
> >                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >
> > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> >
> > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> >   <SOAP-ENV:Body>
> >      <ns1:ssoLoginResponse>
> >         <ns1:ssoLoginRet xsi:type="ns1:ssoLoginRet">
> >            <login xsi:type="xsd:string">a.pirker</login>
> >            <email xsi:type="xsd:string">anton.pirker@bla.com</email>
> >            <hash
> > xsi:type="xsd:string">bd3eb6079db946622fcbc84f5204f01a</hash>
> >            <token
> > xsi:type="xsd:string">a2047ad88fc3bd91b1034e544a0934c1</token>
> >         </ns1:ssoLoginRet>
> >      </ns1:ssoLoginResponse>
> >   </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> > ------ snap ---------
> >
> > I do not see the error. i have an output message loginResponse which
> > contains a part of type loginRet. And that is exactly what i am
> > getting...
> > What am i missing?
> >
> > My setup: Yesterdays snapshot of Axis2 on Windows.
> > Build the Stub with following command: [axis2-dir]\bin> wsdl2java.bat
> > -uri Authentification.wsdl -p at.ignaz.sso -d adb -s -o sso
> >
> >
> > Any help is greatly appreciated!
> >
> > Thanks in advance,
> > Anton
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


addendum: Re: Unexpected subelement when calling adb stub method

Posted by Anton Pirker <he...@gmiatlich.net>.
Hi again!

In my first mail i forget the Binding of the WSDL. Maybe this is also 
important:

------ snip ---------
   <binding name="ssoServiceBinding" type="typens:ssoServicePort">
      <soap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="ssoLogin">
         <soap:operation soapAction="urn:ssoServiceAction"/>        
         <input>
            <soap:body use="literal" namespace="urn:ssoService" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
         </input>
         <output>
            <soap:body use="literal" namespace="urn:ssoService" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
         </output>
      </operation>
   </binding>
------ snap ---------

Anton Pirker wrote:
> Hi all!
>
> I am new to Axis2 and trying to implement an SSO service. I have an 
> WSDL from which i generated my java stub.
> When i call the generated ssoLogin-Method i allways get an "Unexpected 
> subelement".
>
> This is what the WSDL looks like: (only the important parts)
>
>
> ------ snip ---------
>      <operation name="ssoLogin" parameterOrder="ssoLoginUser c_login 
> c_password c_client">
>         <input message="typens:ssoLoginRequest"/>
>         <output message="typens:ssoLoginResponse"/>
>      </operation>
>
>      <message name="ssoLoginResponse">
>         <part name="ssoLoginRet" type="typens:ssoLoginRet"/>
>      </message>
>
>      <xsd:complexType name="ssoLoginRet">
>        <xsd:all>
>          <xsd:element minOccurs="0" maxOccurs="1" name="login" 
> type="xsd:string"/>
>          <xsd:element minOccurs="0" maxOccurs="1" name="email" 
> type="xsd:string"/>
>          <xsd:element minOccurs="0" maxOccurs="1" name="hash" 
> type="xsd:string"/>
>          <xsd:element minOccurs="0" maxOccurs="1" name="token" 
> type="xsd:string"/>
>           ...
>        </xsd:all>
>      </xsd:complexType>
> ------ snap ---------
>
>
> and this is the response i get (copied from the log):
> ------ snip ---------
> <SOAP-ENV:Envelope 
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>                   xmlns:ns1="urn:ssoService"
>                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                   
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>                   
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>   <SOAP-ENV:Body>
>      <ns1:ssoLoginResponse>
>         <ns1:ssoLoginRet xsi:type="ns1:ssoLoginRet">
>            <login xsi:type="xsd:string">a.pirker</login>
>            <email xsi:type="xsd:string">anton.pirker@bla.com</email>
>            <hash 
> xsi:type="xsd:string">bd3eb6079db946622fcbc84f5204f01a</hash>
>            <token 
> xsi:type="xsd:string">a2047ad88fc3bd91b1034e544a0934c1</token>
>         </ns1:ssoLoginRet>
>      </ns1:ssoLoginResponse>
>   </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
> ------ snap ---------   
>
> I do not see the error. i have an output message loginResponse which 
> contains a part of type loginRet. And that is exactly what i am 
> getting...
> What am i missing?
>
> My setup: Yesterdays snapshot of Axis2 on Windows.
> Build the Stub with following command: [axis2-dir]\bin> wsdl2java.bat 
> -uri Authentification.wsdl -p at.ignaz.sso -d adb -s -o sso
>
>
> Any help is greatly appreciated!
>
> Thanks in advance,
> Anton
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org