klaibert26 Posted September 2, 2009 Share Posted September 2, 2009 Hi i build a web service with .net http://ofir0803.somee.com/Service1.asmx and i am tryinn to call him with php http://ofir0803.200u.com/britannia/client.php but i keep getting a error: wsdl error: HTTP ERROR: Couldn't open socket connection to server http://www.ofir0803.somee.com/Service1.asmx?WSDL prior to connect(). This is often a problem looking up the host name. this is the client.php code: <?php require_once("../nusoap/nusoap.php"); $client = new nusoap_client("http://www.ofir0803.somee.com/Service1.asmx?WSDL", "wsdl",”, ”, ”, ”); $err = $client->getError(); if ($err) { echo "<h2>Constructor error</h2><pre>" . $err . "</pre>"; } $param = ""; $result = $client->call("functionName", $param, ”, ”, false, true); if ($client->fault) { echo "<h2>Fault</h2><pre>"; print_r($result); echo "</pre>"; } else { // Check for errors $err = $client->getError(); if ($err) { // Display the error echo "<h2>Error</h2><pre>" . $err . "</pre>"; } else { // Display the result echo "<h2>Result</h2><pre>"; print_r($result); echo "</pre>"; } } ?> For the past two days I try to solve this problem without any success. Please help Quote Link to comment Share on other sites More sharing options...
mystery_man Posted September 2, 2009 Share Posted September 2, 2009 Hi There I have also been having a problem trying to do exactly what you are doing. My problem is not that I cannot connect, but in passing the params, so my connection code is working. Check out my code, it might help you http://www.phpfreaks.com/forums/index.php/topic,267646.0.html Quote Link to comment Share on other sites More sharing options...
mystery_man Posted September 2, 2009 Share Posted September 2, 2009 Also, this might be helpfull: http://forums.devnetwork.net/viewtopic.php?f=1&t=102203&p=548118&hilit=nusoap&sid=dec6140f170c5bad8c646ad25a0be356#p548118 Quote Link to comment Share on other sites More sharing options...
user1 Posted September 18, 2009 Share Posted September 18, 2009 Maybe you want to try this code. <?php require 'SOAP/Client.php'; $soapoptions = array('namespace' => 'http://tempuri.org/', 'trace' => 0); $soapclient = new SOAP_Client( 'http://ofir0803.somee.com/Service1.asmx?WSDL'); //echo $soapclient->call('HelloWorld', array(), $soapoptions); //Alternative echo $soapclient->HelloWorld( array() ); echo $soapclient->faultstring; echo $soapclient->detail; if (PEAR::isError($soapclient)){ print("<br>An error #" . $soapclient->getCode() . " occurred!<br>"); print(" Error: " . $soapclient->getMessage() . "<br>\n"); } else{ print("\n<br><pre>"); print_r( $soapclient ); print("</pre><br>\n"); } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.