Hello,

If someone could please help me with this issue I would appreciate it. I recently converted my web service from rpc/encoded to wrapped document/literal so that it works with .NET (before the change everything still worked even with .NET, except for problems with custom exceptions/faults).

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)

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[].

If the message is not correct, what should it look like? I assume it would need a wrapper, something like ArrayOfNamedValue ... but then this type would have to be defined in the schema (which in this case it is), but what about say ArrayOfLong, ArrayOfString, etc. which are not defined in the schema and could be sent at runtime because the value type is xsd:anyType?

Is this supposed to work the way I want it with wrapped doc/literal? It worked fine before with rpc/encoded.

If so, is this a bug in Axis? Any available patches for it?

Thank you for any help you may provide.
-- 
Tim

Reply via email to