Your current message qualifies as Document/Literal. It's always valid to override the type information using the xsi:type attribute -- but the point is that you aren't really overriding the defined schema, so you shouldn't need to include the type information.
Can someone else on the list provide some guidance as to how to tell Axis not to specify the xsi:type attributes in the message?
Anne
At 10:55 AM 8/20/2003 +0600, you wrote:
Hi all,
Thank you very much for your help Anne.
I have written a web service in wrapped style which takes in an integer and return an integer ( for now). I managed to exclude the "soapenv:encodingStyle=<http://schemas.xmlsoap.org/soap/encoding/>http://schemas.xmlsoap.org/soap/encoding/ " but still I'm unable to remove the xsi:type from the message. So could you call this a literal encoded? What am I missing. Follwoing is what I get from the TCP monitor. I have also given a snip of the wsdl I have written.
<?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>
<process xmlns="urn:WrappedOrder">
<A xsi:type="xsd:int">1</A>
</process>
</soapenv:Body>
</soapenv:Envelope>
Part of the wsdl I wrote is here.
<types>
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:WrappedOrder">
<xsd:element name="process">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="A" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="processResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="processResult" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
What could be the problem? How can I eleminate the xsi:type?
Thanyou, Dimuthu
This looks like an RPC/encoded message.
You've included
- soapenv:encodingStyle=<http://schemas.xmlsoap.org/soap/encoding/>http://schemas.xmlsoap.org/soap/encoding/
- xsi:type information
A wrapped service message would look something like this:
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:Add xmlns:ns1="http://math.samples/"> <B>4.1</B> <A>2.2</A> </ns1:Add> </soapenv:Body> </soapenv:Envelope>
Keep in mind that when you're using WRAPPED (or any literal encoding), you need a WSDL file to get the schema of the message body. Otherwise the SOAP runtime has no idea how to type map it.
Anne
----- Original Message -----From: <mailto:[EMAIL PROTECTED]>Dimuthu Leelarathne To: <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] Sent: Monday, August 04, 2003 1:47 AM Subject: Is this a wrapped service ?
I have a service similar to math in samples. I wrote a wsdd and a client (I'm not usnig wsdl or wsdl2java).If I run the TCP monitor shows the following messages (given bellow).
My question is ::: Is it a wrapped service?
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="<http://schemas.xmlsoap.org/soap/envelope/>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:Add soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://math.samples/">
<B xsi:type="xsd:float">4.1</B>
<A xsi:type="xsd:float">2.2</A>
</ns1:Add>
</soapenv:Body>
</soapenv:Envelope>
And the reply is:
<?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>
<AddResponse xmlns="http://math.samples/">
<AddResult xsi:type="xsd:float">6.3</AddResult>
</AddResponse>
</soapenv:Body>
</soapenv:Envelope>
However I use a call object to invoke this service. Am I missing something here? Am I going against the definition of wrapped style here?
Thank you, Dimuthu.
