axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Created: (AXIS-1529) Bad namespaces in serialized beans in doc/literal
Date Wed, 25 Aug 2004 11:03:20 GMT

  A new issue has been created in JIRA.

View the issue:

Here is an overview of the issue:
        Key: AXIS-1529
    Summary: Bad namespaces in serialized beans in doc/literal
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
             current (nightly)

   Reporter: Tudor Teusan

    Created: Wed, 25 Aug 2004 4:01 AM
    Updated: Wed, 25 Aug 2004 4:01 AM
Environment: win xp, jdk 1.4.2, jboss 3.2.5

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
"" 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">

 <parameter name="className" value=""/>
 <parameter name="allowedMethods" value="getTree"/>

 <beanMapping xmlns:data="urn:AthanorWS:data" qname="data:Node"


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

   <schema elementFormDefault="qualified"
        <complexType name="Node">
               <element name="id" nillable="true" type="xsd:string" />
               <element name="name" nillable="true" type="xsd:string"

   <schema elementFormDefault="qualified"

       <import namespace="urn:AthanorWS:data" />
       <element name="getTreeReturn" type="tns1:Node" />

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 :

   <getTreeReturn xmlns="urn:AthanorWS:ws">

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>

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

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message