You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by th...@ascentialsoftware.com on 2002/09/05 01:26:32 UTC

RE: Calling a document style web service operation with no input para meters

Thanks. I did not know about this test. I will take a look.
 
Thomas

-----Original Message-----
From: Tom Jordahl [mailto:tomj@macromedia.com] 
Sent: Wednesday, September 04, 2002 10:24 AM
To: 'axis-dev@xml.apache.org'
Subject: RE: Calling a document style web service operation with no input
para meters


Thomas,
 
The interop test "docLit", found in test/wsdl/interop3/docLit, has an
echoVoid operation which takes no arguments.
I believe this is what you are trying to do.
 
The message is defined in the WSDL like this:
    <message name="echoVoid"/>
    <message name="echoVoidResponse"/>

And the operation:
        <operation name="echoVoid">
            <input message="tns:echoVoid" name="echoVoid"/>
            <output message="tns:echoVoidResponse" name="echoVoidResponse"/>
        </operation>
 
I hope this helps.
 
-- 
Tom Jordahl 
Macromedia Server Development 
-----Original Message-----
From: thomas.cherel@ascentialsoftware.com
[mailto:thomas.cherel@ascentialsoftware.com]
Sent: Tuesday, September 03, 2002 6:12 PM
To: axis-dev@xml.apache.org
Subject: Calling a document style web service operation with no input para
meters




When calling a document style web service operation (using the Axis client
API and the classes generated by WSDL2Java), the SOAP request is looking
like that:

POST /periodictable.asmxHTTP/1.0 
Host: www.webservicex.net 
Content-Type: text/xml; charset=utf-8 
SOAPAction: " <http://www.webservicex.net/GetAtoms>
http://www.webservicex.net/GetAtoms" 
Content-Length: 316  

<?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
<http://www.w3.org/2001/XMLSchema> " 
 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance> "> 
 <soapenv:Body> 
  <GetAtoms xmlns="http://www.webservicex.net <http://www.webservicex.net>
"/> 
 </soapenv:Body> 
</soapenv:Envelope> 

I was actually expecting to have an empty soapenv:Body. Any good reasons for
not being empty? 
I actually think that I know the answer: in the WSDL, I have the following
declarations: 

<s:element name="GetAtoms"> 
  <s:complexType /> 
</s:element> 

<message name="GetAtomsSoapIn"> 
  <part name="parameters" element="s0:GetAtoms" /> 
</message> 

WSDL/SOAP specifications say that in document style, parts appear directly
under the soap body element. In this case, the WSDL specifies that I have
one part called GetAtoms and I need the element for it (even if this is
empty). But then, I have the following questions:

- The WSDL/SOAP spec is not 100% explicit about the fact that even if the
part is an empty element, the element must be there.

- If I declare an empty message (with no part sub element, which seems to be
valid from WSDL1.1 point of view), then WSDL2Java does not work anymore.
Does it mean that this is required for Axis? Is it required for maximum
interoperability? The SOAPAction header is what should really be used to
find which operation to call, isn't it (if I put the operation overloading
aside ....)?

- I tried similar type of things using visual studio .net and I can make it
work (not as easy as if the message is not empty, but I can still make it
work).

I have no real problem with this empty element to provide, but I am trying
to understand how important this is from an interoperability point of view.

Thomas