Page 1 of 1

SOAP and WSDL

Posted: Fri Oct 28, 2011 11:16 am
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?

Re: SOAP and WSDL

Posted: Mon Oct 31, 2011 3:30 am
by shiznatix
*bump*

Re: SOAP and WSDL

Posted: Mon Oct 31, 2011 9:17 am
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)