Receiving error:
a:InternalServiceFaultNo matching MessageFilter was found for the given Message.No matching MessageFilter was found for the given Message. at System.ServiceModel.Routing.MessageRpc.RouteToSingleEndpoint[TContract](RoutingConfiguration routingConfig) at System.ServiceModel.Routing.ProcessRequestAsyncResult`1..ctor(RoutingService service, Message message, AsyncCallback callback, Object state) at System.ServiceModel.Routing.RoutingService.BeginProcessRequest[TContract](Message message, AsyncCallback callback, Object state) at System.ServiceModel.Routing.RoutingService.System.ServiceModel.Routing.IRequestReplyRouter.BeginProcessRequest(Message message, AsyncCallback callback, Object state) at AsyncInvokeBeginBeginProcessRequest(Object , Object[] , AsyncCallback , Object ) at System.ServiceModel.Dispatcher.AsyncMethodInvoker.InvokeBegin(Object instance, Object[] inputs, AsyncCallback callback, Object state) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)System.InvalidOperationException
Code that is trying to make a soap/xml curl request:
$url = "https://domain.com/catalog";
$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL, $url );
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST, true );
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt($soap_do, CURLOPT_VERBOSE, TRUE);
curl_setopt($soap_do, CURLOPT_HTTPHEADER, array("Content-Type: text/xml", "SOAPAction: \"/soap/action/query\"", "Content-length: ".strlen($xmlRequest)));
$result = curl_exec($soap_do);
print_r($result);
This is my first attempt at using soap and I am not sure what I am doing wrong. The xml in the $xmlRequest variable is straight from the documentation provided with the three parts I needed to pass specific account details in, as seen below:
$xmlRequest = '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="https://domain.com/Gateway.svc/Catalog/2012/12" xmlns:ns1="https://domain.com/Gateway.svc/Catalog/2012/12">
<soapenv:Header/>
<soapenv:Body>
<ns:GetItemsBySourceCode>
<ns:catalogSourceCodeItemsRequest>
<ns1:Header>
<ns1:AccountAuth>
<!--Provide Service Credentials -->
<ns1:AccountId>accountid</ns1:AccountId>
<ns1:Password>password</ns1:Password>
</ns1:AccountAuth>
<ns1:Application>
<ns1:ApplicationIdentifier/>
<ns1:ClientIdentifier/>
<ns1:ProgramIdentifier/>
</ns1:Application>
<ns1:Parms>
<ns1:Parm>
<ns1:Name/>
<ns1:Value/>
</ns1:Parm>
</ns1:Parms>
<!--Not Required -->
<ns1:TransactionId/>
</ns1:Header>
<!--Optional End Date for Catalog Data Pull-->
<ns1:endDate/>
<ns1:sourceCode>SourceCodeHere</ns1:sourceCode>
<!--Optional Starting Date for Catalog Data Pull -->
<ns1:startDate/>
</ns:catalogSourceCodeItemsRequest>
</ns:GetItemsBySourceCode>
</soapenv:Body>
</soapenv:Envelope>';