我在php中通过curl进行SOAP调用。但是这个错误只是弹出来。我想这是因为肥皂动作已正确设置并且它不为空。
带有 To'' 的消息无法在接收方处理,因为 端点调度程序的地址过滤器不匹配。 检查 发送方和接收方的端点地址一致。
我不知道为什么会这样。我在这里错过了什么还是在错误的地方使用了东西。
这是我的肥皂请求
$soap_request =
'<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:bses="http://bsestarmf.in/">
<soap:Header>
</soap:Header>
<soap:Body>
<bses:getPassword>
<!--Optional:-->
<bses:UserId>123456</bses:UserId>
<!--Optional:-->
<bses:Password>789456</bses:Password>
<!--Optional:-->
<bses:PassKey>0123478</bses:PassKey>
</bses:getPassword>
</soap:Body>
</soap:Envelope>';
$header = array(
"Content-type: application/soap+xml;charset="utf-8"",
"Accept: application/soap+xml",
"Cache-Control: no-cache",
"Pragma: no-cache",
"SOAPAction: http://bsestarmf.in/MFOrderEntry/getPassword",
"Content-length: ".strlen($soap_request),
);
$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL,"http://bsestarmfdemo.bseindia.com/MFOrderEntry/MFOrder.svc" );
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
curl_setopt($soap_do, CURLOPT_POST, true );
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $soap_request);
curl_setopt($soap_do, CURLOPT_HTTPHEADER, $header);
$result = curl_exec($soap_do);
dd($result);
你需要添加
<wsa:To>"http://bsestarmfdemo.bseindia.com/MFOrderEntry/MFOrder.svc"</wsa:To>
到您的标头 XML