2014-11-03 38 views
0

我用MTOM編碼獲得了一個正在運行的WCF服務。我自己的c#客戶端可以使用此服務而不會出現問題。WCF:使用SoapUI Content-Id的MTOM找不到

當我嘗試發送通過SOAP UI請求我得到的消息:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Body> 
    <s:Fault> 
     <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> 
     <faultstring xml:lang="de-DE">MIME part with Content-ID 'cid:123456' not found.</faultstring> 
     <detail> 
     <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> 
      <HelpLink i:nil="true"/> 
      <InnerException i:nil="true"/> 
      <Message>MIME part with Content-ID 'cid:123456' not found.</Message> 
      <StackTrace>at System.Xml.XmlMtomReader.ReadMimePart(String uri) 
    at System.Xml.XmlMtomReader.Read() 
    at System.Xml.XmlDictionaryWriter.WriteNode(XmlDictionaryReader reader, Boolean defattr) 
    at System.ServiceModel.Channels.ReceivedMessage.OnWriteBodyContents(XmlDictionaryWriter writer) 
    at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer) 
    at System.ServiceModel.Channels.Message.OnCreateBufferedCopy(Int32 maxBufferSize, XmlDictionaryReaderQuotas quotas) 
    at System.ServiceModel.Channels.Message.CreateBufferedCopy(Int32 maxBufferSize) 
    at VAMS.Web.FE.Inspector.ValidXmlMessageInspector.AfterReceiveRequest(Message&amp; request, IClientChannel channel, InstanceContext instanceContext) in ValidXmlMessageInspector.cs:line 63 
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.AfterReceiveRequestCore(MessageRpc&amp; rpc) 
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc) 
    at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> 
      <Type>System.Xml.XmlException</Type> 
     </ExceptionDetail> 
     </detail> 
    </s:Fault> 
    </s:Body> 
</s:Envelope> 

有什麼建議?

回答

0

它沒有WCF問題:

SOAPUI自動爲您的附件生成一個ContentID。 但你不需要這個。只要刪除內容識別和一切工作正常

格爾茨Skary

2

確保請求中使用內容ID(CID :)是相同的附件列表元素的內容識別。

了SoapUI請求樣本: SoapUI request sample

+0

謝謝!我不知道如何鏈接它們 – yngrdyn 2016-10-05 20:03:45