-
1. Re: .NET calling WebService
md5georg May 11, 2005 3:21 AM (in response to awesomejt)Hello,
I have had similar problems earlier. The problem I had came from using a MS tool that used the .Net 1.0 version. Confirm that you are using at least a .Net 1.1 version.
Also, there has been some discussions regarding interoperability with .Net earlier in this forum, here are some links:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=63158
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=62229
Best regards,
Georg -
2. Re: .NET calling WebService
scharlau May 11, 2005 4:16 PM (in response to awesomejt)Jason,
assuming that you are using the .NET SDK 1.1 Framework, then you can use the wsdl.exe tool under C:/program files/microsoft.net/sdk/v.1.1/bin to generate the appropriate c# classes, which you then need to make use of. You can find out more in the sdk help files too, but you basically point it at the wsdl file, and away it goes. I'm on the wrong computer just now to post the example, but you end up doing some convaluted bits to call the generated classes. I'll post an example tomorrow.
Bruce -
3. Re: .NET calling WebService
scharlau May 12, 2005 9:00 AM (in response to awesomejt)Hi,
here's the example as mentioned. It calls a basic hello world service, which returns a Person object with their name and age.
First, use wsdl.exe, which I call from a bat file, and which generates the appropriate cs file for me, which I then use in the client.\..\..\Progra~1\Microsoft.NET\SDK\v1.1\Bin\wsdl /out:ws4eeProxy.cs http://localhost:8080/simple-ws4ee/exactpath/jse?wsdl
Second, the client cs file, which you can see makes use of the generated objects.using System;
namespace ws4ee
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("ws4ee doc lit from jboss!");
HelloService ap = new ws4ee.HelloService();
Person p = new Person();
string s = "bill";
getHelloWorld ghw = new getHelloWorld();
ghw.String_1 = s;
getHelloWorldResponse ghwr = new getHelloWorldResponse();
ghwr = (getHelloWorldResponse)ap.getHelloWorld(ghw);
p = ghwr.result;
Console.WriteLine(p.age + " " + p.name);
}
}
}
That's all there is to it, and you then have your returned object to do with as you please.