发送请求到wsdl文件并使用php获取响应

时间:2017-02-08 19:42:58

标签: php wsdl soapui

我搜索了很多这个部分,但我发现了很多问题,所以我在它们之间感到困惑

这是wsdl文件 $wsdl = 'http://url.com/service.wsdl';

以下是SOAP定义。如何使用php文件发送请求并获取响应

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ent="http://enterprise.olp.sadad.com/Infrastructure/EnterpriseContext" xmlns:ns="http://olp.sadad.com/sadadpaymentmanagement/service/sadadpaymentmanager/intf/1">
   <soap:Header>
      <ent:enterpriseContext>
         <ent:contextInfo>
            <ent:ProcessContextId>--</ent:ProcessContextId>
            <ent:businessContextId>CO</ent:businessContextId>
            <ent:applicationContextId>3</ent:applicationContextId>
         </ent:contextInfo>
         <ent:requestOriginator>
            <ent:requesterCode>NCBK</ent:requesterCode>
            <ent:machineIPAddress>00.00.00.00</ent:machineIPAddress>
            <ent:userPrincipleName>NCB</ent:userPrincipleName>
            <ent:requestedTimestamp>2015-10-01T05:53:04</ent:requestedTimestamp>
            <ent:channelId>1</ent:channelId>
         </ent:requestOriginator>
      </ent:enterpriseContext>
   </soap:Header>
   <soap:Body>
      <ns:InitiatePaymentDetails>
         <InitiatePaymentDetailsRequest>
            <transactionAmount>50</transactionAmount>
            <olpIdAlias>abcd</olpIdAlias>
            <merchantRefNum>1238688</merchantRefNum>
            <merchants>
               <merchantId>2854</merchantId>
               <merchantRefNum>1238688</merchantRefNum>
               <paymentAmount>50</paymentAmount>
               <paymentCurrency>SAR</paymentCurrency>
               <merchantType>1</merchantType>
            </merchants>
            <dynamicMerchantLandingURL>https://url.com/dummynow/success</dynamicMerchantLandingURL>
            <dynamicMerchantFailureUrl>https://url.com/dummynow/failure</dynamicMerchantFailureUrl>
            <merchantId>2854</merchantId>
         </InitiatePaymentDetailsRequest>
      </ns:InitiatePaymentDetails>
   </soap:Body>
</soap:Envelope>

0 个答案:

没有答案