Neil Thompson
asked on
Created a SOAP server (newbie) but need to call it with XML not string params? help please
Hi
I'm ok with PHP and have just been asked to create a Web Service so one of our 3rd party suppliers can use our payments system. I've got all the info I need working once I have the data they want passed but I have no idea how my SOAP server should go about getting their XML
The examples I've used to learn pass parameters in as strings such as this example...
<?php
//client-test.php
ini_set("soap.wsdl_cache_e nabled", "0"); // disabling WSDL cache
$client = new SoapClient("http://..../payments.wsdl");
$return = $client->makePayment('12.3 5');
?>
... but the company that wants to use our payments engine want to pass an XML document in something like...
<xml>
<request>
<reference>12345678</refer ence>
<cardNumber>12341234567856 78</cardNu mber>
<endDate>1109</endDate>
<amount>12.51</amount>
</request>
</xml>
... how would I go about that please? Would it simply be down to passing as simple xml in the 'makePaymentFunctions.php' page then doing what I want with it? If so how would I add it to the stub of client-test.php : $return = $client->makePayment(????? ??);
Many thanks
Neil
I'm ok with PHP and have just been asked to create a Web Service so one of our 3rd party suppliers can use our payments system. I've got all the info I need working once I have the data they want passed but I have no idea how my SOAP server should go about getting their XML
The examples I've used to learn pass parameters in as strings such as this example...
<?php
//client-test.php
ini_set("soap.wsdl_cache_e
$client = new SoapClient("http://..../payments.wsdl");
$return = $client->makePayment('12.3
?>
... but the company that wants to use our payments engine want to pass an XML document in something like...
<xml>
<request>
<reference>12345678</refer
<cardNumber>12341234567856
<endDate>1109</endDate>
<amount>12.51</amount>
</request>
</xml>
... how would I go about that please? Would it simply be down to passing as simple xml in the 'makePaymentFunctions.php'
Many thanks
Neil
<?php
//server.php
require 'makePaymentFunctions.php';
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
$server = new SoapServer("payments.wsdl");
$server->addFunction("makePayment");
$server->handle();
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.