aspose file tools*
The moose likes SOA and ESB and the fly likes Cannot find dispatch method for {http://localhost:8088/SimpleSOA/HelloWorldImplPort} Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » SOA and ESB
Bookmark "Cannot find dispatch method for {http://localhost:8088/SimpleSOA/HelloWorldImplPort}" Watch "Cannot find dispatch method for {http://localhost:8088/SimpleSOA/HelloWorldImplPort}" New topic
Author

Cannot find dispatch method for {http://localhost:8088/SimpleSOA/HelloWorldImplPort}

rajesh babu Y
Ranch Hand

Joined: Nov 12, 2010
Posts: 31
Hi All,

i'm new to Java Web Services, i had deployed sample hello world service on Tomcat server and trying to access from client application, i'm getting following error ...

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: Cannot find dispatch method for {http://localhost:8088/SimpleSOA/HelloWorldImplPort}getHelloWorldAsString
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Cannot find dispatch method for {http://localhost:8088/SimpleSOA/HelloWorldImplPort}getHelloWorldAsString
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)



Cannot find dispatch method for {http://localhost:8088/SimpleSOA/HelloWorldImplPort}getHelloWorldAsString

Here is the WSDL file

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-hudson-390-. -->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.com/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloWorldImplService" targetNamespace="http://service.com/">
<types/>
<message name="getHelloWorldAsString">
<part name="arg0" type="xsd:string"/>
</message>
<message name="getHelloWorldAsStringResponse">
<part name="return" type="xsd:string"/>
</message>
<portType name="HelloWorld">
<operation name="getHelloWorldAsString">
<input message="tns:getHelloWorldAsString"/>
<output message="tns:getHelloWorldAsStringResponse"/>
</operation>
</portType>
<binding name="HelloWorldImplPortBinding" type="tns:HelloWorld">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getHelloWorldAsString">
<soapperation soapAction=""/>
<input>
<soap:body namespace="http://service.com/" use="literal"/>
</input>
<output>
<soap:body namespace="http://service.com/" use="literal"/>
</output>
</operation>
</binding>
<service name="HelloWorldImplService">
<port binding="tns:HelloWorldImplPortBinding" name="HelloWorldImplPort">
<soap:address location="http://localhost:8088/SimpleSOA/HelloWorldImplPort"/>
</port>
</service>
</definitions>

Here is my client call

Service service = new org.apache.axis.client.Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress("http://localhost:8088/SimpleSOA/HelloWorldImplPort?wsdl");
call.setOperationName( new QName("http://localhost:8088/SimpleSOA/HelloWorldImplPort", "getHelloWorldAsString") );
String ret = (String) call.invoke( new Object[] {"some kind of message"} );
System.out.println(ret);

Service name -- HelloWorld.java
ServiceImpl -- HelloWorldImpl.java

Could you let me know what was the issue ...
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 547
    
    3
call.setOperationName( new QName("http://localhost:8088/SimpleSOA/HelloWorldImplPort", "getHelloWorldAsString") );

The naming of namespace of the operation is a priori quite decoupled from the addressing of the endpoint. Here, the namespace is what the targetNamespace is in the wsdl, that is "http://service.com/".
 
Don't get me started about those stupid light bulbs.
 
subject: Cannot find dispatch method for {http://localhost:8088/SimpleSOA/HelloWorldImplPort}