I am completely and utterly stuck on this. I have tried about 20 different examples but nothing works.
I simply want to send an XML message to a web service and receive its response.
(1) The url is europaytest.smart2pay.com/MerchantService.asmx. But, does it need ?wsdl on the end?? It could be europaytest.smart2pay.com/MerchantService.asmx?wsdl ??
(2) I need to send XML to the above url using ‘SubmitRequest’ as the ‘action’ value.
I would have thought this would do it:
$client = new SoapClient("https://europaytest.smart2pay.com/MerchantService.asmx?wsdl");
$response = $client->__doRequest($xml, "https://europaytest.smart2pay.com/MerchantService.asmx", "SubmitRequest", 1.1);
But it returns with this XML response message:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: SubmitRequest.
at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>