Jump to content

SOAP @ Windows


Auntie Mangos

Recommended Posts

Hey guys,

Today I discovered what soap is, and how it should be used.

I enabled my SOAP on my testing server right away and ran the PHP script described here: http://getmangos.eu/community/showthread.php?12712-[9466]-MaNGOS-SOAP-services&highlight=soap

Now I am 100% sure my login information is 100% correct, although I get an error as output:

Command failed! Reason:
HTTP Error: 401 Unauthorized

This is my PHP code:

    $username = 'darkmessiah';
   $password = 'passwordhere';
   $host = "192.168.0.113";
   $soapport = 7878;
   $command = 'send items DarkMessiah "The Hungering Cold" "Hello DarkMessiah, here are your items. Have fun." 23577';

On MaNGOS Start it says:

MaNGOSspak: bound to [url]http://0.0.0.0:7878[/url]

Does anyone see what I am doing wrong?

Link to comment
Share on other sites

  • 40 years later...

hmm i have soap troubles too look and look only a few post on soap...

i get this error Fatal error: Class 'SoapClient' not found in

running it on win 2003

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="[url]http://www.w3.org/1999/xhtml[/url]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<?php
/*
* MaNGOSsoap client example
*
* a simple example how to invoke commands using SOAP
*/
$username = 'myusername';
$password = 'mypassword';
$host = "localhost";
$soapport = 7878;
$command = "server info";
$client = new SoapClient(NULL,
array(
"location" => "[url]http://$host:$soapport/[/url]",
"uri" => "urn:MaNGOS",
"style" => SOAP_RPC,
'login' => $username,
'password' => $password
));
try {
$result = $client->executeCommand(new SoapParam($command, "command"));
echo "Command succeeded! Output:
\\n";
echo $result;
}
catch (Exception $e)
{
echo "Command failed! Reason:
\\n";
echo $e->getMessage();
}
?>
<body>
</body>
</html>

Link to comment
Share on other sites

You need PHP version 5.0.1 or later, and it must be compiled using --enable-soap or by manually adding extension=php_soap.dll in your PHP.ini. If that all sounds like abracadabra to you, simply go here and download and install the binaries for PHP 5.3.

If you get an 'HTTP Error: 401 Unauthorized' error you are unauthorized. This means, surprisingly enough, authorization failed. Make sure you use a GM account of at least the level specified by RA.MinLevel (not entirely sure if this value is also used by the SOAP service, but can't hurt to be sure) and of course that your username and password are correct. Your username does not have to be in uppercase though.

Link to comment
Share on other sites

You need PHP version 5.0.1 or later, and it must be compiled using --enable-soap or by manually adding extension=php_soap.dll in your PHP.ini. If that all sounds like abracadabra to you, simply go here and download and install the binaries for PHP 5.3.

If you get an 'HTTP Error: 401 Unauthorized' error you are unauthorized. This means, surprisingly enough, authorization failed. Make sure you use a GM account of at least the level specified by RA.MinLevel (not entirely sure if this value is also used by the SOAP service, but can't hurt to be sure) and of course that your username and password are correct. Your username does not have to be in uppercase though.

I use XAMPP 1.7.3, with PHP 5.3.x so it should work. But still doesnt.

Link to comment
Share on other sites

  • 1 month later...

Hi!

Can you help me? If I access via localhost:7878 i get this:

 <?xml version="1.0" encoding="UTF-8" ?> 
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:ns1="urn:MaNGOS">
- <SOAP-ENV:Body>
- <SOAP-ENV:Fault>
 <faultcode>SOAP-ENV:Client</faultcode> 
 <faultstring>HTTP GET method not implemented</faultstring> 
 </SOAP-ENV:Fault>
 </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>

and with example.php

Fatal error: Class 'SoapClient' not found in C:\\AppServ\\www\\example.php on line 14

I'm using Appserv as webserver

# Apache 2.2.8

# PHP 5.2.6

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use