File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes What's Wrong with this simple WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "What Watch "What New topic
Author

What's Wrong with this simple WSDL

Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

Hi Ranchers,

I have written a contract first web service (its my first TOOO )..... i have deployed the same in glass fish server and when i try to invoke the service using jax-ws generated client im getting this exception
. i also tried creating a soapui project using the same wsdl, but unable to generate the sample request.

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Cannot find dispatch method for {http://www.example.org/PersonService/}personRequest
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy29.getPerson(Unknown Source)
at org.example.personservice.PersonServiceTester.main(PersonServiceTester.java:17)


here is my wsdl.....





i think there is some problem with the wsdl. but unable to find it out. can you please help me rancher.........


Avinash G.A
OCP Java SE 6 Programmer, OCP Java EE 5 Web Component Developer, OCE Java EE 6 Web Services Developer, VMware Certified Core Spring 3.x Developer, EMC Proven Professional (ISM-V2)
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
When you try to create a project in soapUI, are there any error messages?
Were you able to successfully create a project with a sample request for the operation of your web service?
I tried to use your WSDL in soapUI and my answers to the above are "yes" and "no".
I'll give you a clue: There are some unnecessary parts in your <binding> element (including child elements).
Upon doubt, I suggest you to look at a WSDL that is known to be good and compare with your WSDL.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

Thanks Ivan...... yes , im also not able to generate a soap request from SoapUI. Thanks for your suggestion. i will try that.

Also ivan im really grateful for your study materials on the certification. Thats really great. im following the same with the one written by Mikalai for my certification. thanks again.
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

Hi Ivan,

Finally i resolved the issue . the problem was with my wsdl . the input/output section inside the porttype was not having name attribute. fixed the same .

here is my port type.



Thanks Again.......
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

This time im able to generate the sample request using soapui . but when i submit the request im getting the error

here is my updated (latest) wsdl :-





also here is my soap request :-



and the soap response is :-






can anyone help?

Thanks in advance
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1031
    
    5

Your SOAP request is missing the element getPerson which wraps a personRequest.
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

Thanks James. i will try that.
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

Hi James,

in the wsdl, input message is of the type personRequest and im passing the same from my soap ui. can you please let me know the solution?

Thanks
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

also if i use this soap message.




im getting.



one more thing..... im a newbie to jax-ws.
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1031
    
    5

Avinash

I think this is progressing. Can you show the java code for your web methods please?
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

Hi James,

Here is my java code.....

Endpoint Interface.




and here is the service....





one weird thing.....

i published the same web service using EndPoint api and for the request




im getting the response.


its kinda working..... but i dont know why this tag in the response (<ns2:getPersonResponse xmlns:ns2="http://www.example.org/PersonService/">).
atleast it is working if i use EndPoint api to publish.

but the same thing if i deploy in GlassFish server im getting


as a response.

attached is the whole of my (silly) project with ant script. just "ant build" will generate a deployable war. please change the extension of the file to *.zip


Thanks Again


[Web-Service.jpg]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's Wrong with this simple WSDL