Issue Details (XML | Word | Printable)

Key: AXIS-1529
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Tudor Teusan
Votes: 4
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Axis

Bad namespaces in serialized beans in doc/literal

Created: 25/Aug/04 11:01 AM   Updated: 30/Mar/07 09:23 PM
Return to search
Component/s: Serialization/Deserialization
Affects Version/s: current (nightly)
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works axis-patch.txt 2006-07-03 03:49 PM Per Salomonsson 7 kB
Text File Licensed for inclusion in ASF works axis-patch2.txt 2007-03-28 02:27 PM Adam Crume 5 kB
Text File Licensed for inclusion in ASF works axis-patch3.txt 2007-03-30 09:23 PM Adam Crume 1 kB
Java Archive File Licensed for inclusion in ASF works axis-patched.jar 2006-07-03 03:51 PM Per Salomonsson 1.50 MB
Environment: win xp, jdk 1.4.2, jboss 3.2.5


 Description  « Hide
It seems that AXIS (latest CVS) doesn't serialize properly complex
objects (beans) when in doc/literal.

More precisely it doesn't handle as it should a SOAP body with multiple namespaces, as shown in the following exemple :
(I've come upon this problem trying to return a tree structure from a
web service)

The service is a TreeProvider defined as

---
class TreeProvider {
   private Node root;
   ...
   public Node getTree(){ return root; }
   ...
}
---

Node being a very simple bean with two attributes : id and name.

---
class Node {
   private String id, name;
   public string getName(){ return name; }
   ...
}
---

Node and TreeProvider are in 2 different packages
"com.knowesis.ws.TreeProvider" and "com.knowesis.tree.Node" ( left out for brevity).

In the constructor of TreeProvider the root node is initilized as
id="root", name="root".

The deploy.wsdd is :

---
...
<service name="TreeProvider" style="document" use="literal">
<namespace>urn:AthanorWS:ws</namespace>

 <parameter name="className" value="com.knowesis.ws.TreeProvider"/>
 <parameter name="allowedMethods" value="getTree"/>

 <beanMapping xmlns:data="urn:AthanorWS:data" qname="data:Node"
    languageSpecificType="java:com.knowesis.tree.Node"/>

</service>
...
---

the service gets deployed ok and the types section in the auto-generated wsdl looks like this :

---
...
<wsdl:types>
   <schema elementFormDefault="qualified"
        targetNamespace="urn:AthanorWS:data"
        xmlns="http://www.w3.org/2001/XMLSchema">
      
        <complexType name="Node">
           <sequence>
               <element name="id" nillable="true" type="xsd:string" />
               <element name="name" nillable="true" type="xsd:string"
/>
           </sequence>
       </complexType>
   </schema>

   <schema elementFormDefault="qualified"
        targetNamespace="urn:AthanorWS:ws"
        xmlns="http://www.w3.org/2001/XMLSchema">

       <import namespace="urn:AthanorWS:data" />
       <element name="getTreeReturn" type="tns1:Node" />
   </schema>
</wsdl:types>
...
---

notice the the two namespaces (and this is how it should be) and the
elementFormDefault="qualified" for the two schemas.
A getTree() invocation results in :

---
...
<soapenv:Body>
   <getTreeReturn xmlns="urn:AthanorWS:ws">
      <id>root</id>
      <name>root</name>
   </getTreeReturn>
</soapenv:Body>
...
---

The contents of the generated body is not valid with respect to the wsdl specified schemas.

"id" and "root" elements are in the same namespace as "getTreeReturn"
(urn:AthanorWS:ws) instead of being in their own "urn:AthanorWS:data"
namespace :

<getTreeReturn xmlns="urn:AthanorWS:ws">
   <id xmlns="urn:AthanorWS:data">root</id>
   <name xmlns="urn:AthanorWS:data">root</name>
</getTreeReturn>

As a direct consequence a generated .Net client simply refuses to
deserialize the response and always returns an empty answer.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Per Salomonsson made changes - 03/Jul/06 03:49 PM
Field Original Value New Value
Attachment axis-patch.txt [ 12336265 ]
Per Salomonsson made changes - 03/Jul/06 03:51 PM
Attachment axis-patched.jar [ 12336266 ]
Adam Crume made changes - 28/Mar/07 02:27 PM
Attachment axis-patch2.txt [ 12354440 ]
Adam Crume made changes - 30/Mar/07 09:23 PM
Attachment axis-patch3.txt [ 12354641 ]