I'm trying to call a Java web serivce from my C# desktop application. I added a web reference using the WSDL file. I have a simple Java web serivce (simple for the moment), with one method that has one string parameter and returns a string (your basic Hello World test). However I get the following error in VS2008...
The best overloaded method match for 'OWord.localhost.TestOWordWSBeanService.HelloWorld(OWord.localhost.HelloWorld)' has some invalid arguments
Here is my C# code...
|
Here is my WSDL file...
|
What am I doing wrong here?
StevePosted Jan 7, 2011, 8:35 AM
private void btnGetTemplates_Click(object sender, EventArgs e)
{
owordWS.TestOWordWSBeanService ws = new owordWS.TestOWordWSBeanService();
GetAllTemplates gt = new GetAllTemplates();
GetAllTemplatesResponse gtresp = ws.GetAllTemplates(gt);
MessageBox.Show(gtresp.@return);
}
When the method I'm calling returns a String, the code above works fine. When I call a method that returns a List, I don't have the "Response" as in the above code.
Here is a screen shot when I add a reference to my web service...
http://img151.imageshack.us/img151/8497/wsdlinvs2008.png
But as you can see I don't have the "Response" available...
http://img695.imageshack.us/img695/3135/getlistalltemplates.png
I'm wondering if this has something to do with the fact that the GetListOfAllTemplates returns a List? Can C# call a Java web service that returns a List?
Here is what the WSDL file looks like...
Any suggestions as to how I can call a method that returns a List?
Soumya ParidaPosted Dec 25, 2010, 10:08 PM
Try with passing an array of strings first to see if that works.
The response is also an array of string by the way.