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 Bill Treuman <Bi...@CARQUEST.com> on 2007/04/02 18:30:56 UTC

GetABCResponse with Two Direct Children

We are currently testing Axis2 with JiBX.  One of our web service method
calls expects two direct children, as follows:

      <element name="getABCResponse">
        <complexType>
          <sequence>
          	<element name="aTypeAObject"  type="tns: TypeAObject "/>
          	<element name=" aTypeBObject " type="tns: TypeBObject "/>
          </sequence>
        </complexType>
      </element>

This response is certainly WS-I compliant.  Our objective in this case is to
obtain a Soap message in which the TypeAObject element and the TypeBObject
element are direct children of the getABCResponse element.

It would be much more common in all Axis2 and JiBX examples to see something
like the following doubly-wrapped method, which is also WS-I compliant:

      <element name="getABCResponse">
        <complexType>
          <sequence>
          	<element name="getABCReturn"  type="tns: ABCReturn"/>
          </sequence>
        </complexType>
      </element>

The ABCReturn element would then contain the TypeAObject and the
TypeBObject.  In the Soap message, there would be an intermediate-level xml
element representing the ABCReturn.

When we run WSDL2Java with the –uw switch with the former method call,
WSDL2Java throws the following Exception:

[java] Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException
: Cannot unwrap element
{http://ws.sosnoski.com/library/wsdl}findVehicleResponse: only one child
element allowed in sequence for wrapped output

Is there a way to produce the type of Soap message described above, without
any intermediate-level wrapping element?  If not, is the need for the
intervening element some type of standard, or is it something which Axis2 or
JiBX requires?

Thanks very much.



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


Re: GetABCResponse with Two Direct Children

Posted by Anne Thomas Manes <at...@gmail.com>.
The auto-unwrapping feature requires the double wrapping. That's a
requirement of the undocumented "wrapped document/literal" convention.
If you don't want the response message to be double wrapped, then
don't specify -uw.

(Note that if you want to support easy interoperability with .NET, you
must use this double wrapping.)

Anne

On 4/2/07, Bill Treuman <Bi...@carquest.com> wrote:
> We are currently testing Axis2 with JiBX.  One of our web service method
> calls expects two direct children, as follows:
>
>       <element name="getABCResponse">
>         <complexType>
>           <sequence>
>                 <element name="aTypeAObject"  type="tns: TypeAObject "/>
>                 <element name=" aTypeBObject " type="tns: TypeBObject "/>
>           </sequence>
>         </complexType>
>       </element>
>
> This response is certainly WS-I compliant.  Our objective in this case is to
> obtain a Soap message in which the TypeAObject element and the TypeBObject
> element are direct children of the getABCResponse element.
>
> It would be much more common in all Axis2 and JiBX examples to see something
> like the following doubly-wrapped method, which is also WS-I compliant:
>
>       <element name="getABCResponse">
>         <complexType>
>           <sequence>
>                 <element name="getABCReturn"  type="tns: ABCReturn"/>
>           </sequence>
>         </complexType>
>       </element>
>
> The ABCReturn element would then contain the TypeAObject and the
> TypeBObject.  In the Soap message, there would be an intermediate-level xml
> element representing the ABCReturn.
>
> When we run WSDL2Java with the –uw switch with the former method call,
> WSDL2Java throws the following Exception:
>
> [java] Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException:
> java.lang.RuntimeException
> : Cannot unwrap element
> {http://ws.sosnoski.com/library/wsdl}findVehicleResponse: only one child
> element allowed in sequence for wrapped output
>
> Is there a way to produce the type of Soap message described above, without
> any intermediate-level wrapping element?  If not, is the need for the
> intervening element some type of standard, or is it something which Axis2 or
> JiBX requires?
>
> Thanks very much.
>
>
>
> ---------------------------------------------------------------------
> 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