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.