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 Damian Carey <ja...@gmail.com> on 2010/04/29 13:52:16 UTC

Axis2, SOAP, MultiRef, and an ADBException: Unexpected subelement

Hello all,

The summary of this post is "Can Axis2 support MultiRef"

I'm Java desktop guy who is a novice at SOAP / HTTP / multiref / etc.
I had never heard of multiref until today.

Some months ago a large insurance company gave permission for our app
to connect to their system via their SOAP interface.  They kindly
provided the appropriate WSDL and we set about a few months work
implementing the client end of the connection. We've used Axis2, ADB,
and JAXB where appropriate. We are one of several ISVs who utilize
this connection, and we have ZERO influence over their interface &
server. It is a quite big and complex WSDL, and the generated stub is
about 13,000 lines long. We could not test until all this work was
done, so we have done a LOT of work before we were able to discover
this issue.

Now we are testing we are finding an error.  Please remember I am a
novice at anything to do with SOAP / Axis2 / ADB / etc so this may not
make sense.

We can connect via HTTPS, send a "request", and get a "response", but
the response generates an "ADBException: Unexpected subelement".
Looking at the wire trace we received from the server we see the soap
message ...

---start-------------
<soapenv:Envelope>
 <soapenv:Body>
  <ns1:getAckResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <getAckReturn href="#id0"/>
  </ns1:getAckResponse>
  <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:TransReport">
   <errorMessage xsi:type="soapenc:string"/>
   <transStatus href="#id1"/>
   <uniqueId xsi:type="soapenc:string"/>
  </multiRef>
  <multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int">-1</multiRef>
 </soapenv:Body>
</soapenv:Envelope>
---end---------------

I am not familiar with SOAP msg formats, but I do know that the
correct value for transStatus in this situation is "-1". I can see
that "-1" is at "id1" in the message.

So I started searching the net looking for information.

I found this message
http://www.mail-archive.com/axis-user@ws.apache.org/msg26972.html
entitled "AXIS2 - ADB and multiref?" that suggests that Axis2 does not
support multiref, but Axis1 might.

<email-snip>
Multiref is not supported in document/literal messages. (The multirefs
would not conform to the literal schema unless the schema explicitly
defines the use of multirefs.)
In order to use multirefs, you must use RPC/encoded. Axis2 does not
support RPC/encoded. Try Axis 1.x.
</email-snip>

Due to my limited knowledge and experience in this area, and my lack
of understanding of Axis / Axis2 / SOAP / multiref etc, I simply do
not know which way to go.

- Can anyone suggest a direction to progress in?
- Does the above make sense ?
- Is Axis2 incapable of dealing with the SOAP messages from that server ?
- Is there any possible workaround in Axis2 ?
- Are there other things I should check ?
- Should we give up on Axis2 and try Axis1 instead ?
- ANY other options / suggestions / advice / workarounds ?

I can confirm that the Insurance company will not modify their system
at all as they have a working system and several other ISVs that
successfully connect, so it us up to us to adapt to their system.

I appreciate that this is a big wack of incoherrent information to
dump here, but we are really struggling here.

Any and all suggestions / feedback / advice will be greatly appreciated.

Many Thanks,
-Damian

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


Re: Axis2, SOAP, MultiRef, and an ADBException: Unexpected subelement

Posted by Amila Suriarachchi <am...@gmail.com>.
On Fri, Apr 30, 2010 at 1:38 PM, Damian Carey <ja...@gmail.com> wrote:

> Amila
> Thanks very much for your reply.
>
> On Fri, Apr 30, 2010 at 12:46 AM, Amila Suriarachchi
> <am...@gmail.com> wrote:
> >
> > On Thu, Apr 29, 2010 at 5:22 PM, Damian Carey <ja...@gmail.com> wrote:
> >> Hello all,
> >> The summary of this post is "Can Axis2 support MultiRef"
>
> > you can try with this.
> >
> > change your generated stub to and the following line
> >    MultirefHelper.processHrefAttributes(_returnEnv); below the return
> > envelope as given. For each operation.
> >
> > like this
> >
> > org.apache.axiom.soap.SOAPEnvelope _returnEnv =
> > _returnMessageContext.getEnvelope();
> >                 MultirefHelper.processHrefAttributes(_returnEnv);
>
> Fantastic advise.
>
> It ALMOST worked (I think). I would like to try one more thing to see
> if it works ...
>
> The correct data seemed to be transferred into the initial "element".
> The only problem is that the two "multiRef" elements were not removed.
> It is still failing but I think it is only failing because the
> multiRef elements are still there.
>
> ---- after MultirefHelper helper -------------------------------
> <soapenv:Envelope>
>  <soapenv:Body>
>  <ns1:getAcknowledgementResponse
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>    <getAcknowledgementReturn soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns2:TransactionReport">
>     <errorMessage xsi:type="soapenc:string"/>
>     <transactionStatus soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:int">-1</transactionStatus>
>    <uniqueIdentifier xsi:type="soapenc:string"/>
>   </getAcknowledgementReturn>
>  </ns1:getAcknowledgementResponse>
>   <multiRef id="id0" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns2:TransactionReport">
>    <errorMessage xsi:type="soapenc:string"/>
>    <transactionStatus href="#id1"/>
>   <uniqueIdentifier xsi:type="soapenc:string"/>
>   </multiRef>
>  <multiRef id="id1" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:int">-1</multiRef>
>  </soapenv:Body>
> </soapenv:Envelope>
> ------end --------------------
>
> Is there any way to remove the two "multiRef" elements?
> I can iterate through the "soapBody.getChildElements()" and "see" the
> elements, but I'm not sure how to actually remove the multirefs before
> passing the soapBody on.
>
> In other words I would like to write my own processor, something like
> MyExtendedMultirefHelper.processHrefAttributes(_returnEnv);
> to remove those elements and see if the remainder works OK.
>
>
> > if this does not work I think you have no option other than using another
> > stack.
>
> Yes.  That may well end up being the case.
>
> Just one question first. Can you suggest which other stack may work ???
>
> I realise that you cannot advise me or guarantee anything etc, but you
> may have some knowledge of what may work in this situation. Perhaps
> Axis1?  perhaps another suggestion?? Any guidance would be most
> welcome.


I have not worked with Axis1. But it supports soap encoding. So try with
Axis1.

thanks,
Amila.


>
> > thanks,
> > Amila.
>
> Thanks you very much ...
> -Damian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: Axis2, SOAP, MultiRef, and an ADBException: Unexpected subelement

Posted by Damian Carey <ja...@gmail.com>.
Amila
Thanks very much for your reply.

On Fri, Apr 30, 2010 at 12:46 AM, Amila Suriarachchi
<am...@gmail.com> wrote:
>
> On Thu, Apr 29, 2010 at 5:22 PM, Damian Carey <ja...@gmail.com> wrote:
>> Hello all,
>> The summary of this post is "Can Axis2 support MultiRef"

> you can try with this.
>
> change your generated stub to and the following line
>    MultirefHelper.processHrefAttributes(_returnEnv); below the return
> envelope as given. For each operation.
>
> like this
>
> org.apache.axiom.soap.SOAPEnvelope _returnEnv =
> _returnMessageContext.getEnvelope();
>                 MultirefHelper.processHrefAttributes(_returnEnv);

Fantastic advise.

It ALMOST worked (I think). I would like to try one more thing to see
if it works ...

The correct data seemed to be transferred into the initial "element".
The only problem is that the two "multiRef" elements were not removed.
It is still failing but I think it is only failing because the
multiRef elements are still there.

---- after MultirefHelper helper -------------------------------
<soapenv:Envelope>
 <soapenv:Body>
  <ns1:getAcknowledgementResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <getAcknowledgementReturn soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:TransactionReport">
    <errorMessage xsi:type="soapenc:string"/>
    <transactionStatus soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int">-1</transactionStatus>
    <uniqueIdentifier xsi:type="soapenc:string"/>
   </getAcknowledgementReturn>
  </ns1:getAcknowledgementResponse>
  <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:TransactionReport">
   <errorMessage xsi:type="soapenc:string"/>
   <transactionStatus href="#id1"/>
   <uniqueIdentifier xsi:type="soapenc:string"/>
  </multiRef>
  <multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int">-1</multiRef>
 </soapenv:Body>
</soapenv:Envelope>
------end --------------------

Is there any way to remove the two "multiRef" elements?
I can iterate through the "soapBody.getChildElements()" and "see" the
elements, but I'm not sure how to actually remove the multirefs before
passing the soapBody on.

In other words I would like to write my own processor, something like
MyExtendedMultirefHelper.processHrefAttributes(_returnEnv);
to remove those elements and see if the remainder works OK.


> if this does not work I think you have no option other than using another
> stack.

Yes.  That may well end up being the case.

Just one question first. Can you suggest which other stack may work ???

I realise that you cannot advise me or guarantee anything etc, but you
may have some knowledge of what may work in this situation. Perhaps
Axis1?  perhaps another suggestion?? Any guidance would be most
welcome.

> thanks,
> Amila.

Thanks you very much ...
-Damian

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


Re: Axis2, SOAP, MultiRef, and an ADBException: Unexpected subelement

Posted by Amila Suriarachchi <am...@gmail.com>.
On Thu, Apr 29, 2010 at 5:22 PM, Damian Carey <ja...@gmail.com> wrote:

> Hello all,
>
> The summary of this post is "Can Axis2 support MultiRef"
>
> I'm Java desktop guy who is a novice at SOAP / HTTP / multiref / etc.
> I had never heard of multiref until today.
>
> Some months ago a large insurance company gave permission for our app
> to connect to their system via their SOAP interface.  They kindly
> provided the appropriate WSDL and we set about a few months work
> implementing the client end of the connection. We've used Axis2, ADB,
> and JAXB where appropriate. We are one of several ISVs who utilize
> this connection, and we have ZERO influence over their interface &
> server. It is a quite big and complex WSDL, and the generated stub is
> about 13,000 lines long. We could not test until all this work was
> done, so we have done a LOT of work before we were able to discover
> this issue.
>
> Now we are testing we are finding an error.  Please remember I am a
> novice at anything to do with SOAP / Axis2 / ADB / etc so this may not
> make sense.
>
> We can connect via HTTPS, send a "request", and get a "response", but
> the response generates an "ADBException: Unexpected subelement".
> Looking at the wire trace we received from the server we see the soap
> message ...
>
> ---start-------------
> <soapenv:Envelope>
>  <soapenv:Body>
>  <ns1:getAckResponse
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>   <getAckReturn href="#id0"/>
>  </ns1:getAckResponse>
>  <multiRef id="id0" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns2:TransReport">
>   <errorMessage xsi:type="soapenc:string"/>
>   <transStatus href="#id1"/>
>   <uniqueId xsi:type="soapenc:string"/>
>  </multiRef>
>  <multiRef id="id1" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:int">-1</multiRef>
>  </soapenv:Body>
> </soapenv:Envelope>
> ---end---------------
>
> I am not familiar with SOAP msg formats, but I do know that the
> correct value for transStatus in this situation is "-1". I can see
> that "-1" is at "id1" in the message.
>
> So I started searching the net looking for information.
>
> I found this message
> http://www.mail-archive.com/axis-user@ws.apache.org/msg26972.html
> entitled "AXIS2 - ADB and multiref?" that suggests that Axis2 does not
> support multiref, but Axis1 might.
>
> <email-snip>
> Multiref is not supported in document/literal messages. (The multirefs
> would not conform to the literal schema unless the schema explicitly
> defines the use of multirefs.)
> In order to use multirefs, you must use RPC/encoded. Axis2 does not
> support RPC/encoded. Try Axis 1.x.
> </email-snip>
>
> Due to my limited knowledge and experience in this area, and my lack
> of understanding of Axis / Axis2 / SOAP / multiref etc, I simply do
> not know which way to go.
>
> - Can anyone suggest a direction to progress in?
> - Does the above make sense ?
> - Is Axis2 incapable of dealing with the SOAP messages from that server ?
> - Is there any possible workaround in Axis2 ?
> - Are there other things I should check ?
> - Should we give up on Axis2 and try Axis1 instead ?
> - ANY other options / suggestions / advice / workarounds ?
>

Did you use -u option when generating the code?

you can try with this.

change your generated stub to and the following line
   MultirefHelper.processHrefAttributes(_returnEnv); below the return
envelope as given. For each operation.

like this

org.apache.axiom.soap.SOAPEnvelope _returnEnv =
_returnMessageContext.getEnvelope();
                MultirefHelper.processHrefAttributes(_returnEnv);

if this does not work I think you have no option other than using another
stack.

thanks,
Amila.

>
> I can confirm that the Insurance company will not modify their system
> at all as they have a working system and several other ISVs that
> successfully connect, so it us up to us to adapt to their system.
>
> I appreciate that this is a big wack of incoherrent information to
> dump here, but we are really struggling here.
>
> Any and all suggestions / feedback / advice will be greatly appreciated.
>
> Many Thanks,
> -Damian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/