Jump to content
TrinityCore

problem using SOAP in 6.X


goruki
 Share

Recommended Posts

Hello people ! (First of all, sorry for my bad english ...)

I have few trouble with using SOAP in 6.2.4

I tried something like this : 

05.        $client = new SoapClient(NULL, array(
06.                'location'      => "http://127.0.0.1:7878/",
07.                'uri'           => 'urn:TC',
08.                'style'         => 'SOAP_RPC',
09.                'login'         => '[email protected]',
10.                'password'  => 'mypass'
11.        ));

12.        $client->executeCommand(new SoapParam('server info', 'command'));

 

It gives me an 401 error. 

Return looks like  :

PHP Fatal error:  Uncaught SoapFault exception: [SOAP-ENV:Client] HTTP Error: 401 Unauthorized in /var/www/html/SOAP/index.php:12
Stack trace:
#0 /var/www/html/SOAP/index.php(12): SoapClient->__call('executeCommand', Array)
#1 /var/www/html/SOAP/index.php(12): SoapClient->executeCommand(Object(SoapParam))

#2 {main}
  thrown in /var/www/html/SOAP/index.php on line 12

I already granted gmlevel 3 and activated SOAP in the worldserver.conf

 

Is login corresponding to the Email I created ? Or to the ID like 10#1 ? Or did I missed something else ? 

Thanks for answers and sorry for disturbing you ! :mellow:

 

Edit : I've already checked and it keeps returning errors. 

 

Edited by goruki
Link to comment
Share on other sites

It's give me a 403 with the ID :(

PHP Fatal error:  Uncaught SoapFault exception: [SOAP-ENV:Client] HTTP Error: 403 Forbidden in /var/www/html/SOAP/index.php:12
Stack trace:
#0 /var/www/html/SOAP/index.php(12): SoapClient->__call('executeCommand', Array)
#1 /var/www/html/SOAP/index.php(12): SoapClient->executeCommand(Object(SoapParam))
#2 {main}
  thrown in /var/www/html/SOAP/index.php on line 12

 

Edit : Is it possible that it's related to ports ? Even on localhost ? 

Edited by goruki
Link to comment
Share on other sites

-- UPDATE --

I've tried severals things ... 

For now here what I've got : 

An account 10#1 (I tried to connect with this account InGame, it worked, and I successfully created an account with bnet create account <email> <password>)

A client on GAMEBUILD 21742 

a SOAP module activated (I guess, because SOAP is returning errors)

  • php -i | grep -i soap

soap
Soap Client => enabled
Soap Server => enabled

soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400
 

  • Worldserver.conf

#    SOAP.Enable
SOAP.Enabled = 1
#    SOAP.IP
#        Description: Bind SOAP service to IP/hostname.
SOAP.IP = "127.0.0.1"
#    SOAP.Port
#        Description: TCP port to reach the SOAP service.
SOAP.Port = 7878
 

  • Account Access

id     gmlevel      RealmID

10    3               -1

I even tried this : 

  • rbac_account_permissions
  1. accountId                    permissionId              granted              realmId

9                                             207                             1                        -1 

9                                             208                             1                        -1

 9                                            219                             1                        -1

 9                                            228                             1                        -1

 9                                           196                              1                        -1

(The account is 10#1 but has the ID 9)

And it keep returning me a 403 error ...

So here's my questions : 

  1. What did I do wrong ? 
  2. Is it possible that my Core Version has SOAP bugged ? If yes, how can I clone the last version of Trinity Core that worked with the GAMEBUILD 21742 ?

(I don't want to upgrade my client to 7.X, I prefer staying at 6.2.4 if it's possible ...)

Edited by goruki
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By elandris
      I am attempting to allow a php script to connect remotely to soap, but soap does not seem to be listening on the default port 7878. I've attempted to change the port to see if any changes occur and do not see any results. Trinity Core is installed on Windows 7 pro. I've used an elevated CMD netstat -a -b and cannot see the specified port listed. I have enabled soap and RA in the config file. Any ideas on where i can look? 
      Soap Connection issue.pdf
      Soap Connection issue
      Soap Connection Issue.pcapng
       
       
    • By lalalastab
      I've been trying to implement my own simple cms solution without php, but can't figure out the formatting of the SOAP requests. I was wondering if anyone was able to explain where I can find the wsdl schema? Googling only really gives results for php...
      edit2 solved after 2 days. feel free to close. code was updated with correct structure. make sure to set basic authentication headers in your request.
      <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:TC">
          <SOAP-ENV:Header>
          </SOAP-ENV:Header>
          <SOAP-ENV:Body>
               <ns1:executeCommand>
                   <command>server info</command>
               </ns1:executeCommand>
          </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      The code is enough to get to the authorization stage but I'm not sure how to log in.
      Thanks!
×
×
  • Create New...