drdyf42880 2014-06-09 21:53
浏览 51

在制作php curl soap请求时收到错误

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>';
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题