柳暗花明笔记

    神奇的__doRequest

    所属分类:[ php&web ] 猫哲学家 发表于:2013-07-13 10:42 浏览:400

    $wsdl = 'https://××××××××××××××××××××/productdataqueryservice.svc?wsdl'; $username = 'username'; $password = 'password'; $client = new SoapClient(null, array('location' => $wsdl, 'uri' => $wsdl));   $xml = '<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ns2="urn:DX.PCM.Orch.Applications.DTO/2011/10" xmlns:ns3="urn:DX.PCM.Orch.Services.Interfaces/2011/10"><soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1"><wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:Username>'. $username .'</wsse:Username><wsse:Password xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">'. $password .'</wsse:Password><wsse:Nonce>FmkZVs0UTSUVp2SXJEg2e4yKVCjmkBnqj+mcPjESlb8=</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2013-07-12T07:29:25Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><SOAP-ENV:Body><ns3:FindCategories><ns3:request><ns2:CategoryIds><ns1:int>199</ns1:int></ns2:CategoryIds><ns2:Langs/></ns3:request></ns3:FindCategories></SOAP-ENV:Body></SOAP-ENV:Envelope>'; $action = 'urn:DX.PCM.Orch.Services.Interfaces/2011/10/IProductDataQueryService/FindCategories'; $result = $client->__doRequest($xml, $wsdl, $action, 1, 0);  // 能取到结果 $result = call_user_func(array($client, 'FindCategories'), $arguments); // 会报验证用户和密码出错 echo $result;
    标签: php 
    上一编文章 css写出来的按钮 下一编文章 Ubuntu 设置了宽带连接后无法上网
    最近文章
    发表评论