开发者

Calling PHP Web Services in C#

开发者 https://www.devze.com 2023-01-28 11:43 出处:网络
I want to convert following PHP code to C#. $client=new SOAPClient(API_URL.\"www/ws_rpc.php?wsdl&actor=fieldreport_actions&client=\".API_KEY,array(\"uri\"=>\"SOME_URL\",\"style\"=>SOAP_

I want to convert following PHP code to C#.

$client=new SOAPClient(API_URL."www/ws_rpc.php?wsdl&actor=fieldreport_actions&client=".API_KEY,array("uri"=>"SOME_URL","style"=>SOAP_RPC,"use"=>SOAP_ENCODED,"encoding"=>"UTF-8"));
$auth = $client-开发者_如何学C>is_valid_panelist_login("login_type_email",$username,$password);

How can I do it? I found 1 sample at: Help me convert this PHP SOAP code to C# But this looks bit different.


The first step would be to generate a proxy class from the WSDL. This could be done directly in Visual Studio by clicking on the Add Service Reference... and pointing to the WSDL. Once you have the proxy you could directly call the method. It could look something like this:

using (var proxy = new WebServiceClient())
{
    var auth = proxy.is_valid_panelist_login("login_type_email", "user", "pwd");
}
0

精彩评论

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