You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by "Tolsch, Ed" <Ed...@fmr.com> on 2002/05/09 23:22:12 UTC

Question on if this can be done.

HI,
	I'm using the Soap 2.2 toolkit on AIX and the castor product to
marshall/unmarshall my xml.  I'm trying to send a response back like the
following:

 . . .
 <SOAP-ENV:Body>
     <SetPersonResponse>
	<NodeA>
		<other sub nodes here>
	</NodeA>
	<NodeB>
		<other subnodes here>
	</NodeB>
     </SetPersonResponse>
  </SOAP-ENV:Body>

...

The issue is the SetPerson method which gets invoked via the RPC call is a
java method which can return a bean and not two peer elements like above.  I
have no problems returning just NodeA and any level of complexity under that
but cannot return two peer elements at the highest level.  Can anyone
provide any insight to my shortcomings. Thanks in advance.


Ed Tolsch
817.474.9939
ed.tolsch@fmr.com


Re: Question on if this can be done.

Posted by Scott Nichol <sn...@scottnichol.com>.
Ed,

The response from a SOAP RPC call needs to be a single value, although that
value can be a complex type.  Therefore, only 1 element can be a direct
descendant of the SetPersonResponse element.  If the type you want to return is
the composition of NodeA and NodeB, you must have an element containing these.
For example, if the Java method implementing the service has a signature

MyType SetPerson(...)

where MyType marshals as a composition of multiple properties, the response
might look like

<SetPersonResponse>
    <ResponseValue xmlns:myns="urn:mytype" xsi:type="myns:mytype">
        <NodeA>
            <other sub nodes here>
        </NodeA>
        <NodeB>
            <other subnodes here>
        </NodeB>
    </ResponseValue>
</SetPersonResponse>

Your code would need to map myns:mytype to the Java type MyType, of course.

Scott

----- Original Message -----
From: "Tolsch, Ed" <Ed...@fmr.com>
To: <so...@xml.apache.org>
Sent: Thursday, May 09, 2002 5:22 PM
Subject: Question on if this can be done.


> HI,
> I'm using the Soap 2.2 toolkit on AIX and the castor product to
> marshall/unmarshall my xml.  I'm trying to send a response back like the
> following:
>
>  . . .
>  <SOAP-ENV:Body>
>      <SetPersonResponse>
> <NodeA>
> <other sub nodes here>
> </NodeA>
> <NodeB>
> <other subnodes here>
> </NodeB>
>      </SetPersonResponse>
>   </SOAP-ENV:Body>
>
> ...
>
> The issue is the SetPerson method which gets invoked via the RPC call is a
> java method which can return a bean and not two peer elements like above.  I
> have no problems returning just NodeA and any level of complexity under that
> but cannot return two peer elements at the highest level.  Can anyone
> provide any insight to my shortcomings. Thanks in advance.
>
>
> Ed Tolsch
> 817.474.9939
> ed.tolsch@fmr.com
>
>


Re: Question on if this can be done.

Posted by Scott Nichol <sn...@scottnichol.com>.
Ed,

The response from a SOAP RPC call needs to be a single value, although that
value can be a complex type.  Therefore, only 1 element can be a direct
descendant of the SetPersonResponse element.  If the type you want to return is
the composition of NodeA and NodeB, you must have an element containing these.
For example, if the Java method implementing the service has a signature

MyType SetPerson(...)

where MyType marshals as a composition of multiple properties, the response
might look like

<SetPersonResponse>
    <ResponseValue xmlns:myns="urn:mytype" xsi:type="myns:mytype">
        <NodeA>
            <other sub nodes here>
        </NodeA>
        <NodeB>
            <other subnodes here>
        </NodeB>
    </ResponseValue>
</SetPersonResponse>

Your code would need to map myns:mytype to the Java type MyType, of course.

Scott

----- Original Message -----
From: "Tolsch, Ed" <Ed...@fmr.com>
To: <so...@xml.apache.org>
Sent: Thursday, May 09, 2002 5:22 PM
Subject: Question on if this can be done.


> HI,
> I'm using the Soap 2.2 toolkit on AIX and the castor product to
> marshall/unmarshall my xml.  I'm trying to send a response back like the
> following:
>
>  . . .
>  <SOAP-ENV:Body>
>      <SetPersonResponse>
> <NodeA>
> <other sub nodes here>
> </NodeA>
> <NodeB>
> <other subnodes here>
> </NodeB>
>      </SetPersonResponse>
>   </SOAP-ENV:Body>
>
> ...
>
> The issue is the SetPerson method which gets invoked via the RPC call is a
> java method which can return a bean and not two peer elements like above.  I
> have no problems returning just NodeA and any level of complexity under that
> but cannot return two peer elements at the highest level.  Can anyone
> provide any insight to my shortcomings. Thanks in advance.
>
>
> Ed Tolsch
> 817.474.9939
> ed.tolsch@fmr.com
>
>