zoukankan      html  css  js  c++  java
  • PHP调用.net webservice 用户身份认证

    简单实例如下:
     1 class SoapUserInfo {
     2     public $UserID;
     3     public $Password;
     4     public function __construct($l, $p) {
     5         $this->Password = $p;
     6         $this->UserID = $l;
     7    }
     8 }
     9 try {
    10     //创建客户端
    11     $client = new SoapClient("http://******/?wsdl");
    12     $reversed = $client->__getFunctions ();   
    13     print_r($reversed); 
    14     //SoapHeader(目标命名(targerNamespace),"消息参数",结构体(用户名及密码封装), false, SOAP_ACTOR_NEXT)
    15     $header = new SoapHeader("targerNamespace", 'targerMessage', new SoapUserInfo('users', 'password'), false, SOAP_ACTOR_NEXT);
    16     $client->__setSoapHeaders($header);
    17     echo $client->__Call('Test',array('parameters'=>array('Test'=>"")))->TestResult;
    18 }
    19 catch(Exception $e){}
  • 相关阅读:
    教你作一份高水准的简历
    python并发
    阻塞,非阻塞,同步,异步
    python三层架构
    paramiko与ssh
    python-进程
    生产者消费者模型
    python-线程
    python-socket
    python-mysql
  • 原文地址:https://www.cnblogs.com/jQing/p/2832069.html
Copyright © 2011-2022 走看看