axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nora Serinek <nseri...@berlin-sws.de>
Subject Re: ADBException: Unexpected subelement when using Axis2-generatedWSDL with useOriginalwsdl="true"
Date Thu, 23 Jul 2009 15:48:26 GMT
Yes, it seams to be a namespace problem, but I don't get it together.

We didn't change a thing in the WSDL, yet it behaves different.

Debugging showed the following:

Case 1 (let Axis generate the WSDL on the fly):

In RPCMessageReceiver.invokeBusinessLogic you see the AxisOperation of
the OperationContext in the InMessage as 
name the value "login" (without any NamespaceURI)

Later in the code when parsing the SOAP
org.apache.axis2.databinding.utils.BeanUtil.deserialize gets an
OMElement as input parameter response which is the body of the SOAP-
request (without the envelope)
This is parsed correctly into an array with the three expected string
input parameter for our login-method and everything goes well.

Case 2 (use the same WSDL but declare it explicitly via
useOriginalwsdl="true"):

In this case you see in RPCMessageReceiver.invokeBusinessLogic() in the
AxisOperation of the OperationContext in the InMessage that name has the
value "{http://mcs.ws.ibet.com}login"

Later in the code
org.apache.axis2.databinding.utils.BeanUtil.deserialize gets the same
input as in case 1 but parses it different. The result of parsing is an
array of one empty string "". This is of course far away from what our
login-method expects as input :(

Any idea what's going wrong here and where this namespace suddenly comes
from?

Many thanks!

Nora




Am Donnerstag, den 23.07.2009, 06:11 -0600 schrieb Larry Meadors:

> I JUST had this happen to me 2 days ago.
> 
> It turned out that in my case, the namespace for the unexpected
> element was the problem.
> 
> I ended up running the service in a debugger and IIRC, I found it in
> the fromOM method of the service's MessageReceiverInOut class. It was
> calling something like this:
> 
> parse(param.getXMLStreamReaderWithoutCaching())
> 
> Once I found the mismatched namespaces, I was able to fix my wsdl so
> they matched - unfortunately it was really late at night and I don't
> remember more details than that. Sorry. :(
> 
> Larry
> 
> 
> On Thu, Jul 23, 2009 at 4:44 AM, Nora Serinek<nserinek@berlin-sws.de> wrote:
> > Hi,
> >
> > I am getting mad.
> >
> > We have a method like this in our webservice class MCSLoginService:
> >
> > public class MCSLoginService {
> >     public ErrorCode login(String username, String password, String
> > language) {..}
> > }
> >
> > In the services.xml the service is defined as following:
> >
> > <service name="MCSLoginService" scope="transportsession"
> > useOriginalwsdl="false" targetNamespace="http://mcs.ws.ibet.com">
> >   <description>MCSLoginService</description>
> >   <parameter
> > name="ServiceClass">com.ibet.ws.mcs.server.axis2.MCSLoginService</parameter>
> >   <schema namespace="http://mcs.ws.ibet.com">
> >     <mapping namespace="http://server.mcs.ws.ibet.com"
> > package="com.ibet.ws.mcs.server.axis2"/>
> >     <mapping namespace="http://share.b2b.ws.ibet.com"
> > package="com.ibet.ws.b2b.share"/>
> >   </schema>
> >   <messageReceivers>
> >     <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
> > class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> >   </messageReceivers>
> > </service>
> >
> > If setting the parameter useOriginalwsdl="false" the attached WSDL is
> > generated.
> >
> > This works fine and results in the following SOAP for the login-method:
> >
> > <?xml version='1.0' encoding='utf-8'?>
> > <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> >   <soapenv:Body>
> >     <ns2:login xmlns:ns2="http://axis2.server.mcs.ws.ibet.com">
> >       <ns2:username>admin</ns2:username>
> >       <ns2:password>111</ns2:password>
> >       <ns2:language>de</ns2:language>
> >     </ns2:login>
> >   </soapenv:Body>
> > </soapenv:Envelope>
> >
> >
> > <?xml version='1.0' encoding='utf-8'?>
> > <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> >   <soapenv:Body>
> >     <ns:loginResponse xmlns:ns="http://axis2.server.mcs.ws.ibet.com">
> >       <ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:nil="true" />
> >     </ns:loginResponse>
> >   </soapenv:Body>
> > </soapenv:Envelope>
> >
> > Because we are planning to modify the WSDL, we downloaded that WSDL and
> > switched useOriginalwsdl to "true" and then something is going completely
> > wrong although we didn't change anything in the WSDL.
> >
> > The login-method obviuosly doesn't get the values for the input parameters
> > and therefore sends back an error code which in turn cannot be read by the
> > client we generated from the WSDL.
> > The client shows the following error message:
> >
> > ADBException: Unexpected subelement displayable
> >
> > Good old acquaintance, right?
> >
> > Here is the SOAP that is generated in that case:
> >
> > <?xml version='1.0' encoding='utf-8'?>
> > <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> >   <soapenv:Body>
> >     <ns2:login xmlns:ns2="http://axis2.server.mcs.ws.ibet.com">
> >       <ns2:username>admin</ns2:username>
> >       <ns2:password>111</ns2:password>
> >       <ns2:language>de</ns2:language>
> >     </ns2:login>
> >   </soapenv:Body>
> > </soapenv:Envelope>
> >
> >
> > <?xml version='1.0' encoding='utf-8'?>
> > <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> >   <soapenv:Body>
> >     <ns:loginResponse xmlns:ns="http://axis2.server.mcs.ws.ibet.com">
> >       <ns:return>
> >         <ns:displayable>false</ns:displayable>
> >         <ns:errorCode>MCS-6</ns:errorCode>
> >         <ns:language>en</ns:language>
> >         <ns:message>Language null is not supported</ns:message>
> >       </ns:return>
> >     </ns:loginResponse>
> >   </soapenv:Body>
> > </soapenv:Envelope>
> >
> > We are desperate, all other threads for ADBException: Unexpected subelement
> > didn't help.
> >
> > Regards,
> > Nora
> >
> >
> > ###########################################
> > This e-mail and any files transmitted with it are confidential and
> > intended solely for the use of the individual or entity to whom they
> > are addressed. If you have received this e-mail in error please notify
> > the system manager.
> >
> 
> 
> 
###########################################
This e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they 
are addressed. If you have received this e-mail in error please notify 
the system manager.

Mime
View raw message