[ http://issues.apache.org/jira/browse/AXIS-1926?page=history ]

Davanum Srinivas updated AXIS-1926:
-----------------------------------

    Description: 
First of all, this has been discussed on the users mailing list, please refer 
to this thread as it may have more up-to-date information:

http://article.gmane.org/gmane.comp.apache.webservices.axis.user/29082

I have a data type defined as:

<complexType name="NamedValue">
<sequence>
  <element name="name" nillable="true" type="xsd:string" />
  <element name="value" nillable="true" type="xsd:anyType" />
</sequence>
</complexType>

I need the value to be xsd:anyType so that I can send arrays of NamedValue with 
various types for value.

On the server side I have a method defined as:

NamedValue[] login(String username, String password, NamedValue[] options)

Which in the WSDL the request looks like this:

- <element name="login">
-   <complexType>
-     <sequence>
         <element name="username" type="xsd:string" />
         <element name="password" type="xsd:string" />
         <element name="options" type="impl:NamedValue" maxOccurs="unbounded" />
    </sequence>
  </complexType>
</element>

And the response like this:

- <element name="loginResponse">
- <complexType>
-   <sequence>
      <element name="loginReturn" type="impl:NamedValue" maxOccurs="unbounded" 
/>
  </sequence>
</complexType>
</element>


If I create on the client side an options array that looks like this:

NamedValue[] options = new NamedValue[]
  {
    new NamedValue("dummy1", "dummy_val1"),

    new NamedValue("dummy2",
                   new NamedValue[]
                   {
                     new NamedValue("dummy2-1", "val2-1"),
                     new NamedValue("dummy2-2", new Integer(314))
                   })
  };

Note the array inside the array above.

A request to the server from an Axis client (latest CVS version of 1.2RC3) 
looks like this:

<login xmlns="http://some/namespace";>
   <username>tim</username>
   <password>tim</password>
   <options>
      <name>dummy1</name>
      <value xsi:type="xsd:string">dummy_val1</value>
   </options>
   <options>
      <name>dummy2</name>
      <value xsi:type="ns1:NamedValue" xmlns:ns1="http://some/namespace";>
        <name>dummy2-1</name>
        <value xsi:type="xsd:string">val2-1</value>
      </value>
      <value xsi:type="ns2:NamedValue" xmlns:ns2="http://some/namespace";>
        <name>dummy2-2</name>
        <value xsi:type="xsd:int">314</value>
      </value>
   </options>
</login>

The encoding of the array inside the array does not seem right to me, the 
server ends up with a NamedValue value for "dummy2" instead of a NamedValue[].


>From Anne Thomas Manes:

You're right. The array within the array should be mapped to this:

<login xmlns="http://some/namespace";>
   <username>tim</username>
   <password>tim</password>
   <options>
      <name>dummy1</name>
      <value xsi:type="xsd:string">dummy_val1</value>
   </options>
   <options>
      <name>dummy2</name>
      <value xsi:type="ns1:NamedValue" xmlns:ns1="http://some/namespace";>
        <name>dummy2-1</name>
        <value xsi:type="xsd:string">val2-1</value>
        <name>dummy2-2</name>
        <value xsi:type="xsd:int">314</value>
      </value>
   </options>
</login>

I suggest you file a bug report, because Axis is not generating the
right message structure per the WSDL.

Anne



  was:

First of all, this has been discussed on the users mailing list, please refer 
to this thread as it may have more up-to-date information:

http://article.gmane.org/gmane.comp.apache.webservices.axis.user/29082

I have a data type defined as:

<complexType name="NamedValue">
<sequence>
  <element name="name" nillable="true" type="xsd:string" />
  <element name="value" nillable="true" type="xsd:anyType" />
</sequence>
</complexType>

I need the value to be xsd:anyType so that I can send arrays of NamedValue with 
various types for value.

On the server side I have a method defined as:

NamedValue[] login(String username, String password, NamedValue[] options)

Which in the WSDL the request looks like this:

- <element name="login">
-   <complexType>
-     <sequence>
         <element name="username" type="xsd:string" />
         <element name="password" type="xsd:string" />
         <element name="options" type="impl:NamedValue" maxOccurs="unbounded" />
    </sequence>
  </complexType>
</element>

And the response like this:

- <element name="loginResponse">
- <complexType>
-   <sequence>
      <element name="loginReturn" type="impl:NamedValue" maxOccurs="unbounded" 
/>
  </sequence>
</complexType>
</element>


If I create on the client side an options array that looks like this:

NamedValue[] options = new NamedValue[]
  {
    new NamedValue("dummy1", "dummy_val1"),

    new NamedValue("dummy2",
                   new NamedValue[]
                   {
                     new NamedValue("dummy2-1", "val2-1"),
                     new NamedValue("dummy2-2", new Integer(314))
                   })
  };

Note the array inside the array above.

A request to the server from an Axis client (latest CVS version of 1.2RC3) 
looks like this:

<login xmlns="http://some/namespace";>
   <username>tim</username>
   <password>tim</password>
   <options>
      <name>dummy1</name>
      <value xsi:type="xsd:string">dummy_val1</value>
   </options>
   <options>
      <name>dummy2</name>
      <value xsi:type="ns1:NamedValue" xmlns:ns1="http://some/namespace";>
        <name>dummy2-1</name>
        <value xsi:type="xsd:string">val2-1</value>
      </value>
      <value xsi:type="ns2:NamedValue" xmlns:ns2="http://some/namespace";>
        <name>dummy2-2</name>
        <value xsi:type="xsd:int">314</value>
      </value>
   </options>
</login>

The encoding of the array inside the array does not seem right to me, the 
server ends up with a NamedValue value for "dummy2" instead of a NamedValue[].


>From Anne Thomas Manes:

You're right. The array within the array should be mapped to this:

<login xmlns="http://some/namespace";>
   <username>tim</username>
   <password>tim</password>
   <options>
      <name>dummy1</name>
      <value xsi:type="xsd:string">dummy_val1</value>
   </options>
   <options>
      <name>dummy2</name>
      <value xsi:type="ns1:NamedValue" xmlns:ns1="http://some/namespace";>
        <name>dummy2-1</name>
        <value xsi:type="xsd:string">val2-1</value>
        <name>dummy2-2</name>
        <value xsi:type="xsd:int">314</value>
      </value>
   </options>
</login>

I suggest you file a bug report, because Axis is not generating the
right message structure per the WSDL.

Anne



       Priority: Major  (was: Blocker)

downgrading the bug as there is a work around...

> wrapped document/literal generates wrong SOAP message for arrays within arrays
> ------------------------------------------------------------------------------
>
>          Key: AXIS-1926
>          URL: http://issues.apache.org/jira/browse/AXIS-1926
>      Project: Axis
>         Type: Bug
>  Environment: Linux, Axis 1.2RC3
>     Reporter: Tim Kagle
>  Attachments: RemoteLoginManager.wsdl
>
> First of all, this has been discussed on the users mailing list, please refer 
> to this thread as it may have more up-to-date information:
> http://article.gmane.org/gmane.comp.apache.webservices.axis.user/29082
> I have a data type defined as:
> <complexType name="NamedValue">
> <sequence>
>   <element name="name" nillable="true" type="xsd:string" />
>   <element name="value" nillable="true" type="xsd:anyType" />
> </sequence>
> </complexType>
> I need the value to be xsd:anyType so that I can send arrays of NamedValue 
> with various types for value.
> On the server side I have a method defined as:
> NamedValue[] login(String username, String password, NamedValue[] options)
> Which in the WSDL the request looks like this:
> - <element name="login">
> -   <complexType>
> -     <sequence>
>          <element name="username" type="xsd:string" />
>          <element name="password" type="xsd:string" />
>          <element name="options" type="impl:NamedValue" maxOccurs="unbounded" 
> />
>     </sequence>
>   </complexType>
> </element>
> And the response like this:
> - <element name="loginResponse">
> - <complexType>
> -   <sequence>
>       <element name="loginReturn" type="impl:NamedValue" 
> maxOccurs="unbounded" />
>   </sequence>
> </complexType>
> </element>
> If I create on the client side an options array that looks like this:
> NamedValue[] options = new NamedValue[]
>   {
>     new NamedValue("dummy1", "dummy_val1"),
>     new NamedValue("dummy2",
>                    new NamedValue[]
>                    {
>                      new NamedValue("dummy2-1", "val2-1"),
>                      new NamedValue("dummy2-2", new Integer(314))
>                    })
>   };
> Note the array inside the array above.
> A request to the server from an Axis client (latest CVS version of 1.2RC3) 
> looks like this:
> <login xmlns="http://some/namespace";>
>    <username>tim</username>
>    <password>tim</password>
>    <options>
>       <name>dummy1</name>
>       <value xsi:type="xsd:string">dummy_val1</value>
>    </options>
>    <options>
>       <name>dummy2</name>
>       <value xsi:type="ns1:NamedValue" xmlns:ns1="http://some/namespace";>
>         <name>dummy2-1</name>
>         <value xsi:type="xsd:string">val2-1</value>
>       </value>
>       <value xsi:type="ns2:NamedValue" xmlns:ns2="http://some/namespace";>
>         <name>dummy2-2</name>
>         <value xsi:type="xsd:int">314</value>
>       </value>
>    </options>
> </login>
> The encoding of the array inside the array does not seem right to me, the 
> server ends up with a NamedValue value for "dummy2" instead of a NamedValue[].
> From Anne Thomas Manes:
> You're right. The array within the array should be mapped to this:
> <login xmlns="http://some/namespace";>
>    <username>tim</username>
>    <password>tim</password>
>    <options>
>       <name>dummy1</name>
>       <value xsi:type="xsd:string">dummy_val1</value>
>    </options>
>    <options>
>       <name>dummy2</name>
>       <value xsi:type="ns1:NamedValue" xmlns:ns1="http://some/namespace";>
>         <name>dummy2-1</name>
>         <value xsi:type="xsd:string">val2-1</value>
>         <name>dummy2-2</name>
>         <value xsi:type="xsd:int">314</value>
>       </value>
>    </options>
> </login>
> I suggest you file a bug report, because Axis is not generating the
> right message structure per the WSDL.
> Anne

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to