This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Services and the fly likes .net web services with java! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark ".net web services with java!" Watch ".net web services with java!" New topic

.net web services with java!

Mateen Dar
Ranch Hand

Joined: Jan 14, 2005
Posts: 55
how can i consume a web service written in C#, from with my j2se application.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
It should not be any different from accessing a web service implemented in any other language. That is, after all, one of the benefits of web services: that they are platform and language-independent, as long as they work according to the specifications (SOAP, WSDL, BP etc.). Try to get the WSDL for the service, and create a Java client for it. It's very possible that it will just work.
Peer Reynders

Joined: Aug 19, 2005
Posts: 2932
You may want to take a good look at the WSDL before you go any further.

Make sure that it is clear of .NET specific data types like DataSet, DataTable, DataRelation, DataRow, DataColumn etc.

If any of those are in there, it may very well be impossible. It is possible to build interoperable web services with .NET, as long as your web service provider is paying attention.

On the other hand, if you build a .NET web service from one of those early tutorials that hands out a ADO.NET DataSet - you might as well forget it.

Example: look for bizarre namespaces like "xmlns:s0="xmlnet/cs/0735618011" and later

Another problem can occur if the web services provider elects to use Windows Security rather than WS-Security to secure the web service - basically restricting potential clients to Windows-based .NET clients.

You could use WebServiceStudio 2.0 to "explore" the web service if you have access to a Windows machine and don't mind installing .NET 1.1 on. (I'm not aware of the Java equivalent; also, it is two years old, so it doesn't support some of the more recent fancy stuff).
[ October 03, 2005: Message edited by: Peer Reynders ]
I agree. Here's the link:
subject: .net web services with java!
It's not a secret anymore!