简体   繁体   English

如何从PHP发送Soap请求到JAX-WS Web服务?

[英]How to Send Soap request to JAX-WS webservice from PHP?

I'm trying to get XML request by using __getLastRequest() like below but failing, plz help 我正在尝试通过使用__getLastRequest()来获取XML请求,如下所示,但失败了,请帮助

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:ord="http://medplus.com/orders">
     <soapenv:Header/>
     <soapenv:Body>
    <ord:getOrderDocuments>
        <request>
            <hl7Order>IvRmxhdGVEZWNvZGU+PnN0cmVhbQp4nbPbOQ. . . Base64-encoded content truncated
            </hl7Order>
            <orderSupportRequests>
                <requestType>ABN</requestType>
                <requestType>REQ</requestType>
            </orderSupportRequests>
        </request>
    </ord:getOrderDocuments>
    </soapenv:Body>
    </soapenv:Envelope>

How can I send this SOAP request and can get its response using PHP? 如何发送此SOAP请求并使用PHP获得响应?

You can check documentation for PHP WSDL client here: http://php.net/manual/en/book.soap.php 您可以在此处查看PHP WSDL客户端的文档: http : //php.net/manual/zh/book.soap.php

$service_url ="my url";
$client = new SoapClient($service_url,array('cache_wsdl' => WSDL_CACHE_NONE));
    $response = $client->ord:getOrderDocuments(array (
        "hl7Order" => "IvRmxhdGVEZWNvZGU...",
        //..... other args
    ));

//fetch response        
$output =$response->return;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM