• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How to call web service from java code

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ivan, its really helpful for me. It solved my problem.
 
permaculture is giving a gift to your future self. After reading this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic