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 Sathya Sankar <sn...@yahoo.com> on 2004/09/02 20:50:33 UTC
Wrapped/Literal on 1.2Beta3
I've been using Axis 1.1 for a while and recently needed to work with attachments. I thought of moving to the 1.2 version since it has better support for those.
Here is my scenario... I'm using Axis (generated classes & its libraries) to talk to another server using Wrapped/Literal. The WSDL that I use to generate my stubs uses style="wrapped". But the Stub that gets generated, has a
oper.setStyle(org.apache.axis.enum.Style.DOCUMENT);.
When I use this stub to talk to the server, the request that goes out is not wrapped. The parameters are getting passed directly in the SOAP body instead of getting wrapped.
<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>
<PARAM1 xmlns="data1
http://www.somesite.com/services.xsd">data1</PARAM1>
<PARAM2 xmlns="data2
http://www.somesite.com/services.xsd">data2</PARAM2>
<PARAM3 xmlns="data3
http://www.somesite.com/services.xsd">data3</PARAM3>
<PARAM4 xmlns="data4
http://www.somesite.com/services.xsd">data4</PARAM4>
</soapenv:Body>
</soapenv:Envelope>
I tried to manually edit the Stub to change the style to Style.WRAPPED. It then tries to send the message properly wrapped but the namespace gets sent as "".
<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>
<METHOD_NAME xmlns="">
<PARAM1 xmlns="data1
http://www.somesite.com/services.xsd">data1</PARAM1>
<PARAM2 xmlns="data2
http://www.somesite.com/services.xsd">data2</PARAM2>
<PARAM3 xmlns="data3
http://www.somesite.com/services.xsd">data3</PARAM3>
<PARAM4 xmlns="data4
http://www.somesite.com/services.xsd">data4</PARAM4>
</METHOD_NAME>
</soapenv:Body>
</soapenv:Envelope>
In both scenarios, the server responds back with a Port not found. This was working on Axis1.1 and I'm not sure if I have to do anything different while generating the stubs for 1.2.
I would really appreciate any information/suggesions on this...
Thanks!
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
RE: Wrapped/Literal on 1.2Beta3
Posted by Anne Thomas Manes <an...@manes.net>.
Can you show us your WSDL?
There's no way to specify style="wrapped" in a WSDL document. The only valid
style parameters are "rpc" and "document". (You can specify style="wrapped"
in a WSDD, though.)
In a wrapped/literal WSDL definition, you must define the wrapper element in
the <types> section. The name of this wrapper element must be the same as
your operation name. The element must be defined as a complex type, which is
has a sequence group containing your four parameters.
e.g.,
<wsdl:types>
<xs:schema targetNamespace="foo">
<xs:element name=MethodName type="tns:MethodType/>
<xs:complexType name="tns:MethodType">
<xs:sequence>
<xs:element name="Param1" type="xs:string"/>
<xs:element name="Param2" type="xs:string"/>
<xs:element name="Param3" type="xs:string"/>
<xs:element name="Param4" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
Your message definition must contain only one body part, and that part must
reference your wrapper element:
<wsdl:message name="MethodRequest">
<wsdl:part name="parameters" element="tns"MethodName"/>
</wsdl:message>
Anne
_____
From: Sathya Sankar [mailto:sn_axis@yahoo.com]
Sent: Thursday, September 02, 2004 2:51 PM
To: axis-user@ws.apache.org
Subject: Wrapped/Literal on 1.2Beta3
I've been using Axis 1.1 for a while and recently needed to work with
attachments. I thought of moving to the 1.2 version since it has better
support for those.
Here is my scenario... I'm using Axis (generated classes & its libraries) to
talk to another server using Wrapped/Literal. The WSDL that I use to
generate my stubs uses style="wrapped". But the Stub that gets generated,
has a
oper.setStyle(org.apache.axis.enum.Style.DOCUMENT);.
When I use this stub to talk to the server, the request that goes out is not
wrapped. The parameters are getting passed directly in the SOAP body instead
of getting wrapped.
<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>
<PARAM1 xmlns="http://www.somesite.com/services.xsd">data1</PARAM1>
<PARAM2 xmlns="http://www.somesite.com/services.xsd">data2</PARAM2>
<PARAM3 xmlns="http://www.somesite.com/services.xsd">data3</PARAM3>
<PARAM4 xmlns="http://www.somesite.com/services.xsd">data4</PARAM4>
</soapenv:Body>
</soapenv:Envelope>
I tried to manually edit the Stub to change the style to Style.WRAPPED. It
then tries to send the message properly wrapped but the namespace gets sent
as "".
<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>
<METHOD_NAME xmlns="">
<PARAM1 xmlns="http://www.somesite.com/services.xsd">data1</PARAM1>
<PARAM2 xmlns="http://www.somesite.com/services.xsd">data2</PARAM2>
<PARAM3 xmlns="http://www.somesite.com/services.xsd">data3</PARAM3>
<PARAM4 xmlns="http://www.somesite.com/services.xsd">data4</PARAM4>
</METHOD_NAME>
</soapenv:Body>
</soapenv:Envelope>
In both scenarios, the server responds back with a Port not found. This was
working on Axis1.1 and I'm not sure if I have to do anything different while
generating the stubs for 1.2.
I would really appreciate any information/suggesions on this...
Thanks!
_____
Do you Yahoo!?
Yahoo!
<http://us.rd.yahoo.com/mail_us/taglines/50x/*http:/promotions.yahoo.com/new
_mail/static/efficiency.html> Mail - 50x more storage than other providers!