Java Web Services calling from C# winform Application
Hi,
I am new to this forum.I am new in .net programming.I want to know that I have a small project i am working on,where I have Java Webservices and I have to call it from my C# winform application.I have just wsdl file for JavaWebservices that I have added in my .net client application as a web reference.I know what methods and class i have to call it from the web services.What I have to do in order to do it?I do not have any idea about it.Please somebody tell me exactly what are the steps to do this things working.
Marc LiddellPosted Mar 17, 2009, 10:27 AM
I don't want to argue with the gold member, but this is how i do it.... (My Service reference is called SRef, and is in the same name space as this class....
1) declare it: public
SRef.Service1Client sr;2) create an object: sr = new SRef.Service1Client();
3) Use the methods like this:
returnValue = sr.AddNumbers(
num1, num2);(FYI: i use netbeans 6.5 and VS2008)
Marc
Bechir BejaouiPosted Mar 17, 2009, 10:17 AM
.Net creates a proxy for you, and you can call your webservice through this proxy.
To add a web reference you right click the solution and add the web reference by clicking the web reference item
kushal dalalPosted Mar 17, 2009, 10:14 AM
Marc LiddellPosted Mar 17, 2009, 9:56 AM
I would do this slightly differntly to you, and use a service reference instead of a web reference.
- Start your java web service
-in c-sharp right click on references and click on new service reference and enter your java service wsdl address
-In your c# code create an object of the service reference, then you can use it like a normal class.
I hope this helps....
Marc