aspose file tools*
The moose likes Web Services and the fly likes Need explainations please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Need explainations please" Watch "Need explainations please" New topic
Author

Need explainations please

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hi all.
I know who to create and use a web service in Java.
writting the server end point interface and its implementation, then using wscompile tool to generate WSDL file and the static stubs.
consider the following situation :
we have a .NET web service in the server, and the client will be a Java client using JAX-RPC API, static stubs.
some code :

well, I just need some explainations...
1. how my Java client will get its static stub of .NET service ?
2. how my Java client will get all the available methods of the service ?
I know it is the mission of WSDL file, but I am not sure how..
more easily :
How to access a .NET web serivce in Java client ? would you mind telling me the required steps ??
thanks for help.
[ January 14, 2005: Message edited by: John Todd ]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
from the apache axis point of view.
WDSL2Java tool will take care of all the steps and requirements...
Basically it will generate all the neccessary stubs code to access any methods listed under a wsdl file.
All u have to do is make use of that stub classes.
Guess i answered ur question... if not plz comment back.


Spritle Software Blogs
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Thanks.
please correct me if I'm wrong.
we have a web service developed using .net, the URL of this service is :
http://.netservice/ws/catalog.asmx (or what ever).
so to access this service in a Java client, we perform :
1. get the WSDL file of this .net service.
2. using wscompile tool (in case we are using SJSAS) to generate the static stubs.
3. done.
now we can use these static stubs to access the web service, right ??
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
Thats right.

Remember the language the WS is written in 'shouldn't' be of concern (assuming the WS developer has adhered to some common standards.

Everything you need to know is in the WSDL - generating the stubs either by wsdl2java (axis) or wscompile (sun) is the best way but don't have to do that. You could build the call by hand.
Doug Hoople
Greenhorn

Joined: Dec 29, 2004
Posts: 11
Hi All,

The biggest challenge in getting your client to go cross-platform is getting your hands on the WSDL. I just came from the other direction, trying to connect my .NET client to a Java Web Service. My biggest difficulty was trying to figure out the URL to supply for the service, which meant understanding the App Server's organizational/jar structure and puzzling out the DD's. It's much worse puzzling out .NET client/Java Web Service than Java client/.NET service.

Neither one's particularly difficult, though, once you have your hands on the URL to the service.

Once I found the URL on which to append my "?WSDL" the rest was dead easy proxy boilerplating. It should be for you too.

When you're a Java client trying to find the WSDL for the .NET service, you need to have the URL and the service ".asmx" file. With .NET, the URL is always a physical path straight to the physical ".asmx" file. There's no DD-based indirection like there is in Java.

Example:
http://localhost/myservices/myservice.asmx?WSDL

The service URL is everything up to the "?"

Doug Hoople
MCSD.NET, MCDBA, MCSE, MCT, SCJP1.4
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

So, to access a .net web service and get its WSDL file, we wrote :
http://localhost/myservices/myservice.asmx
??
in this way we got the WSDL file ?? I'm just curious ...
Doug Hoople
Greenhorn

Joined: Dec 29, 2004
Posts: 11
Hi John,

http://localhost/myservices/myservice.asmx

will invoke the "blue banner" Service Description html page. You can use this as a human being to explore the structure of the Web Service.

http://localhost/myservices/myservice.asmx?WSDL

will invoke the actual WSDL file, which you can then supply to your proxy generation utility.

Doug Hoople
MCSD.NET, MCDBA, MCSE, MCT, SCJP1.4
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need explainations please