首页 文章

Cakephp soap客户端:如何发送带有两个名称空间的soap请求?有些人可以给我一些示例代码吗?

提问于
浏览
-3

我是一个新的phper,现在我想使用cakephp soap client在下面发送一个xml请求,但我无法实现它,有些可以给我一些示例代码吗?谢谢 .

<soapenv:Envelope xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ws = "http://ws.test.com"
xmlns:xsd = "http://mtest/xsd">
<soapenv:Header />
<soapenv:Body>
<ws:get_status>
<ws:login>
<xsd:code> ABCDEF </ xsd:code>
<xsd:password> 1UH7UHUH8HUG </ xsd:password>
</ ws:login>
</ ws:get_status>
</ soapenv:Body>
</ soapenv:Envelope>

1 回答

  • 0

    检查一下

    <?php
    
    class MySoapClient extends SoapClient {
    
    function __construct($wsdl, $options) {
        parent::__construct($wsdl, $options);
        $this->server = new SoapServer($wsdl, $options);
    }
    public function __doRequest($request, $location, $action, $version) 
    { 
        $result = parent::__doRequest($request, $location, $action, $version); 
        return $result; 
    } 
    function __myDoRequest($array,$op) { 
        $request = $array;
        $location = 'http://xxxxx:xxxx/TransactionServices/TransactionServices6.asmx';
        $action = 'http://www.micros.com/pos/les/TransactionServices/'.$op;
        $version = '1';
        $result =$this->__doRequest($request, $location, $action, $version);
        return $result;
    } 
    }
    
    
    $soapClient = new MySoapClient("http://xxxx:xxxx/TransactionServices/TransactionServices6.asmx?WSDL", array("trace" => 1)); 
    $PostTransaction = $soapClient->__myDoRequest($orderRequest,$op); 
    ?>
    

相关问题