你好我有一個webservice在Progress中創建,我需要在php中創建一個客戶端。執行一個正在創建的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 ()
我該如何解決這個問題?
您繼續編寫更多的代碼.. – dbf