Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php中的C#web服务等效代码(将身份验证数据作为头发送)_C#_Php_Soap Client_Soapheader - Fatal编程技术网

php中的C#web服务等效代码(将身份验证数据作为头发送)

php中的C#web服务等效代码(将身份验证数据作为头发送),c#,php,soap-client,soapheader,C#,Php,Soap Client,Soapheader,我们正在尝试在PHP项目中使用web服务(SoapClient)来发送SMS。 web服务是用C#(点网框架)创建的。项目经理描述,必须使用头而不是方法中的参数发送身份验证数据(与大多数web服务一样) 下面是他们给我们的示例代码: using (var sms = new sms.Service()) { var auth = new sms.AuthHeader(); auth.Username = "SERVICE_USERNAME"; auth.Passwor

我们正在尝试在PHP项目中使用web服务(SoapClient)来发送SMS。 web服务是用C#(点网框架)创建的。项目经理描述,必须使用头而不是方法中的参数发送身份验证数据(与大多数web服务一样)

下面是他们给我们的示例代码:

using (var sms = new sms.Service()) 
{
    var auth = new sms.AuthHeader();

    auth.Username = "SERVICE_USERNAME";
    auth.Password = "SERVICE_PASSWORD";
    sms.AuthHeaderValue = auth;

    return sms.SendSms(messagesArray, phoneNumbersArray);            
}
web服务地址为:

http://192.168.10.10/Service.asmx?WSDL
如果有人能为这段PHP代码推荐一个等价物,我将不胜感激。

这里还有一个例子:

SoapHeader {
/* Methoden */
    __construct ( string $namespace , string $name [, mixed $data [, bool $mustunderstand [, string $actor ]]] )
    SoapHeader ( string $namespace , string $name [, mixed $data [, bool $mustunderstand = FALSE [, string $actor ]]] )
}