如何让SoapUI请求在Web服务器上工作

时间:2013-08-21 22:27:17

标签: php soap soapui soap-client wsdl2code

我希望客户不必离开网站查看他们的跟踪信息:(换句话说,他们可以从我的网站跟踪他们的货件)http://www.echo.com/ShipmentTracking/EchoShipmentTrack.aspx

我收到了API文档,并且能够成功地使用SOAPUI测试远程API。我看到它有几个工具来为Java之类的东西生成代码。我找了一个SoapUI到PHP工具,但无法找到一个。我是PHP的新手,是否有人可以提供如何将此XML转换为可以在Web服务器上执行的代码的代码?

WSDL链接:http://api.echo.com/Echo.API.ShipmentStatus/ShipmentStatusService.svc?wsdl

SOAPUI生成的示例请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://api.echo.com/shipmentstatus/contracts/2012/02/" xmlns:ns1="http://api.echo.com/common/schemas/2012/02/" xmlns:ns2="http://api.echo.com/shipmentstatus/schemas/2012/02/">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:GetStatus>
          <ns:getStatusRequest>
             <ns1:UserCredentials>
                <ns1:APIKey>------REMOVED-----</ns1:APIKey>
            </ns1:UserCredentials>
             <ns2:BatchProcessingOptions>
                <ns1:NotificationOptions>
                  <ns1:NotifyByEmail>false</ns1:NotifyByEmail>
                  <ns1:NotifyEmail>dchol@echo.com</ns1:NotifyEmail>
               </ns1:NotificationOptions>
               <ns1:ShouldPartialProcessBatch>false</ns1:ShouldPartialProcessBatch>
               <ns2:CostResultFormat>DETAIL</ns2:CostResultFormat>
               <ns2:IncludeCostDetails>false</ns2:IncludeCostDetails>
               <ns2:StatusResultFormat>DETAIL</ns2:StatusResultFormat>
            </ns2:BatchProcessingOptions>
             <ns2:ShipmentIdentifiers>
                <ns1:ShipmentIdentifier>
          <ns1:ShipmentAccountNumber>E9704</ns1:ShipmentAccountNumber>
                  <ns1:ShipmentNumber>17596853</ns1:ShipmentNumber>
               </ns1:ShipmentIdentifier>
            </ns2:ShipmentIdentifiers>
         </ns:getStatusRequest>
      </ns:GetStatus>
   </soapenv:Body>
</soapenv:Envelope>

1 个答案:

答案 0 :(得分:1)

这个问题已经在stackoverflow上有了解决方案。 看看这个答案:

https://stackoverflow.com/a/10505172/2324993

https://stackoverflow.com/a/1656763/2324993