如何在SOAP请求中解析/执行方法?

时间:2016-11-22 07:55:44

标签: php web-services soap wsdl soap-client

我正在进行下面给出的SOAP调用。在这里,我只是想了解它是如何解析/执行被调用的方法。

<?php  
$URL = '<URL>';
$Client_Options = array('exceptions' => true,'trace' => true);
$executionTime = 120;

$Id = 1212121212;
$TEMP_DIR = 'C:\data';
$aggrName = 'ággr_01_02';
$userInputs = array(...);    

$client = new UTP_SoapClientTimeout($URL, $Client_Options);
$client = new UTP_SoapClientTimeout($RULES_ENGINE_WEB_SERVICE,    $Client_Options);
$client->__setTimeout(intval($executionTime));

$params = array(
                'Id'     => $Id,
                'tagName'    => $rule_tag,
                'fileName'   => $TEMP_DIR."\". $Id, 
                'dataType'   => 'XML',
                'aggrName'   => $aggrName,
                'userInputs' => $userInputs

        );

        $phpobj = $client->executeRATag($params);
?>

在创建SOAP客户端对象之后的上述代码中,我们使用上述参数调用方法'executeRATag'。

请参阅下面的SOAP WSDL:

<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at  http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-b02-. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-b02-. --><definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://engine.service.ruleengine.spiice.netapp.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://engine.service.ruleengine.spiice.netapp.com/" name="RAAnalysisWebService">
<types>
<xsd:schema>
  <xsd:import namespace="http://engine.service.ruleengine.spiice.netapp.com/" schemaLocation="http://vmwnraapp01-prd.corp.netapp.com:8080/rule-engine-webapp-1.2/ra_analysis_engine?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="executeRATemplate">
 <part name="parameters" element="tns:executeRATemplate"></part>
</message>
<message name="executeRATemplateResponse">
 <part name="parameters" element="tns:executeRATemplateResponse"></part>
</message>
<message name="executeRATag">
 <part name="parameters" element="tns:executeRATag"></part>
</message>
<message name="executeRATagResponse">
 <part name="parameters" element="tns:executeRATagResponse"></part>
</message>
<message name="executeRARule">
 <part name="parameters" element="tns:executeRARule"></part>
</message>
<message name="executeRARuleResponse">
 <part name="parameters" element="tns:executeRARuleResponse"></part>
</message>
<portType name="RAAnalysisWS">
 <operation name="executeRATemplate">
   <input message="tns:executeRATemplate"></input>
   <output message="tns:executeRATemplateResponse"></output>
 </operation>
 <operation name="executeRATag">
   <input message="tns:executeRATag"></input>
   <output message="tns:executeRATagResponse"></output>
 </operation>
 <operation name="executeRARule">
   <input message="tns:executeRARule"></input>
   <output message="tns:executeRARuleResponse"></output>
 </operation>
</portType>
<binding name="RAAnalysisWSPortBinding" type="tns:RAAnalysisWS">
 <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
  <operation name="executeRATemplate">
   <soap:operation soapAction=""></soap:operation>
    <input>
     <soap:body use="literal"></soap:body>
    </input>
    <output>
     <soap:body use="literal"></soap:body>
    </output>
  </operation>
  <operation name="executeRATag">
   <soap:operation soapAction=""></soap:operation>
    <input>
     <soap:body use="literal"></soap:body>
    </input>
    <output>
     <soap:body use="literal"></soap:body>
    </output>
  </operation>
  <operation name="executeRARule">
    <soap:operation soapAction=""></soap:operation>
    <input>
     <soap:body use="literal"></soap:body>
    </input>
   <output>
     <soap:body use="literal"></soap:body>
   </output>
  </operation>
 </binding>
 <service name="RAAnalysisWebService">
   <port name="RAAnalysisWSPort" binding="tns:RAAnalysisWSPortBinding">
   <soap:address location="http://vmwnraapp01-prd.corp.netapp.com:8080/rule-engine-webapp-1.2/ra_analysis_engine"></soap:address>
 </port>
 </service>
</definitions>

这里的问题是,当我们调用方法'executeRATag'时,如何从上面的XML中解析它。请解释执行流程。

1 个答案:

答案 0 :(得分:0)

https://www.w3.org/TR/soap的SOAP规范中描述了SOAP如何工作以及客户端库应如何实现解析的定义。

对于您的特定客户端库,我们无法告诉您确切的执行流程,只能告诉您应该如何执行(如规范中所示)。