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 Adaptive Protocols <ad...@yahoo.com> on 2004/12/20 12:48:27 UTC

Problem with {User defined type} having array of {User defined type} with RPC-Literal

Hello,
 
We are trying to work with our web service, which is published as RPC-Literal. In all the simple cases, it is working very fine. But in some of the cases, we are facing problems; like:
 
a). If an operation has a parameter with a schema like 'A user defined type having a array of User defined type'; we are getting server side exception. Stating that 'invalid element with class named - item'.
 
For example, schema is:
Person
    name (String)
    addresses (array of Address)
        hno (int)   
        street (String)
 
With it, we are getting exception that 'Invalid element with class Address - Item'.
 
We have given the mappings for person, address and even also tried with mapping for address array. But it seems that Axis Server is not picking up typeMappings for the array, in RPC literal case. With RPC-Encoded, it is working fine.
Besides it, BeanDeserializer class is picking up array's component type for finding out the deserializer for addresses.
 
b). If any of the operation's return type is an array of primitives, then with RPC-encoded service we need not to specify any mapping on client side. But RPC-Literal seems to be demanding for a mapping even for premitives array on client side.
Error message is something like 'No mapping found for Array_of_tns_int'.
 
Any reply in this regard will be a great help for us. 
 
Thanks, 
Mohit Gupta.

		
---------------------------------
Do you Yahoo!?
 Meet the all-new My Yahoo! � Try it today! 

Re: Problem with {User defined type} having array of {User defined type} with RPC-Literal

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
Is "wrapped" supposed to have meaning only on the server side (where it
determines how arguments are passed to the implementation method for the
operation), or also on the client side (where it would determine whether the
document that makes up the soap body of a doc/lit operation must be
supplied, or whether Axis will assemble one from the child components of
that document)?

Also, if  "wrapped" has meaning on the client side, is its usage completely
independent of what is done on the server side, since what is transmitted
over the wire is the same?  That is, the client could set the style to be
wrapped in a deployment descriptor in order to be able to supply primitive
data types and have them assembled into the request document, even if the
service implementation is processing that document as a whole (and vice
versa)?

Axis currently supports use of wrapped on the client.  I noticed recently
using the Axis samples.client.DynamicInvoker with a doc/lit web service
looking like (namespace stuff omitted):
     <types>
         <schema ...>
             <element name="x" type="X"/>
              <complexType name="X">
                   <sequence>
                   <element name="a" type="anyURI"/>
                    </sequence>
              </complexType>

             <element name="xResponse" type="XResponse"/>
              <complexType name="XResponse">
                  <sequence>
                       <element name="b" type="string"/>
                   </sequence>
              </complexType>
           </schema>
       </types>


     <message name="xRequest">
          <part name="parameters" element="x"/>
     </message>
     <message name="xResponse">
          <part name="parameters" element="xResponse"/>
     </message>

     <portType name="xPT">
           <operation name="x">
                <input message="xRequest"/>
                 <output message="xResponse"/>
           </operation>
     </portType>

that I could pass the single WS argument "urn:foo" to the DynamicInvoker
client command line, and it would use this to construct the content for the
request's soap body:
    <x><a>urn:foo</a></x>
under the assumption that this operation is wrapped (verified by the traces
emitted with debug logging enabled for Axis).

Jeff
----- Original Message ----- 
From: "Anne Thomas Manes" <at...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Monday, December 20, 2004 9:14 AM
Subject: Re: Problem with {User defined type} having array of {User defined
type} with RPC-Literal


Note that Axis doesn't really support RPC/Literal. It kinda supports
it from a client perspective, but there's no Axis WSDD "style"
attribute value that corresponds to RPC/Literal.

I suggest you use Wrapped Document/Literal instead.
(Note that .NET does not support RPC/Literal, either.)

Anne



Re: Problem with {User defined type} having array of any type with Wrapped-Literal

Posted by Adaptive Protocols <ad...@yahoo.com>.
Hi All,
 
I am waiting for a kind response for this problem. I am just stuck with this one. Any clue would be a great help for me.
 
Thanks,
Mohit
 

Adaptive Protocols <ad...@yahoo.com> wrote:
Thanks Anne. I am trying with Wrapped Document/Literal.
 
But here also, I am facing the same problem. I even tried with a user define type having an array of primitives, schema is like
 
Company (Company Java Object - UDT)
    employeeCodes ( int array )
 
I passed this object to server using operation testCompany (Company).
 
The soap message generated is fine as per my knowledge. It is something like:
<soapenv: Body>
    <testCompany xmlns="abc">
        <Company>
            <employeeCodes>
                <items>......
            </employeeCodes>
        </Company>
    </testCompany>
<soapenv: Body>
  
But on server, it is showing problem while finding deserializer for the array type of attribute for company object. Exception Faced is: 
SAXException: SimpleDeserializer encounterd a child element, which is NOT expected, in something it was trying to deserialize.
 
It is again the same problem, i.e. BeanDeserializer is getting simple Deserializer for array type of property. 
 
Help is required urgently. 
 
Thanks,
Mohit

Anne Thomas Manes <at...@gmail.com> wrote:
Note that Axis doesn't really support RPC/Literal. It kinda supports
it from a client perspective, but there's no Axis WSDD "style"
attribute value that corresponds to RPC/Literal.

I suggest you use Wrapped Document/Literal instead.
(Note that .NET does not support RPC/Literal, either.)

Anne

On Mon, 20 Dec 2004 03:48:27 -0800 (PST), Adaptive Protocols
wrote:
> Hello,
> 
> We are trying to work with our web service, which is published as
> RPC-Literal. In all the simple cases, it is working very fine. But in some
> of the cases, we are facing problems; like:
> 
> a). If an operation has a parameter with a schema like 'A user defined type
> having a array of User defined type'; we are getting server side exception.
> Stating that 'invalid element with class named - item'.
> 
> For example, schema is:
> Person
> name (String)
> addresses (array of Address)
> hno (int) 
> street (String)
> 
> With it, we are getting exception that 'Invalid element with class Address -
> Item'.
> 
> We have given the mappings for person, address and even also tried with
> mapping for address array. But it seems that Axis Server is not picking up
> typeMappings for the array, in RPC literal case. With RPC-Encoded, it is
> working fine.
> Besides it, BeanDeserializer class is picking up array's component type for
> finding out the deserializer for addresses.
> 
> b). If any of the operation's return type is an array of primitives, then
> with RPC-encoded service we need not to specify any mapping on client side.
> But RPC-Literal seems to be demanding for a mapping even for premitives
> array on client side.
> Error message is something like 'No mapping found for Array_of_tns_int'.
> 
> Any reply in this regard will be a great help for us. 
> 
> Thanks, 
> Mohit Gupta.
> 
> ________________________________
> Do you Yahoo!?
> Meet the all-new My Yahoo! – Try it today! 
> 
>


---------------------------------
Do you Yahoo!?
Dress up your holiday email, Hollywood style. Learn more.
		
---------------------------------
Do you Yahoo!?
 Meet the all-new My Yahoo! � Try it today! 

Re: Problem with {User defined type} having array of any type with Wrapped-Literal

Posted by Adaptive Protocols <ad...@yahoo.com>.
Thanks Anne. I am trying with Wrapped Document/Literal.
 
But here also, I am facing the same problem. I even tried with a user define type having an array of primitives, schema is like
 
Company (Company Java Object - UDT)
    employeeCodes ( int array )
 
I passed this object to server using operation testCompany (Company).
 
The soap message generated is fine as per my knowledge. It is something like:
<soapenv: Body>
    <testCompany xmlns="abc">
        <Company>
            <employeeCodes>
                <items>......
            </employeeCodes>
        </Company>
    </testCompany>
<soapenv: Body>
  
But on server, it is showing problem while finding deserializer for the array type of attribute for company object. Exception Faced is: 
SAXException: SimpleDeserializer encounterd a child element, which is NOT expected, in something it was trying to deserialize.
 
It is again the same problem, i.e. BeanDeserializer is getting simple Deserializer for array type of property. 
 
Help is required urgently. 
 
Thanks,
Mohit

Anne Thomas Manes <at...@gmail.com> wrote:
Note that Axis doesn't really support RPC/Literal. It kinda supports
it from a client perspective, but there's no Axis WSDD "style"
attribute value that corresponds to RPC/Literal.

I suggest you use Wrapped Document/Literal instead.
(Note that .NET does not support RPC/Literal, either.)

Anne

On Mon, 20 Dec 2004 03:48:27 -0800 (PST), Adaptive Protocols
wrote:
> Hello,
> 
> We are trying to work with our web service, which is published as
> RPC-Literal. In all the simple cases, it is working very fine. But in some
> of the cases, we are facing problems; like:
> 
> a). If an operation has a parameter with a schema like 'A user defined type
> having a array of User defined type'; we are getting server side exception.
> Stating that 'invalid element with class named - item'.
> 
> For example, schema is:
> Person
> name (String)
> addresses (array of Address)
> hno (int) 
> street (String)
> 
> With it, we are getting exception that 'Invalid element with class Address -
> Item'.
> 
> We have given the mappings for person, address and even also tried with
> mapping for address array. But it seems that Axis Server is not picking up
> typeMappings for the array, in RPC literal case. With RPC-Encoded, it is
> working fine.
> Besides it, BeanDeserializer class is picking up array's component type for
> finding out the deserializer for addresses.
> 
> b). If any of the operation's return type is an array of primitives, then
> with RPC-encoded service we need not to specify any mapping on client side.
> But RPC-Literal seems to be demanding for a mapping even for premitives
> array on client side.
> Error message is something like 'No mapping found for Array_of_tns_int'.
> 
> Any reply in this regard will be a great help for us. 
> 
> Thanks, 
> Mohit Gupta.
> 
> ________________________________
> Do you Yahoo!?
> Meet the all-new My Yahoo! – Try it today! 
> 
>

		
---------------------------------
Do you Yahoo!?
 Dress up your holiday email, Hollywood style. Learn more.

Re: Problem with {User defined type} having array of {User defined type} with RPC-Literal

Posted by Anne Thomas Manes <at...@gmail.com>.
Note that Axis doesn't really support RPC/Literal. It kinda supports
it from a client perspective, but there's no Axis WSDD "style"
attribute value that corresponds to RPC/Literal.
 
I suggest you use Wrapped Document/Literal instead.
(Note that .NET does not support RPC/Literal, either.)

Anne

On Mon, 20 Dec 2004 03:48:27 -0800 (PST), Adaptive Protocols
<ad...@yahoo.com> wrote:
> Hello,
>  
> We are trying to work with our web service, which is published as
> RPC-Literal. In all the simple cases, it is working very fine. But in some
> of the cases, we are facing problems; like:
>  
> a). If an operation has a parameter with a schema like 'A user defined type
> having a array of User defined type'; we are getting server side exception.
> Stating that 'invalid element with class named - item'.
>  
> For example, schema is:
> Person
>     name (String)
>     addresses (array of Address)
>         hno (int)   
>         street (String)
>  
> With it, we are getting exception that 'Invalid element with class Address -
> Item'.
>  
> We have given the mappings for person, address and even also tried with
> mapping for address array. But it seems that Axis Server is not picking up
> typeMappings for the array, in RPC literal case. With RPC-Encoded, it is
> working fine.
> Besides it, BeanDeserializer class is picking up array's component type for
> finding out the deserializer for addresses.
>  
> b). If any of the operation's return type is an array of primitives, then
> with RPC-encoded service we need not to specify any mapping on client side.
> But RPC-Literal seems to be demanding for a mapping even for premitives
> array on client side.
> Error message is something like 'No mapping found for Array_of_tns_int'.
>  
> Any reply in this regard will be a great help for us. 
>  
> Thanks, 
> Mohit Gupta.
> 
> ________________________________
> Do you Yahoo!?
> Meet the all-new My Yahoo! – Try it today! 
> 
>