调用Magento服务返回错误“无法识别的消息版本”。

时间:2012-08-31 10:25:19

标签: c# wcf web-services magento

我正在尝试使用WCF调用Magento Web服务。但我一直收到以下错误信息。网络服务可以毫不费力地在Chrome中查看。

的app.config

 <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="Mage_Api_Model_Server_V2_HandlerBinding" maxReceivedMessageSize="999999" />


            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://xxx.co.uk/api/v2_soap?wsdl=1/"
                binding="basicHttpBinding" bindingConfiguration="Mage_Api_Model_Server_V2_HandlerBinding"
                contract="PoqService.Mage_Api_Model_Server_V2_HandlerPortType"
                name="Mage_Api_Model_Server_V2_HandlerPort" />
        </client>
    </system.serviceModel>




System.ServiceModel.CommunicationException was unhandled
  HResult=-2146233087
  Message=Unrecognized message version.
  Source=mscorlib
  StackTrace:
    Server stack trace: 
       at System.ServiceModel.Channels.ReceivedMessage.ReadStartEnvelope(XmlDictionaryReader reader)
       at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders, Boolean understoodHeadersModified)
       at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState)
       at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
       at System.ServiceModel.Channels.MessageEncoder.ReadMessage(Stream stream, BufferManager bufferManager, Int32 maxBufferSize, String contentType)
       at System.ServiceModel.Channels.HttpInput.ReadChunkedBufferedMessage(Stream inputStream)
       at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(HttpRequestMessage httpRequestMessage, Exception& requestException)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at pedlars.testing.PoqService.Mage_Api_Model_Server_V2_HandlerPortType.login(String username, String apiKey)
       at pedlars.testing.PoqService.Mage_Api_Model_Server_V2_HandlerPortTypeClient.login(String username, String apiKey) in c:\Users\j\Documents\Visual Studio 2012\Projects\pedlars.testing\pedlars.testing\Service References\PoqService\Reference.cs:line 28802
       at pedlars.testing.Program.Main(String[] args) in c:\Users\j\Documents\Visual Studio 2012\Projects\pedlars.testing\pedlars.testing\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

0 个答案:

没有答案