Consuming a .net web service with php code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ofir0803
Forum Newbie
Posts: 22
Joined: Sun Jan 18, 2009 3:03 pm

Consuming a .net web service with php code

Post by ofir0803 »

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:

Code: Select all

<?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 :banghead:
Post Reply