私はすべてのSOAP/WSDLに非常に新しいので、何か非常に基本的なものか正しい技術用語を使用しないものかを尋ねる必要があります。もしそうなら、私を許してください。WSDL操作の入力パラメータの正しい形式を決定する方法
私は同僚からWSDLのURLを提供されました。このWebサービスは、nuSOAPライブラリを使用して呼び出す必要があります。
彼はまた私に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>
をどうするか見当もつかない、私はそれは、「操作」とは何かを持っていることが判明し、入力パラメータ。だから私はこのようになりますコードの一部を構築:私はこのコードを実行すると
$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:
)
)
)
を得るこれは私が私が正しい形式で入力を提供していないよ信じています予想される形式が何であるかを判断することはできません。この点に関する助け?
EDIT:それは助けている場合、次は私がブラウザ
<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>
soapUIは、コードを書くことなくサービスをテストできるようにする非常に優れた無料のツールです(それ以上のことはあります)。ダウンロードしたら、WSDLのURLを指定して新しいプロジェクトを開始します。それはあなたの要求に置き換えることができるデフォルトの要求を作成します。要求を送信し、応答を調べます。応答が受け入れ可能な場合、要求が良好であることがわかります。そうでない場合、あなたの回答は正しい形式ではありません。 – MikeC
マイクCの提案に感謝します。最初はsoapUIを使っていましたが、私は応答を得ていました。だからサービスはいいです。私がよく分からないことは、入力をサービスに渡す必要がある形式です – asprin