Hey Ian, Hey Sam,

> WS-I apparently allows it:
> 
> R2210 If a document-literal binding in a DESCRIPTION does not specify
> the |parts| attribute on a |soapbind:body| element, the corresponding
> abstract |wsdl:message| MUST define zero or one |wsdl:part|s.
> 
> R2202 A |wsdl:binding| in a DESCRIPTION MAY contain |soapbind:body|
> element(s) that specify that zero parts form the |soap:Body|.
> 
> This surprises me, because I think dispatching a request with an empty
> body would be problematic. You'd have to use null or an empty string
as
> the "key" to determine which method to dispatch to. This could be made
> to work, but only with the additional stipulation that only one such
> empty-body operation could be defined per service in the WSDL - a
> stipulation that WS-I neglected to make. So I can see why Axis chose
not
> to allow empty body requests, and I think Apollo's wsdl2java and
> provider ought to follow suit.

But I've got it working with axis. The axis-wsdl2java processes the
wsdl-definition without problems and I got a Method-Signature with
zero-paremeters. I defined:

<types>
...
        <xs:element name="zero_Boolean" type="xs:boolean"/>
...
</types>

<message name="ZeroParamsRequest"/>
   
<message name="ZeroParamsResponse">
        <part name="proccessed" element="tns:zero_Boolean"/>
</message>         

<portType name=".." ...>
...
      <operation name="ZeroParams">
         <input message="tns:ZeroParamsRequest"/>
         <output message="tns:ZeroParamsResponse"/>
      </operation>
      
...
</portType>        

<binding ...>

   <operation name="ZeroParams">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>

</binding>

I got:

In the interface:
================
   public boolean zeroParams() throws java.rmi.RemoteException; 


In the implementation-body:
==========================
    public boolean zeroParams() throws java.rmi.RemoteException {
        return false;
    }


The messages are:

Request:
========
POST /axis/services/ShoppingCart HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related,
text/*
User-Agent: Axis/1.2RC2
Host: 127.0.0.1:8079
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 245

<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>
<ZeroParams xmlns=""/>
</soapenv:Body>
</soapenv:Envelope>


Response:
=========
HTTP/1.1 200 OK
Content-Type: text/xml;charset=utf-8
Date: Wed, 16 Feb 2005 23:02:17 GMT
Server: Apache-Coyote/1.1
Connection: close


<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>
<zero_Boolean xmlns="http://bookstore.com/shoppingCart";>
false
</zero_Boolean>
</soapenv:Body>
</soapenv:Envelope>



I don't know, how the message is dispatched, neverless it seems to work.
But I don't have tried to define two empty messages per service until
yet. For me it looks like that axis allows empty message bodies and can
handle them. Any ideas about that? Does it matter to WSRF?

> 
> Michael, does this sound reasonable to you? You'll notice that using
an
> empty complex type as the input part for parameterless operations, as
> Sam suggested, is commonly done throughout WSRF and other spec WSDLs.
> 
> Ian
> 

Sounds reasonable at all and I will use this workaround.

Good Night
Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to