开发者

Is it possible to send a remote request to a webservice without using the proxy?

开发者 https://www.devze.com 2023-01-29 07:53 出处:网络
The situation is I have multiple webservices for which I need send request and get a response. I want to implement a generic method to call the webservi开发者_StackOverflowces and get a response. Is i

The situation is I have multiple webservices for which I need send request and get a response. I want to implement a generic method to call the webservi开发者_StackOverflowces and get a response. Is it possible to implement a generic method to call any webservice in C# (.net framework 3.5/4.0).

Thanks


You could do it by manually assembling the SOAP XML for a .NET Web Service, but I sure wouldn't want to.


Use SOAP UI to create a test request / response and modify the XML it creates to suit your needs. Then submit that request to the web service using WebClient.

You could have a generic method that does accepts XML as input and returns XML as a result, but you'd still have to parse the XML on a method by method basis.


If your webservices are RESTful you can do that. Your request might respond as XML or JSON. There are other ways but not so straightforward.

0

精彩评论

暂无评论...
验证码 换一张
取 消