aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Cannot find dispatch method for {http://www.ivan.com/additionservicetypes}addValuesRequest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Cannot find dispatch method for {http://www.ivan.com/additionservicetypes}addValuesRequest" Watch "Cannot find dispatch method for {http://www.ivan.com/additionservicetypes}addValuesRequest" New topic
Author

Cannot find dispatch method for {http://www.ivan.com/additionservicetypes}addValuesRequest

Mark Heron
Greenhorn

Joined: Aug 19, 2010
Posts: 20
Hello Folks,

I'm trying example of document style webservice from Ivan's study guide section 9.3. On running client program I'm getting below error.

Adding the values 7.241783721362973 and 1.5793153077945998:
*** A fatal error occurred:
Cannot find dispatch method for {http://www.ivan.com/additionservicetypes}addValuesRequest

SOAP request on TCPMon:

POST /JAX-WS_SchemaToWS/calculationService HTTP/1.1
Content-type: text/xml;charset="utf-8"
Soapaction: "http://www.ivan.com/AdditionService/CalculationService/addValuesRequest"
Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
User-Agent: JAX-WS RI 2.1.6 in JDK 6
Host: 127.0.0.1:37199
Connection: keep-alive
Content-Length: 283

<?xml version="1.0" ?>

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:addValuesRequest xmlns:ns2="http://www.ivan.com/additionservicetypes">
<value1>7.241034568984911</value1>
<value2>1.5627112561036527</value2>
</ns2:addValuesRequest>
</S:Body>
</S:Envelope>

SOAP response on TCPMon:

HTTP/1.1 500 Internal Server Error
X-Powered-By: Servlet/3.0
Server: GlassFish v3
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Thu, 19 Aug 2010 16:33:16 GMT
Connection: close

6e
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
f1
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:Client</faultcode>
<faultstring>Cannot find dispatch method for {http://www.ivan.com/additionservicetypes}addValuesRequest
</faultstring>
</S:Fault>
</S:Body>
</S:Envelope>
0

Does anybody get similar error? Any idea what can be the solution?

Thanks
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Please enclose the WSDL and XSD for the service you have developed.
Have you tried to send requests to the service using soapUI?
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Mark Heron
Greenhorn

Joined: Aug 19, 2010
Posts: 20
Here you go. I have to modify additionType.xsd to additionTypes.xsd(extra "s" in name) to locate XSD correctly. I assume it is typo in study guide.(Version: July 12, 2010)

==================================================================================================================
WSDL
==================================================================================================================

==================================================================================================================
XSD
==================================================================================================================


I also tried to send requests using aoapUI. I got similar response. See below.
==================================================================================================================
soapUI Request
==================================================================================================================

==================================================================================================================
soapUI Response
==================================================================================================================
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Mark Heron wrote:Here you go. I have to modify additionType.xsd to additionTypes.xsd(extra "s" in name) to locate XSD correctly. I assume it is typo in study guide.(Version: July 12, 2010)

Indeed! Thank you for pointing this out!

I pasted the WSDL and the XML schema into my version of the web service and it does look like there are no problems with those two files, since the web service works as expected.
I did generate the JAXB bean classes etc using the Ant-script.
I tried with soapUI and received this response:

If you want me to look further into this, please compress the entire web service project in an archive file and put it somewhere where I can download it.
Best wishes!
Mark Heron
Greenhorn

Joined: Aug 19, 2010
Posts: 20
Ivan,

Thanks for looking into this. I appreciate your help.

Can you please provide me corresponding HTTP(NOT SOAP) request? Also, Please let me know Glassfish and soapUI version you are using.

I noticed one thing, I can successfully test my webservice using Glassfish test tool. However, it uses diffrent SOAP request than what soapUI and standalone client is using. Moreover, when I compare WSDL within my webservice project with Glassfish version of WSDL they are diffrent in Action and operation name. I guess Glassfish generates WSDL out of implementation class and it doesn't care what mapping is defined within WSDL inside WEB-INF/wsdl folder. I wish Glassfish can validate class and WSDL at deploy time and flag error if something is not matching rather than silently generating own version of wsdl and use it.

Thanks
Mark
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
If GlassFish generates a WSDL instead of using the existing one, then make sure that the endpoint implementation class is properly annotated:

I'll get back later with more information and sample request.
Best wishes!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Sorry about the delay.
First of all, I use GlassFish 3.0.1 but originally when developing the sample, I used GlassFish 2.1.
For testing, I have used soapUI 3.5.
I can only supply the request generated by soapUI, which looks like this:

The corresponding response looks like this:

Best wishes!
Mark Heron
Greenhorn

Joined: Aug 19, 2010
Posts: 20
Ivan,

Finally, it worked. I was using GlassFishV3 application server. When I moved same code to GlassFish 3.0.1, it worked like charm. Funny Right? The core idea of Webservice is interoperability but it doesn't seem to be portable between two versions of same server.

Anyways, Thanks a lot for your quick followup.

Thanks
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Good to hear that the matter is resolved.
Did you use v3 or v3 prelude before switching to v3.0.1?
Best wishes!
Mark Heron
Greenhorn

Joined: Aug 19, 2010
Posts: 20
Ivan,

I used GlassFish V3(Sun) before switch to V3.0.1(Oracle).

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot find dispatch method for {http://www.ivan.com/additionservicetypes}addValuesRequest
 
Similar Threads
Problem in Throwing Exception
Error in Soap Response while implementing ws-security using Metro
What's Wrong with this simple WSDL
Why Getting Fault Code in SOAP Response Message
SOAP Request and Response problem