GeeCON Prague 2014*
The moose likes Web Services and the fly likes Axis: Multiple methods in style= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis: Multiple methods in style="message" service?" Watch "Axis: Multiple methods in style="message" service?" New topic
Author

Axis: Multiple methods in style="message" service?

Scott Cochrane
Greenhorn

Joined: Oct 09, 2001
Posts: 2
I'm new to SOAP, so bear with me.

I want to create a "document literal" Web Service. My goal is to have one service with several operations. But Axis seems to insist that I have a single method in my implementation class.

Here's my WSDD and implementation class.

<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<service name="a" style="message">
<parameter name="className" value="a.b.c.TestService" />
<parameter name="allowedMethods" value="*" />
</service>
</deployment>

public class TestService {
public void methodA(SOAPEnvelope request, SOAPEnvelope response)
throws Exception {
System.out.println("You have reached TestService#methodA");
}
public void methodB(SOAPEnvelope request, SOAPEnvelope response)
throws Exception {
System.out.println("You have reached TestService#methodB");
}
}

Coded like this, the Axis-generated WSDL shows two operations, methodA and methodB. But running the service generates:

<soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>
Couldn't find an appropriate operation for XML QName
{http://schemas.xmlsoap.org/soap/envelope/}getQuote
</faultstring>
<detail/>
</soapenv:Fault>

If I *remove* one of the methods it runs fine!

To summarize: is there a way to configure things to have a 'style="message"' service with multiple methods? If not, is there a down-side to simply coding one Web Service, containing a single method, for each operation I want to provide to my users?

Thanks!

-Max
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Axis: Multiple methods in style="message" service?