小编han*_*rca的帖子

使用php客户端使用Web服务(Soap)

我正在尝试为这个Web服务编写一个客户端

它使用两层身份验证(一个在请求头中,另一个用于服务器中的数据访问),这意味着我需要在头中传递它.这是我试图做的:

class ChannelAdvisorAuth 
{ 
    public $DeveloperKey; 
    public $Password; 

    public function __construct($key, $pass) 
    { 
        $this->DeveloperKey = $key; 
        $this->Password = $pass; 
    } 
} 

$devKey      = "user"; 
$password    = "pass"; 

$soapArr = array(
    "trace"=>true,
    "exceptions"=>true,
);

$url         = "http://soalive.grimaldiwebservices.it/framework/JourneyManager?wsdl"; 
$client     = new SoapClient($url, $soapArr); 
echo "client created!"; 
print_r($client -> __getFunctions());
$auth         = new ChannelAdvisorAuth($devKey, $password); 
$header     = new SoapHeader($url, "APICredentials", $auth, false); 

$in0 = array( 
    "in0" => array( 
        "user"        => "user", 
        "password"    => "pass",
        "message-id"  => "",
        "status"   => array("error-code" …
Run Code Online (Sandbox Code Playgroud)

php xpath soap web-services

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

php ×1

soap ×1

web-services ×1

xpath ×1