Php 如何确定WSDL操作输入参数的正确格式

Php 如何确定WSDL操作输入参数的正确格式,php,web-services,wsdl,Php,Web Services,Wsdl,我对所有的SOAP/WSDL都非常陌生,所以我必须问一些非常基本的问题,或者没有使用正确的技术术语。如果是这样的话,请原谅 一位同事向我提供了一个WSDL url,我需要使用nuSOAP库调用该Web服务 他还给了我一个XML——我不知道该怎么处理它 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/s

我对所有的SOAP/WSDL都非常陌生,所以我必须问一些非常基本的问题,或者没有使用正确的技术术语。如果是这样的话,请原谅

一位同事向我提供了一个WSDL url,我需要使用nuSOAP库调用该Web服务

他还给了我一个XML——我不知道该怎么处理它

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://oracle.com/determinations/server/12.2.1/rulebase/assess/types">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:assess-request>
         <typ:global-instance>
            <!--Zero or more repetitions:-->
             <typ:attribute id="transaction_Amount" outcome-style="value-only"/>
             <typ:attribute id="line_Items" outcome-style="value-only"/>
             <typ:attribute id="requred_Documents" outcome-style="value-only"/>
            <typ:attribute id="transaction_Type">
               <!--You have a CHOICE of the next 8 items at this level-->
               <typ:text-val>Address Change</typ:text-val>
            </typ:attribute>
            <!--Zero or more repetitions:-->

         </typ:global-instance>
      </typ:assess-request>
   </soapenv:Body>
</soapenv:Envelope>
这使我相信我没有以正确的格式提供输入,但无法确定预期的格式。这方面有什么帮助吗

编辑:如果有帮助,下面是在浏览器中打开$url时显示的WSDL的一部分




评估请求包含可选的配置节点和必需的全局实例节点。
控制如何处理提供给评估操作的数据以及如何构建响应的选项。
使用部署在服务URL上的策略模型,输入要对其执行评估的数据

你说的“这让我相信我没有以正确的格式提供输入”让我很反感。此时您需要的是一个使用nuSOAP和PHP的教程。所以很可能不是这样的地方。更像或

soapUI是一个非常好的免费工具,它允许您在不编写任何代码的情况下测试服务(它做的更多)。下载后,通过指定WSDL URL启动一个新项目。它将创建一个默认请求,您可以将其替换为您的请求。发送请求,检查响应。如果回答是可以接受的,你就知道你的要求是好的。如果没有,您的答复格式不正确。感谢MikeC的建议。最初我确实使用了soapUI,我得到了回应。所以服务很好。我不确定的是输入需要传递给服务的格式
$client = new nusoap_client($url, "wsdl");
$error  = $client->getError();       
// I do not see the below message so I assume the connection was a success
if ($error) {
    echo "<h2>Constructor error</h2><pre>" . $error . "</pre>";
}
$params = array(
    'global-instance' => "attribute"
);

$result = $client->call("Assess", array("assess-request"=>$params));
if ($client->fault) {
  echo "<h2>Fault</h2><pre>";
  print_r($result);
  echo "</pre>";
} else {
  $error = $client->getError();
  if ($error) {
    echo "<h2>Error</h2><pre>" . $error . "</pre>";
  } else {
    echo "<h2>Main</h2>";
    echo '<pre>';
    print_r($result);
    echo '</pre>';
  }
}
Array
(
    [faultcode] => SOAP-ENV:Client
    [faultstring] => Invalid element. Expected: global-instance. Actual: 
    [detail] => Array
        (
            [error-response] => Array
                (
                    [code] => com.oracle.determinations.server.exceptions.InvalidRequestException
                    [message] => Invalid element. Expected: global-instance. Actual: 
                )

        )

)
<wsdl:operation name="Assess">
   <wsdl:input message="typ:AssessRequest"/>
   <wsdl:output message="typ:AssessResponse"/>
</wsdl:operation>
<xsd:complexType name="AssessRequest">
  <xsd:annotation>
    <xsd:documentation>An assess-request contains an optional config node and a mandatory global-instance node.</xsd:documentation>
  </xsd:annotation>
  <xsd:sequence>
    <xsd:element name="config" type="AssessmentConfiguration" minOccurs="0">
      <xsd:annotation>
        <xsd:documentation>Options that control how the data provided to the assess operation should be processed, and how the response should be constructed.</xsd:documentation>
      </xsd:annotation>
    </xsd:element>
    <xsd:element name="global-instance" type="GlobalInstanceType">
      <xsd:annotation>
        <xsd:documentation>Input data on which to perform the assessment, using the policy model deployed at the service URL</xsd:documentation>
      </xsd:annotation>
    </xsd:element>
  </xsd:sequence>
</xsd:complexType>