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 Mithun Sheshagiri <mi...@csee.umbc.edu> on 2003/11/04 14:37:50 UTC
duplicate attributes in SOAP message (WSDL2Java)
I am using the WSDL2Java tool to generate skeleton and stubs from a WSDL
file. I have described the following complex type in the WSDL file:
<xsd:complexType name="ItemListType">
<xsd:sequence>
<xsd:element name="member" minOccurs="0" maxOccurs="unbounded"
use="required">
<xsd:complexType>
<xsd:attribute ref="rdf:resource" type="xsd:string"
form="unqualified"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute ref="rdf:ID" type="xsd:string" form="qualified"/>
</xsd:complexType>
WSDL2Java generates classes that correspond to ItemListType and
ItemListType_member.
I am trying to send an ItemListType type element with two member
elements with different attributes resource="one" and resource="two". To
set the resource value, I am using the setResource method in the
ItemListType_member class. The following SOAP message is generated when
I invoke the service from the client:
<?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:ItemLookUpResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="Provider">
<return href="#id0"/>
</ns1:ItemLookUpResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:ItemListType" ns3:ID="trial"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://stuff/IProvider.xsd"
xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<member href="#id1"/>
<member href="#id2"/>
</multiRef>
<multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
resource="two" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
resource="two" resource="one"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
</soapenv:Body>
</soapenv:Envelope>
If you look at the muliRef with id="id2", you'll see the attribute
resource is repeated. As a result, I get a exception while parsing the
file at the client end. Is this a bug?
Thanks!
mithun
HPLabs
htpp://www.cs.umbc.edu/~mits1