Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to call web service from java code

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All
I have to create UI which will work as follows:
1) By giving wsdl file link ,it will show all operations(methods) exposed
2) After selecting any method & giving proper request , it will give me response
I am using wsdl4j. I have completed first one. Can anyone tell me how to call web service method & get response.
I know we have SOAP UI & other tools, but for some requirements I have to create my own.
Please help me. Steps to do that, any document related to that also appriciated.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Section 9.4 of my electronic book (freely downloadable here http://www.slideshare.net/krizsan/scdjws-5-study-notes-3085287) shows an example on how to implement an XML web service and client.
You should be able to adapt this example to suit your needs. Instead of using JAXB to create the request and interpret the response XML data, you will probably want to use the SAAJ API to create requests and process responses. See the Java SE 6 API documentation of the class javax.xml.soap.MessageFactory for details.
There are examples using this API in my book as well.
I would consider using Groovy for, at least, the XML processing part.
Best wishes!
 
bhushan devare
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ivan, its really helpful for me. It solved my problem.
 
Paper beats rock. Scissors beats tiny ad.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic