File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's Wrong with this simple WSDL

 
Avinash Ga
Ranch Hand
Posts: 78
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.........
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Avinash Ga
Ranch Hand
Posts: 78
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your SOAP request is missing the element getPerson which wraps a personRequest.
 
Avinash Ga
Ranch Hand
Posts: 78
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks James. i will try that.
 
Avinash Ga
Ranch Hand
Posts: 78
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also if i use this soap message.




im getting.



one more thing..... im a newbie to jax-ws.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avinash

I think this is progressing. Can you show the java code for your web methods please?
 
Avinash Ga
Ranch Hand
Posts: 78
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
[Thumbnail for Web-Service.jpg]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic