GeeCON Prague 2014*
The moose likes Web Services and the fly likes connecting to a web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "connecting to a web service" Watch "connecting to a web service" New topic
Author

connecting to a web service

Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
hello.

we have an existing web service that was made in c# and asp.

i am currently using java for my web applications. how do i connect to those web services already existing?
Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
i read in another post that for you to do this, you have to use SAAJ or JAX-RPC APIs. i would just like to ask what they are and how they could be used.

i currently have tomcat 4.1 and apache axis set up.

thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
SAAJ and JAX-RPC are Java APIS for accessing web services. You can find links to their respective home pages, and to more information, in the Web Services FAQ.


Ping & DNS - my free Android networking tools app
Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
are they needed for me to be able to access web services?
because my seatmate said they aren't
Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
i already have the jar files for saaj and jaxrpc in
C:\Apache Group\Tomcat 4.1\webapps\axis\WEB-INF\lib

do you have any sample code that connects to a web service?
i have all these sample codes in axis and they compile and run but i don't know if they're running correctly. i mean, i don't understand the code...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
You don't have to use SAAJ or JAX-RPC to connect to a WS. You can create the SOAP yourself, or use any other client library that does it for you. Given that those two are the standard Java APIs, and that a number of tools generate code based on them, using them seems like an easy choice, though. But it depends on your circumstances, of course.

A number of articles of how to access WS in Java are linked in the FAQ. The one titled "Article on OnJava" in particular has some examples; just ignore the parts about creating the service itself, since you already have that.
Ranganath .S.Junpal
Ranch Hand

Joined: Jan 16, 2005
Posts: 52
you can consume c# webservice as by following these simple steps

1) To consume this Web Service with AXIS, WSDL file for the HelloWorld Web Service needs to be downloaded.
2) use wsdl2java tool to convert wsdl specification to java code.

And follow the simple steps as mentioned in this link

http://www.codeproject.com/dotnet/NET_WS_with_AXIS.asp
 
GeeCON Prague 2014
 
subject: connecting to a web service