gpt4 book ai didi

PHP SOAP Header 与 HTTP SOAP Action 不匹配,如何设置?

转载 作者:行者123 更新时间:2023-12-04 05:43:28 31 4
gpt4 key购买 nike

我什么都试过了!我正在使用这个 WSDL我只是想进行身份验证。我不断收到此错误:

The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/IPSShipCarrier/Authenticate'



这是我的代码:
    $options = array(
"soap_version" => SOAP_1_2,
"trace"=>1,
'UserName'=>'blahremoved',
'Password'=>'blahremoved',
'AuthToken'=>'blahremoved',
'SOAPAction'=>'http://tempuri.org/IPSShipCarrier/Authenticate',
'Action'=>'http://tempuri.org/IPSShipCarrier/Authenticate',
'uri'=>'http://tempuri.org/IPSShipCarrier/Authenticate',
'exceptions'=>true );

$client = new SoapClient( "http://test.psdataservices.com/PSShipCarrierAPI/PSShipCarrier.svc?WSDL", $options );

$auth = array(
'UserName'=>'blahremoved',
'Password'=>'blahremoved',
'AuthToken'=>'blahremoved',
'SOAPAction'=>'http://tempuri.org/IPSShipCarrier/Authenticate',
'Action'=>"Authenticate"
);
$header = new SoapHeader('http://tempuri.org/IPSShipCarrier/Authenticate','Authenticate',$auth,false);

$client->__setSoapHeaders($header);

$params = new StdClass;
$params->Action = "http://tempuri.org/IPSShipCarrier/Authenticate";
$params->SOAPAction = "http://tempuri.org/IPSShipCarrier/Authenticate";
$params->UserName = "blahremoved";
$params->Password = "blahremoved";
$params->AuthToken = "blahremoved";
$client->Authenticate($params);

让我知道你的想法?

最佳答案

当尝试访问一个未知的网络服务时,你应该从soapUi 开始。 http://www.soapui.org/这将在 2 分钟内向您展示,

it's a SOAP 1.1 service

this is the minimal content for the Authenticate port:

<tem:Authenticate>
<!--Optional:-->
<!--type: string-->
<tem:ClientName>aat</tem:ClientName>
<!--Optional:-->
<!--type: string-->
<tem:UserName>soa</tem:UserName>
<!--Optional:-->
<!--type: string-->
<tem:Password>quaaao</tem:Password>
<!--Optional:-->
<!--type: string-->
<tem:AuthToken>verraauras</tem:AuthToken>
<!--Optional:-->
<!--type: scShipCarrier - enumeration: [scUnknown,scStampsCom,scUPS,scEndicia,scFedEx]-->
<tem:ShipCarr>scUnknown</tem:ShipCarr>
</tem:Authenticate>

their messagerouter must be based on soap-action alone, so using Action is pointless and unnecessary


所以是的,使用soapUi 可以挽救你的一天;)

关于PHP SOAP Header 与 HTTP SOAP Action 不匹配,如何设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10986264/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com