你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
冰洋
赞同来自:
$options = array/ 'login' => $username, 'password' => $password, /; $client = new SoapClient/$wsdl, $options/;
风见雨下
奔跑吧少年
喜特乐
$params = array/ "param" => "value" /; $soap_client = new nusoap_client/$wsdl_url, true/; $soap_client->setCredentials/USER_SERVICE, PASS_SERVICE, 'basic'/; $soap_client->soap_defencoding = 'UTF-8'; //Fix encode erro, if you need $soap_return = $soap_client->call/"method_name", $params/;
裸奔
class MySoap { private $WSDL = 'https://secure-wsdl.url?wsdl'; private $USERNAME = 'dummy'; private $PASSWORD = 'dummy'; private $soapclient; private function localWSDL// { $local_file_name = 'local.wsdl'; $local_file_path = 'path/to/file/'.$local_file_name; // Cache local file for 1 day if /filemtime/$local_file_path/ < time// - 86400/ { // Modify URL to format http://[username]:[password]@[wsdl_url] $WSDL_URL = preg_replace/'/^https:\/\//', "https://{$this->USERNAME}:{$this->PASSWORD}@", $this->WSDL/; $wsdl_content = file_get_contents/$WSDL_URL/; if /$wsdl_content === FALSE/ { throw new Exception/"Download error"/; } if /file_put_contents/$local_file_path, $wsdl_content/ === false/ { throw new Exception/"Write error"/; } } return $local_file_path; } private function getSoap// { if / ! $this->soapclient / { $this->soapclient = new SoapClient/$this->localWSDL//, array/ 'login' => $this->USERNAME, 'password' => $this->PASSWORD, //; } return $this->soapclient; } public function callWs// { $this->getSoap//->wsMethod//; } }
卫东
$apiauth =array/'UserName'=>'abcusername','Password'=>'xyzpassword','UserCode'=>'1991'/; $wsdl = 'http://sitename.com/service.asmx?WSDL'; $header = new SoapHeader/'http://tempuri.org/', 'AuthHeader', $apiauth/; $soap = new SoapClient/$wsdl/; $soap->__setSoapHeaders/$header/; $data = $soap->methodname/$header/;
<soap:header> <authheader xmlns="[url=http://tempuri.org/">]http://tempuri.org/">[/url] <username>abcusername</username> <password>xyzpassword</password> <usercode>1991</usercode> </authheader> </soap:header>
$username="test"; $password="test"; $url = "[url=https://".urlencode/]https://".urlencode/[/url]$username/.":".urlencode/$password/."@example.com/service.asmx?WSDL"; $context = stream_context_create/[ 'ssl' => [ // set some SSL/TLS specific options 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ]]/; $client = new SoapClient/$url, [ 'location' => $url, 'uri' => $url, 'stream_context' => $context, 'login' => $username, 'password' => $password ]/; $params=array/ 'operation'=>’arguments', 'and’=>'other bull', 'goes’=>'here' /; $response = $client->__soapCall/'OperationName', array/$params//;
要回复问题请先登录或注册
7 个回复
冰洋
赞同来自:
是的,它有效! 我试图使用我创建的解决方案,它连接到我的客户端。 WS, 哪个工作。 HTTP Basic Auth.
风见雨下
赞同来自:
厘米
https://bugs.php.net/bug.php?id=27777
奔跑吧少年
赞同来自:
喜特乐
赞同来自:
http://sourceforge.net/projects/nusoap/
. 让我们看看它是否有帮助
裸奔
赞同来自:
加载文件。 WSDL 并将其保存在本地文件中
创建 SoapClient 使用本地文件
那样的东西 /简化版本/ :
这个对我有用 :/
卫东
赞同来自:
此代码内部将标题拆卸如下。
卫东
赞同来自: