I apologize -- I'm not an expert on the Axis message handler, so I'm not
100% sure about this answer -- perhaps someone else can pipe up and correct
me if I'm wrong. But here's my reasoning about how it should work:

When using a message style service with a message signature such as 
  Public void method( SOAPEnvelope req, SOAPEnvelope resp )

you're telling Axis not to process the SOAP body, so it will dispatch the
method before processing the child element of SOAP Body (the operation
name). Option #1 won't work. You have to use option #2: one method for all
operations. Your method must process the XML, extract the operation from the
message, and perform the requested operation.  

I'm not quite sure how Axis goes about dispatching the method -- I'm
assuming that the message provider permits only one method to be associated
with a service URL. I'm also not quite sure how to configure this service
such that the WSDL associated with it actually exposes the wrapped
doc/literal interface. But you should be able to do so. 

- Anne

-----Original Message-----
From: Rafael Gomez [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 27, 2004 2:15 PM
To: [EMAIL PROTECTED]
Subject: Re: message style SOAP service

Anne,

I am following this conversation and I would like to ask one more thing 
based on the wsdl example at 
http://www.burtongroup.com/weblogs/annethomasmanes/archives/cat_apache_axis.
html

Suppose we add 2 new 'operations' to the service, say  'multiply' and 
'divide', both taking again two 'int' arguments and returning an 'int'.
We could complete the wsdl using the same approach used for the 
operation 'add' (, i.e, via wrapped convention)

Suppose I choose Axis MESSAGE programming style for the service class, 
and for example, the method signature 'public void method( SOAPEnvelope 
req, SOAPEnvelope resp )'.

What's the normal/correct thing to do when implementing my service class?:

1) implementing one method per operation, i.e:

public void add(SOAPEnvelope req, SOAPEnvelope resp)
{....}
public void multiply(SOAPEnvelope req, SOAPEnvelope resp)
{....}
public void divide(SOAPEnvelope req, SOAPEnvelope resp)
{....}

Would Axis call correct method based on the operation name (i.e, based 
on the wrapper element name in soap request) ?
If yes, when is the correct method determined? Who finds the correct method?

2) implementing only one method for all the operations, i.e:

public void myMethod(SOAPEnvelope req, SOAPEnvelope resp)
{....}

Then myMethod could extract 'operation name' and parameters from the 
request, compute and create/modifiy the resp.

-R






Message examples from a client:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema";
       xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <SOAP-ENV:Body>
 *<add*>
   <arg1 xsi:type="xsd:int">*2*</arg1>
   <arg2 xsi:type="xsd:int">*5*</arg2>
 *</add*>  
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema";
       xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <SOAP-ENV:Body>
 *<multiply*>
   <arg1 xsi:type="xsd:int">*2*</arg1>
   <arg2 xsi:type="xsd:int">*5*</arg2>
 *</**multiply*>  
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>




Reply via email to