0

こんにちは、Progress で作成された Web サービスがあり、php でクライアントを作成する必要があります。

クライアントを作成するために、この例を進行中に作成しました。

//connect 
CREATE SERVER hWebService.
hWebService:CONNECT("-WSDL'http://myip.com:8080/wsa/wsa1/wsdl?targetURI=urn:ws_hecam'").

 //create a handle

RUN ws_hecam SET hws_hecam ON hWebService.

  //execute the method

RUN p10wsCosLPa1 IN hws_hecam (input user, input password, input XMLin, output XMLout)

これは私がphpに持っているものです:

$client = new SoapClient(null, array('location' => "myip.com:8080/wsa/wsa1/wsdl/ws_hecam.wsm",
                                 'uri'      => "myip.com:8080/wsa/wsa1/wsdl?targetURI=urn:hecam"));

try{
   $client->__soapCall("p10wsCosLPa1", array("user", "password", "xml"), NULL,
                NULL, $output);
   print_r($output);

} catch(SoapFault $exception){
   print_r("Got issue: <br/>");
   var_dump($exception);
}

このエラーがあります:

Got issue:
object(SoapFault)#2 (9) { ["message":protected]=> string(25) 
"Could not connect to host" ["string":"Exception":private]=> string(0) ""
["code":protected]=> int(0) ["file":protected]=> string(41) "/var/www/telematel/ejecutarWebService.php" 
 ["line":protected]=> int(10) ["trace":"Exception":private]=> array(2) 
{ [0]=> array(4) { ["function"]=> string(11) "__doRequest" 
["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(5) { 
[0]=> string(652) " userpaswordxml " [1]=> string(69) "http://myip.com:8080/wsa/wsa1/wsdl/ws_hecam.wsm" 
 [2]=> string(89) "http://myip.com:8080/wsa/wsa1/wsdl?targetURI=urn:hecam#p10wsCosLPa1" 
[3]=> int(1) [4]=> int(0) } } [1]=> array(6) {
 ["file"]=> string(41) "/var/www/telematel/ejecutarWebService.php" 
 ["line"]=> int(10) ["function"]=> string(10) "__soapCall" 
 ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(5) {
 [0]=> string(12) "p10wsCosLPa1" [1]=> array(3) { [0]=> string(5) 
 "user" [1]=> string(7) "password" [2]=> string(3) "xml" } 
 [2]=> NULL [3]=> NULL [4]=> &array(0) { } } } } 
 ["previous":"Exception":private]=> NULL 
 ["faultstring"]=> string(25) "Could not connect to host" 
 ["faultcode"]=> string(4) "HTTP" } Array ( ) 

どうすればこれを解決できますか?

4

1 に答える 1

1

サービスが実行されていることを確認しましたか?

1) Progress バージョンは動作しますか? 次のようにローカル xml に回答を保存できます (ファイル名を選択した場所に置き換えます)。

XMLout:SAVE("FILE", "/tmp/localfile.xml", TRUE).

そのファイルを開きます。そこにいますか?それは何かを含んでいますか?そうであれば、サービスが稼働していることは確かです。そうしないと、サービスのトラブルシューティングを開始する必要があります。

2) 存在しないか空である場合 (空であってはなりません): コードの実行中にエラーが発生しましたか? もしそうなら、ここに投稿してください!エラーはなく、サービスは実行されているようです --> 問題は php 内 (またはその周辺) にあるはずです。互換性のないデータ形式に問題がある可能性があります。私は php に熟練していませんが、Google で「wsdl to php」または「wsdl Analyzer for php」をチェックして、正しいデータ形式であることを確認できるようにします。

于 2013-04-16T17:49:07.553 に答える