I just created my very first web service. I did this by retrieving wsdl
for a web service that is currently being developed by another company
and running wsdl2java to generate the client and server stub and
skeleton code. I added some simple implementation into my service Impl
class to just return a simple string and successfully deployed my WS. I
created a client as follows:
package pbf.hot;
import Sirit.ETTM.TZCServiceLocator;
import Sirit.ETTM.TZCService;
import Sirit.ETTM.TZCServiceSoap;
public class TestService {
public static void main(String[] args) throws Exception {
String test = null;
// Make a service
TZCService service = new TZCServiceLocator();
//Now use the service to get a stub which implements the
SDI
TZCServiceSoap port = service.getTZCServiceSoap();
//Make the actual call
test = port.getTransactions("Test");
System.out.println("Call Results:" + test);
}
}
but when I run the client, I'm getting the following Axis fault. My web
service is on the same machine as my client. Does anyone know what I'm
doing wrong?
Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (405)Method not allowed
faultActor:
faultNode:
faultDetail:
{}:return code: 405
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html dir=ltr>
.
.
.
<title>The page cannot be displayed</title>
.
.
.
{http://xml.apache.org/axis/}HttpErrorCode:405
(405)Method not allowed
at
org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java
:744)
at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
ava:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at
Sirit.ETTM.TZCServiceSoapStub.getTransactions(TZCServiceSoapStub.java:12
8)
at pbf.hot.TestService.main(TestService.java:18)