You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Leena Janardanan <lj...@blackpearl.com> on 2004/08/11 21:39:00 UTC

Wrapped style and elementFormDefault="unqualified"

Hi all,
  I am having interoperabilty problems when invoking an Axis wrapped style web service from a .Net client. Trying not to clutter with too much information here :

My schema that defines the return types has ELEMENTFORMDEFAULT="UNQUALIFIED". However, I notice that when my custom serializer class is called, the root element of the response looks like this:  

<ComplexProcResponse xmlns="urn:DotNetTest:pkg1">

Which defines "urn:DotNetTest:pkg1" as the default namespace for all the elements. Therefore, .Net complains when it recieves the response, by saying that :

Element '{urn:DotNetTest:pkg1}Prop1' is unexpected according to content model of parent element '{urn:DotNetTest:pkg1}Concept1'.
Expecting: Prop1, Prop2.

This is what is returned from Axis :
<ComplexProcResponse xmlns="urn:DotNetTest:pkg1">
<Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
    <Concept1><Prop1>a</Prop1><Prop2>b</Prop2></Concept1>
    <Concept1><Prop1>c</Prop1><Prop2>d</Prop2></Concept1>
    <Concept1><Prop1>e</Prop1><Prop2>f</Prop2></Concept1>
</Concept1Array>
</ComplexProcResponse>


Whereas, this is what should be :
  <ns1:ComplexProcResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:DotNetTest:pkg1">
<pkg1:Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
       <pkg1:Concept1><Prop1>a</Prop1><Prop2>b</Prop2></pkg1:Concept1>
       <pkg1:Concept1><Prop1>c</Prop1><Prop2>d</Prop2></pkg1:Concept1>
       <pkg1:Concept1><Prop1>e</Prop1><Prop2>f</Prop2></pkg1:Concept1>
</pkg1:Concept1Array>

Note: In my schema, Concept1Array and Concept1 are defined as qualified. Only Prop1 and Prop2 are unqualified, by default.

The following XML is generated by my serializer and written to the context (context.writeString()):
<pkg1:Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
       <pkg1:Concept1><Prop1>a</Prop1><Prop2>b</Prop2></pkg1:Concept1>
       <pkg1:Concept1><Prop1>c</Prop1><Prop2>d</Prop2></pkg1:Concept1>
       <pkg1:Concept1><Prop1>e</Prop1><Prop2>f</Prop2></pkg1:Concept1>
</pkg1:Concept1Array>

Therefore, if the root element ComplexProcResponse didn't have the default namespace, all would be well.



The wsdd entry for my web service looks like this:

<service name="pkg1_doc" style="wrapped" use="literal">
  <operation name="ComplexProc" qname="ns8:ComplexProc" returnQName="ns8:Concept1Array" returnType="ns8:Concept1ArrayType" xmlns:ns8="urn:DotNetTest:pkg1"/>
  <parameter name="allowedMethods" value="*"/>
  <parameter name="className" value="DotNetTest.pkg1.WSBroker"/>
  <wsdlFile>wsdl/DotNetTest_pkg1_doc.wsdl</wsdlFile>
   
  <typeMapping deserializer="com.blackpearl.service.websphere.ParamDeserializerFactory" encodingStyle="" qname="ns9:Concept1ArrayType" serializer="com.blackpearl.service.websphere.ResultSerializerFactory" type="java:com.blackpearl.service.datamodel.ResultWrapper" xmlns:ns9="urn:DotNetTest:pkg1"/>
 </service>


Is there any way to turn this off ? Any parameter that I can set ? OR, is there way to do this in my custom serializer class ? Or is there a way to make Axis use the schemas that define my types ? Axis doesn't seem to do any validation against schemas at all.
Any help is appreciated,
	Thanks in advance,
	Leena.

RE: Wrapped style and elementFormDefault="unqualified"

Posted by Anne Thomas Manes <an...@manes.net>.
Frans,

What error are you receiving from .NET? As you say, the two messages are
semantically equivalent, and .NET doesn't care whether you use a prefixed
namespace or a default namespace. Perhaps there are subelements in Node2
that should not be namespace prefixed? That would make sense and be
consistent with Leena's error.

- Anne 

-----Original Message-----
From: Frans Flippo [mailto:frans.flippo@quinity.com] 
Sent: Thursday, August 19, 2004 4:42 AM
To: axis-user@ws.apache.org
Subject: Re: Wrapped style and elementFormDefault="unqualified"

Hi folks,

Has anybody found a solution to this? I'm having a similar issue, but in 
my case it's an Axis client accessing a .Net server. Axis is using a 
default namespace whereas the .Net server on the other side is expecting 
an explicit namespace, e.g.:

Axis generates:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <Node1 xmlns="http://www.winterthur.nl/schema/example">
            <Node2>Node2 content</Node2>
        </Node1>
    </soapenv:Body>
</soapenv:Envelope>

.Net expects:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <ns1:Node1 xmlns:ns1="http://www.winterthur.nl/schema/example">
            <ns1:Node2>Node2 content</ns1:Node2>
        </ns1:Node1>
    </soapenv:Body>
</soapenv:Envelope>

(The nodes aren't actually called Node1 and Node2, but I can't show the 
actual message).

Of course, both messages are semantically equivalent, but apparently the 
.Net server doesn't understand that.

Is there any way to tell axis to not use a default namespace when 
creating its xml? Is there something in the WSDL that could influence this?

Thanks,
Frans


Leena Janardanan wrote:

>Hi all,
>  I am having interoperabilty problems when invoking an Axis wrapped style
web service from a .Net client. Trying not to clutter with too much
information here :
>
>My schema that defines the return types has
ELEMENTFORMDEFAULT="UNQUALIFIED". However, I notice that when my custom
serializer class is called, the root element of the response looks like
this:  
>
><ComplexProcResponse xmlns="urn:DotNetTest:pkg1">
>
>Which defines "urn:DotNetTest:pkg1" as the default namespace for all the
elements. Therefore, .Net complains when it recieves the response, by saying
that :
>
>Element '{urn:DotNetTest:pkg1}Prop1' is unexpected according to content
model of parent element '{urn:DotNetTest:pkg1}Concept1'.
>Expecting: Prop1, Prop2.
>
>This is what is returned from Axis :
><ComplexProcResponse xmlns="urn:DotNetTest:pkg1">
><Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
>    <Concept1><Prop1>a</Prop1><Prop2>b</Prop2></Concept1>
>    <Concept1><Prop1>c</Prop1><Prop2>d</Prop2></Concept1>
>    <Concept1><Prop1>e</Prop1><Prop2>f</Prop2></Concept1>
></Concept1Array>
></ComplexProcResponse>
>
>
>Whereas, this is what should be :
>  <ns1:ComplexProcResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:DotNetTest:pkg1">
><pkg1:Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
>       <pkg1:Concept1><Prop1>a</Prop1><Prop2>b</Prop2></pkg1:Concept1>
>       <pkg1:Concept1><Prop1>c</Prop1><Prop2>d</Prop2></pkg1:Concept1>
>       <pkg1:Concept1><Prop1>e</Prop1><Prop2>f</Prop2></pkg1:Concept1>
></pkg1:Concept1Array>
>
>Note: In my schema, Concept1Array and Concept1 are defined as qualified.
Only Prop1 and Prop2 are unqualified, by default.
>
>The following XML is generated by my serializer and written to the context
(context.writeString()):
><pkg1:Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
>       <pkg1:Concept1><Prop1>a</Prop1><Prop2>b</Prop2></pkg1:Concept1>
>       <pkg1:Concept1><Prop1>c</Prop1><Prop2>d</Prop2></pkg1:Concept1>
>       <pkg1:Concept1><Prop1>e</Prop1><Prop2>f</Prop2></pkg1:Concept1>
></pkg1:Concept1Array>
>
>Therefore, if the root element ComplexProcResponse didn't have the default
namespace, all would be well.
>
>
>
>The wsdd entry for my web service looks like this:
>
><service name="pkg1_doc" style="wrapped" use="literal">
>  <operation name="ComplexProc" qname="ns8:ComplexProc"
returnQName="ns8:Concept1Array" returnType="ns8:Concept1ArrayType"
xmlns:ns8="urn:DotNetTest:pkg1"/>
>  <parameter name="allowedMethods" value="*"/>
>  <parameter name="className" value="DotNetTest.pkg1.WSBroker"/>
>  <wsdlFile>wsdl/DotNetTest_pkg1_doc.wsdl</wsdlFile>
>   
>  <typeMapping
deserializer="com.blackpearl.service.websphere.ParamDeserializerFactory"
encodingStyle="" qname="ns9:Concept1ArrayType"
serializer="com.blackpearl.service.websphere.ResultSerializerFactory"
type="java:com.blackpearl.service.datamodel.ResultWrapper"
xmlns:ns9="urn:DotNetTest:pkg1"/>
> </service>
>
>
>Is there any way to turn this off ? Any parameter that I can set ? OR, is
there way to do this in my custom serializer class ? Or is there a way to
make Axis use the schemas that define my types ? Axis doesn't seem to do any
validation against schemas at all.
>Any help is appreciated,
>	Thanks in advance,
>	Leena.
>
>  
>


-- 
Quinity : Your Partner In eBusiness Solution Delivery

Biltstraat 449
3572 AW Utrecht
P.O. Box 13097
3507 LB Utrecht
The Netherlands

Telephone: (+31) (0)30 2335999
Fax      : (+31) (0)30 2335998
WWW      : http://www.quinity.com
================================================================
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material
from any computer. Quinity is neither liable for the proper and
complete  transmission of the information contained in this
communication nor for any delay in its receipt.
================================================================



Re: Wrapped style and elementFormDefault="unqualified"

Posted by Frans Flippo <fr...@quinity.com>.
Hi folks,

Has anybody found a solution to this? I'm having a similar issue, but in 
my case it's an Axis client accessing a .Net server. Axis is using a 
default namespace whereas the .Net server on the other side is expecting 
an explicit namespace, e.g.:

Axis generates:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <Node1 xmlns="http://www.winterthur.nl/schema/example">
            <Node2>Node2 content</Node2>
        </Node1>
    </soapenv:Body>
</soapenv:Envelope>

.Net expects:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <ns1:Node1 xmlns:ns1="http://www.winterthur.nl/schema/example">
            <ns1:Node2>Node2 content</ns1:Node2>
        </ns1:Node1>
    </soapenv:Body>
</soapenv:Envelope>

(The nodes aren't actually called Node1 and Node2, but I can't show the 
actual message).

Of course, both messages are semantically equivalent, but apparently the 
.Net server doesn't understand that.

Is there any way to tell axis to not use a default namespace when 
creating its xml? Is there something in the WSDL that could influence this?

Thanks,
Frans


Leena Janardanan wrote:

>Hi all,
>  I am having interoperabilty problems when invoking an Axis wrapped style web service from a .Net client. Trying not to clutter with too much information here :
>
>My schema that defines the return types has ELEMENTFORMDEFAULT="UNQUALIFIED". However, I notice that when my custom serializer class is called, the root element of the response looks like this:  
>
><ComplexProcResponse xmlns="urn:DotNetTest:pkg1">
>
>Which defines "urn:DotNetTest:pkg1" as the default namespace for all the elements. Therefore, .Net complains when it recieves the response, by saying that :
>
>Element '{urn:DotNetTest:pkg1}Prop1' is unexpected according to content model of parent element '{urn:DotNetTest:pkg1}Concept1'.
>Expecting: Prop1, Prop2.
>
>This is what is returned from Axis :
><ComplexProcResponse xmlns="urn:DotNetTest:pkg1">
><Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
>    <Concept1><Prop1>a</Prop1><Prop2>b</Prop2></Concept1>
>    <Concept1><Prop1>c</Prop1><Prop2>d</Prop2></Concept1>
>    <Concept1><Prop1>e</Prop1><Prop2>f</Prop2></Concept1>
></Concept1Array>
></ComplexProcResponse>
>
>
>Whereas, this is what should be :
>  <ns1:ComplexProcResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:DotNetTest:pkg1">
><pkg1:Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
>       <pkg1:Concept1><Prop1>a</Prop1><Prop2>b</Prop2></pkg1:Concept1>
>       <pkg1:Concept1><Prop1>c</Prop1><Prop2>d</Prop2></pkg1:Concept1>
>       <pkg1:Concept1><Prop1>e</Prop1><Prop2>f</Prop2></pkg1:Concept1>
></pkg1:Concept1Array>
>
>Note: In my schema, Concept1Array and Concept1 are defined as qualified. Only Prop1 and Prop2 are unqualified, by default.
>
>The following XML is generated by my serializer and written to the context (context.writeString()):
><pkg1:Concept1Array xmlns:pkg1="urn:DotNetTest:pkg1">
>       <pkg1:Concept1><Prop1>a</Prop1><Prop2>b</Prop2></pkg1:Concept1>
>       <pkg1:Concept1><Prop1>c</Prop1><Prop2>d</Prop2></pkg1:Concept1>
>       <pkg1:Concept1><Prop1>e</Prop1><Prop2>f</Prop2></pkg1:Concept1>
></pkg1:Concept1Array>
>
>Therefore, if the root element ComplexProcResponse didn't have the default namespace, all would be well.
>
>
>
>The wsdd entry for my web service looks like this:
>
><service name="pkg1_doc" style="wrapped" use="literal">
>  <operation name="ComplexProc" qname="ns8:ComplexProc" returnQName="ns8:Concept1Array" returnType="ns8:Concept1ArrayType" xmlns:ns8="urn:DotNetTest:pkg1"/>
>  <parameter name="allowedMethods" value="*"/>
>  <parameter name="className" value="DotNetTest.pkg1.WSBroker"/>
>  <wsdlFile>wsdl/DotNetTest_pkg1_doc.wsdl</wsdlFile>
>   
>  <typeMapping deserializer="com.blackpearl.service.websphere.ParamDeserializerFactory" encodingStyle="" qname="ns9:Concept1ArrayType" serializer="com.blackpearl.service.websphere.ResultSerializerFactory" type="java:com.blackpearl.service.datamodel.ResultWrapper" xmlns:ns9="urn:DotNetTest:pkg1"/>
> </service>
>
>
>Is there any way to turn this off ? Any parameter that I can set ? OR, is there way to do this in my custom serializer class ? Or is there a way to make Axis use the schemas that define my types ? Axis doesn't seem to do any validation against schemas at all.
>Any help is appreciated,
>	Thanks in advance,
>	Leena.
>
>  
>


-- 
Quinity : Your Partner In eBusiness Solution Delivery

Biltstraat 449
3572 AW Utrecht
P.O. Box 13097
3507 LB Utrecht
The Netherlands

Telephone: (+31) (0)30 2335999
Fax      : (+31) (0)30 2335998
WWW      : http://www.quinity.com
================================================================
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material
from any computer. Quinity is neither liable for the proper and
complete  transmission of the information contained in this
communication nor for any delay in its receipt.
================================================================