1
フォームを取得してID検索を行い、PHP経由でWSDL呼び出しからの応答を解析するのに問題があります。 BLZ固有IDが10000000の場合、そのBLZ固有IDに対応する名前はBundesbankです。ここでWSDLからの応答を投稿するPHPを取得しようとしています
はHTML部分である:ここで
<html>
<head>
<body>
<form name="myForm" id="frm1" action="idresponse.php" method="POST">
<input name="userID" placeholder="Enter ID">
<input type="Submit"></b>
</form>
<b></b>
<input name="responseID" id="frm2" placeholder="ID response from WSDL call"></input>
</body>
</head>
</html>
は、PHPの部分である:
<?php
$soapClient = new SoapClient("http://www.thomas-bayer.com/axis2/services/BLZService?wsdl",array("trace" => 1));
$blz_param = array (
'blz' => "10000000",
);
$info = $soapClient->__call("CheckSomething", array($service_param));
echo "Request :\n".htmlspecialchars($soapClient->__getLastRequest()) ."\n";
?>
使用事例:
-User enters 10000000 into BLZ number field box.
-Code takes BLZ number and does a request and lookup from WSDL url.
-Response from WSDL url sends name of banking institution from BLZ number 10000000.
-From BLZ number 10000000, bank name should be Bundesbank.
WSDLのURL:
http://www.thomas-bayer.com/axis2/services/BLZService?wsdl
(SOAPUIからマッピングされた)
INPUTのWSDL:(SOAPUIからマッピングされた)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:blz="http://thomas-bayer.com/blz/">
<soapenv:Header/>
<soapenv:Body>
<blz:getBank>
<blz:blz>10000000</blz:blz>
</blz:getBank>
</soapenv:Body>
</soapenv:Envelope>
OUTPUTのWSDL:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:getBankResponse xmlns:ns1="http://thomas-bayer.com/blz/">
<ns1:details>
<ns1:bezeichnung>Bundesbank</ns1:bezeichnung>
<ns1:bic>MARKDEF1100</ns1:bic>
<ns1:ort>Berlin</ns1:ort>
<ns1:plz>10591</ns1:plz>
</ns1:details>
</ns1:getBankResponse>
</soapenv:Body>
</soapenv:Envelope>