C# 连接到未知的SOAP Web服务
我想在C#中构建一个应用程序,它连接到Apache AXIS web服务,并通过SOAP执行以下操作C# 连接到未知的SOAP Web服务,c#,web-services,soap,axis,C#,Web Services,Soap,Axis,我想在C#中构建一个应用程序,它连接到Apache AXIS web服务,并通过SOAP执行以下操作 登录到服务器 将字符串数据发布到服务器 接收并显示服务器响应 这是最难的部分。我无权访问服务器,也不知道.JWS文件在服务器上的位置。我能够在web浏览器中访问WSDL文件,因此我知道存在“登录”操作以及接收数据的操作 我已尝试通过URL访问web服务,但始终收到以下消息: 你好,这里是AXIS服务 也许会有一个 正在此处调用服务 总之,当我只有WSDL文件的URL时,我是否可以连接到此web服
svcutil.exehttp://url.to/webservice?WSDL _wsdl.wsdl/language:C#
应该生成可以在C#项目中使用的代理类,您可以调用该服务,例如
BasicHttpBinding myBinding = new BasicHttpBinding(); //might not even need these
// 2 lines if you ran svcutil.exe directly on the web service URL
EndpointAddress myEndpoint = new EndpointAddress("http://url.to/webservice");
TestClient client = new TestClient(myBinding,myEndpoint); //the generated classes
// svcutil.exe created
client.SomeOperation(42); // call an SomeOperation of the web service
谢谢大家的帮助。回顾这个问题,我可以看出我是多么的困惑。以下是我遵循的解决方案 假设您知道希望连接到的服务的WSDL文件的URL,那么只需执行以下操作
//Example
sampleService.ClassName test = new sampleService.ClassName();
test.displayName("Jack");