Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to call a webservice in java?  RSS feed

 
cle tan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do i need to create a client for my web service

i would like to use a soap service, assuming the external web service is created, and i would like to call the function in java file, and use the result for further processing

is it something like this, like connecting a jdbc connection, i will have to first connect to it, then get the parameters from the service?

http://voices.yahoo.com/how-send-soap-request-receive-soap-response-6502980.html
 
Frank Hamilton
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you can used Axis2 for generate a client from wsdl file and then use it for remote call.

Axis2 webpage

 
cle tan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank Hamilton wrote:Maybe you can used Axis2 for generate a client from wsdl file and then use it for remote call.

Axis2 webpage



still not very sure what you mean

there's already an xml file generated on the web

i just want to call the service on java or jsp(whichever way is easier) and retrieve the info
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All major SOAP implementations (like JAX-WS and Axis2) include tools that can create Java client code for a WS via its WSDL. That's how you should start - pick a SOAP implementation and read its documentation about its tools.
 
cle tan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i did was to use netbean to get the webservice, drag the webservice in the java , and run and it works

then i took the service jar file(netbeans helps you create a jar file to call its functions) and put it in the jdk lib-> ext
in the jar file there's a service class that helps to connect to the service, i just drag the functions from the service and put them in the java file.

then i took the callService java file and put it in WEB-INF

in the jsp file i import that java file which uses the lib to call the service, which works


i installed the netbeans JAX-WS plugin which i think it helped to install on the jdk
 
Hendra Kurniawan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what was the type of object sent for te web service to process? is it a primitive like ints or object? do you know how to handle xml file? how to send them to web service and how WS will handle it?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!