NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Unsupported HTTP response status 405 Method Not Allowed


Joined: 15 Dec 2007
Posts: 3
Reply with quote
Hello,

I am trying to get my first webservice online, but it doesnt work. I followed a lot of tutorials, but nothing seems to work.
I get the strange error: HTTP Error: Unsupported HTTP response status 405 Method Not Allowed (soapclient->response has contents of the response)

I dont know how to solve it, does somebody know what is wrong with my code??

Thanx in advance!


This is my client php code:
Code:
<?php
// Pull in the NuSOAP code
require_once('nusoap.php');
// Create the client instance
$client = new soapclient('http://www.gcaatest.nl/soap/HelloWorld.wsdl');
// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
}
// Call the SOAP method
$result = $client->call("answer", array("parameters" => "test"));
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>';
    }
}
// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
// Display the debug messages
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>
View user's profileFind all posts by nktSend private message


Joined: 16 Dec 2007
Posts: 5
Reply with quote
not sure if this will work but you can give it a shot,

replace
Code:

$client = new soapclient('http://www.gcaatest.nl/soap/HelloWorld.wsdl');


with
Code:

$client = new nusoap_client('http://www.gcaatest.nl/soap/HelloWorld.wsdl');


also the response headers from the wsdl location is set to
-->Content-Type: text/plain

I think it might need to be set to
-->Content-Type: text/xml

might also need to define $parameters array

Just my .02 cents Smile
View user's profileFind all posts by trini00Send private message
Unsupported HTTP response status 405 Method Not Allowed
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic