SOAP and WSDL

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
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

SOAP and WSDL

Post by shiznatix »

Hi,

So I am trying to get a SOAP server I setup to work with some crazy people who need crazy things. Anyway, I have a WSDL file which you can find here: http://binary.admiralmarkets.com/api/wsdl.xml.

I am invoking my server like this:

Code: Select all

$soapServer = new SoapServer(
	null,
	array(
		'uri' => 'http://binary.admiralmarkets.com/api/wsdl.xml',
	)
);

$soapServer->addFunction('CheckTraderBalance');
$soapServer->addFunction('TakeTraderBalance');
$soapServer->addFunction('GiveTraderBalance');
$soapServer->handle();
Now, I know you might ask "Why isn't he putting the wsdl file as the first param??". The reason is, if I do that then the response from the server doesn't actually have what was returned from each function, just a blank tag.

But anyway, with the setup I have now I am getting a response like this:
<SOAP-ENV:Body>
<ns1:CheckTraderBalanceResponse>
<return xsi:type='xsd:boolean'>
true
</return>
</ns1:CheckTraderBalanceResponse>
</SOAP-ENV:Body>
Which would be awesome but sadly isn't working for the other people. What I need to do is get a response like this:
<ns1:CheckTraderBalanceResponse>
<ns1:CheckTraderBalanceResult xsi:type='xsd:boolean'>
true
</ns1:CheckTraderBalanceResult>
</ns1:CheckTraderBalanceResponse>
You can notice the difference there, slight but existing. I myself don't really know much about these SOAP servers and whatnot but for all the things i have read through I can not figure out a way to get the proper return envelope working. Maybe someone here can help me out?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Re: SOAP and WSDL

Post by shiznatix »

*bump*
User avatar
egg82
Forum Contributor
Posts: 156
Joined: Sat Oct 01, 2011 9:29 pm
Location: Colorado, USA

Re: SOAP and WSDL

Post by egg82 »

everywhere I look, everyone's talking about SOAP nowadays, but nobody seems to want to explain what it is and what it does (including php.net)
Post Reply