• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Mark Heron
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ivan,

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

Regards
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic