簡體   English   中英

SOAP請求與SOAPClient一起使用,但在PHP中不起作用

[英]SOAP request is working with SOAPClient but not working in PHP

SOAP請求可用於SOAP UI,但不適用於PHP。

<?php
$options = array(
        "soap_version" => SOAP_1_2,
        "trace"=>1,
       // 'SOAPAction'=>'http://bsestarmf.in/MFOrderEntry/getPassword',
       // 'Action'=>'http://bsestarmf.in/MFOrderEntry/getPassword',
      //  'uri'=>'http://bsestarmf.in/MFOrderEntry/getPassword',
        'exceptions'=>true );

$wsdl   = "http://bsestarmfdemo.bseindia.com/MFOrderEntry/MFOrder.svc?singleWsdl";
$client = new SoapClient($wsdl,$options);


//$client->__setSoapHeaders($actionHeader);
$request_param=array('UserId'=>"CAFS101", "Password"=>"123456", "PassKey"=>"abc123");

try
{ 

 $return = $client->getPassword($request_param);

 // $xmlstr = $client->Send("$inputxml");

    echo $response_param;

  }
catch (Exception $e)
{
    echo "<h2>Exception Error!</h2>";
    echo $e->getMessage();
}

?>

異常錯誤! 在消息“”上指定的SOAP操作與HTTP SOAP操作“ http://bsestarmf.in/MFOrderEntry/getPassword ”不匹配。

看一下如何定義例如soapaction的示例: https ://www.php.net/manual/en/soapclient.soapcall.php

$client->__soapCall("SomeFunction", array($a, $b, $c),
                array('soapaction' => 'some_action',
                      'uri'        => 'some_uri'));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM