|
Hi Dimuthu
,
you can set the property
SEND_TYPE_ATTR in a org.apache.axis.client.Call object to
false:
call.setProperty(
SEND_TYPE_ATTR, "false");
If you use WSDL2Java and
WSDL2Java recognizes your service as wrapped the following code is generated
automatically:
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
Boolean.FALSE);
The WSDL fragment in your mail
is to short to identify the style as wrapped.
Thomas
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/
" 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
- 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 -----
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/"
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.
|