Hi all
I have been tasked with a project that requires the use of web services and despite many hours of google-ing I am no near to understanding this skill.
The broad outline is to create an xml file which must be sent to a URL and I should then receive a response.
The xml file from the specification is:
<debitorder>
<header>
<merchantno>AB99999</merchantno>
<totaltransactions>3</totaltransactions>
<firstactiondate>080418</firstactiondate>
<lastactiondate>080418</lastactiondate>
<merchantcellnotify>083 999 9999</merchantcellnotify>
<merchantemailnotify>mark@kccs.co.za</merchantemailnotify>
</header>
<transaction>
<sequenceno>1</sequenceno>
<branchcode>123456</branchcode>
<accounttype>7</accounttype>
<accountno>30001245</accountno>
<debitamount>100.25</debitamount>
<debitdate>080418</debitdate>
<debitreference>ref</debitreference>
<accountholder></accountholder>
<debitcellnotify></debitcellnotify>
<debitemailnotify></debitemailnotify>
</transaction>
<footer>
<totaltransactions>3</totaltransactions>
<firstactiondate>080418</firstactiondate>
<lastactiondate>080418</lastactiondate>
<debittotal>2716.41</debittotal>
</footer>
</debitorder>
<debitorder>
<header>
<merchantno>AB99999</merchantno>
<totaltransactions>3</totaltransactions>
<firstactiondate>080418</firstactiondate>
<lastactiondate>080418</lastactiondate>
<merchantcellnotify>083 999 9999</merchantcellnotify>
<merchantemailnotify>mark@kccs.co.za</merchantemailnotify>
</header>
<transaction>
<sequenceno>1</sequenceno>
<branchcode>123456</branchcode>
<accounttype>7</accounttype>
<accountno>30001245</accountno>
<debitamount>100.25</debitamount>
<debitdate>080418</debitdate>
<debitreference>ref</debitreference>
<accountholder></accountholder>
<debitcellnotify></debitcellnotify>
<debitemailnotify></debitemailnotify>
</transaction>
<transaction>
<sequenceno>2</sequenceno>
<branchcode>987654</branchcode>
<accounttype>7</accounttype>
<accountno>40001245</accountno>
<debitamount>99.99</debitamount>
<debitdate>080418</debitdate>
<debitreference>ref</debitreference>
<accountholder></accountholder>
<debitcellnotify></debitcellnotify>
<debitemailnotify></debitemailnotify>
</transaction>
<transaction>
<sequenceno>3</sequenceno>
<branchcode>456321</branchcode>
<accounttype>7</accounttype>
<accountno>50001245</accountno>
<debitamount>2516.17</debitamount>
<debitdate>080418</debitdate>
<debitreference>ref</debitreference>
<accountholder></accountholder>
<debitcellnotify></debitcellnotify>
<debitemailnotify></debitemailnotify>
</transaction>
<footer>
<totaltransactions>3</totaltransactions>
<firstactiondate>080418</firstactiondate>
<lastactiondate>080418</lastactiondate>
<debittotal>2716.41</debittotal>
</footer>
</debitorder>
If I browse to the URL i get:
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://includes.debitorders2" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://includes.debitorders2" xmlns:intf="http://includes.debitorders2" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://rpc.xml.coldfusion" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!-- WSDL created by ColdFusion version 8,0,0,176276
-->
- <wsdl:types>
- <schema targetNamespace="http://rpc.xml.coldfusion" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="CFCInvocationException">
<sequence />
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="releaseDebitFileRequest">
<wsdl:part name="releaseXML" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="CFCInvocationException">
<wsdl:part name="fault" type="tns1:CFCInvocationException" />
</wsdl:message>
- <wsdl:message name="releaseDebitFileResponse">
<wsdl:part name="releaseDebitFileReturn" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="uploadDebitFileResponse">
<wsdl:part name="uploadDebitFileReturn" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="uploadDebitFileRequest">
<wsdl:part name="debitOrderXML" type="xsd:string" />
</wsdl:message>
- <wsdl:portType name="MyGate_DebitOrder_WebService">
- <wsdl:operation name="uploadDebitFile" parameterOrder="debitOrderXML">
<wsdl:input message="impl:uploadDebitFileRequest" name="uploadDebitFileRequest" />
<wsdl:output message="impl:uploadDebitFileResponse" name="uploadDebitFileResponse" />
<wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException" />
</wsdl:operation>
- <wsdl:operation name="releaseDebitFile" parameterOrder="releaseXML">
<wsdl:input message="impl:releaseDebitFileRequest" name="releaseDebitFileRequest" />
<wsdl:output message="impl:releaseDebitFileResponse" name="releaseDebitFileResponse" />
<wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="MyGate_DebitOrder_WebService.cfcSoapBinding" type="impl:MyGate_DebitOrder_WebService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="uploadDebitFile">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="uploadDebitFileRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://includes.debitorders2" use="encoded" />
</wsdl:input>
- <wsdl:output name="uploadDebitFileResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://includes.debitorders2" use="encoded" />
</wsdl:output>
- <wsdl:fault name="CFCInvocationException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException" namespace="http://includes.debitorders2" use="encoded" />
</wsdl:fault>
</wsdl:operation>
- <wsdl:operation name="releaseDebitFile">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="releaseDebitFileRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://includes.debitorders2" use="encoded" />
</wsdl:input>
- <wsdl:output name="releaseDebitFileResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://includes.debitorders2" use="encoded" />
</wsdl:output>
- <wsdl:fault name="CFCInvocationException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException" namespace="http://includes.debitorders2" use="encoded" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="MyGate_DebitOrder_WebServiceService">
- <wsdl:port binding="impl:MyGate_DebitOrder_WebService.cfcSoapBinding" name="MyGate_DebitOrder_WebService.cfc">
<wsdlsoap:address location="https://www.mygate.co.za/debitorders2/includes/MyGate_DebitOrder_WebService.cfc" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I would greatly appreciate any pointers as I seem to have got nowhere so far.
I have been testing with NuSoap and the best I have been able to achieve is:
require('../lib/nusoap.php');
$c = new nusoap_client('https://www.mygate.co.za/debitorders2/includes/MyGate_DebitOrder_WebService.cfc?wsdl');
$stockprice = $c->call('releaseDebitFileRequest">',
array('releaseXML' => true));
foreach($stockprice as $key=>$val) {
echo $val;
echo '<br>';
}
Many thanks