axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim K (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-1926) wrapped document/literal generates wrong SOAP message for arrays within arrays
Date Sat, 16 Apr 2005 03:28:58 GMT
     [ http://issues.apache.org/jira/browse/AXIS-1926?page=comments#action_62950 ]
     
Tim K commented on AXIS-1926:
-----------------------------

Posting some emails I exchanged with Dims while JIRA was down.

Me:
---
1) Will String[] work as the value to a NamedValue because the XML schema
in the WSDL doesn't define an ArrayOfString type. What about .NET? Will it
work without ArrayOfString in the schema or do I have to have an
ArrayOfXxxx in the WSDL for all possible Xxxxx types at runtime?

2) Will your fix work with the automatic unwrapping of arrays that Glen
just checked in on Monday I believe making this String[] possible?

3) Another problem: .NET doesn't seem to like this:
<item xmlns="">
There's a patch for it that I applied to my old CVS myself, would you be
able to fix it? I don't think that xmlns="" is valid.

Here's the patch that I applied (I'm not sure where it comes from)

----
Modify org.apache.axis.encoding.SerializationContext.serializeActual()
method.

Existing:
                // -----------------
                // NOTE: I have seen doc/lit tests that use
                // the type name as the element name in multi-ref cases
                // (for example <soapenc:Array ... >)
                // In such cases the xsi:type is not passed along.
                // -----------------
                // The multiref QName is our own fake name.
                // It may be beneficial to set the name to the
                // type name, but I didn't see any improvements
                // in the interop tests.
                //if (name.equals(multirefQName) && type != null)
                //    name = type;
                ser.serialize(elemQName, attributes, value, this);
                return;

New:

                // -----------------
                // NOTE: I have seen doc/lit tests that use
                // the type name as the element name in multi-ref cases
                // (for example <soapenc:Array ... >)
                // In such cases the xsi:type is not passed along.
                // -----------------
                // The multiref QName is our own fake name.
                // It may be beneficial to set the name to the
                // type name, but I didn't see any improvements
                // in the interop tests.
                //if (name.equals(multirefQName) && type != null)
                //    name = type;

                if (elemQName.getNamespaceURI().equals("")){
                  elemQName = new
QName(this.nsStack.getNamespaceURI(""),elemQNa
me.getLocalPart());
                }

                ser.serialize(elemQName, attributes, value, this);
                return;
----


This is one tricky problem with xsd:anyType and arrays of random types
only known at run-time ...

Dims' reply:

For #1, You will have to try it out and see what happens
For #2, i was testing with latest CVS as of this moment :)
For #3, in your wsdl try using elementFormDefault="unqualified"
instead of changing the code.


> 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 K
>  Attachments: RemoteLoginManager.wsdl, diff.txt
>
> 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


Mime
View raw message