.NET Framework Bookmark and Share   
 index > Windows Communication Foundation > Contract problem deserializing MTOM webservice communication
 

Contract problem deserializing MTOM webservice communication

Hi all,

I am having a problem. It is in deserializing a Mime document. The error I am getting is"The data at the root level is invalid."

The reply coming in on the wire looks like this�/span>

<body>

<RetrieveImageResponse>

<ScanData>

<xop:Include Href =”cid:1@body�gt;</xop:include>

</ScanData>

</RetrieveImageResponse>

</body>

�93c23400-1dd2-11b2-8d4e-e93374a1c48e
Content-Type: image/jfif
Content-Transfer-Encoding: binary
Content-ID: <1@body>
{my binary data}

Myservice contract looks like this ...


ServiceContract]
[
XmlSerializerFormat]
public interface IHTTPContract
//RetrieveImageRequest

[

[OperationContract(Action = StringConst.WSDScanNamespace + "/RetrieveImage",
StringConst.WSDScanNamespace + "/RetrieveImageResponse")]
RetrieveImageResponseMessage RetrieveImage(RetrieveImageRequest IMGRequestObject);




My current Message Contract looks as follows

[MessageContract(IsWrapped = false)]

public class RetrieveImageResponseMessage

{

[MessageBodyMember(Name = "RetrieveImageResponse", Namespace = StringConst.WSDScanNamespace)]

public RetrieveImageResponseType RetrieveImageResponse;

}

[XmlRoot("RetrieveImageResponse", Namespace = StringConst.WSDScanNamespace)]

public class RetrieveImageResponsetype

{

[XmlElement("ScanData")]

public byte[] ScanData;

[XmlAnyElement]

public XmlElement[] AnyElements;

[XmlAnyAttributeAttribute()]

public XmlAttribute[] AnyAttributes;

}

I have rearanged this many different ways. I have used DataContracts. I have tried several combinations. All to no avail.


I can and have trapped the buffer lower in the stack and can deserialize the buffer my self so the data is there. WCF just has a problem with my message contract.

I need the Content-Type And the binary data. Any ideas?

Eric

E Schlosser
eSchlosser
Everyone,

This issue turned out it was a FW defect from the scanner, not creating the mime boundry delimiter correctly.


My Thanks to everyone for there thoughts,


Eric
E Schlosser
  • Marked As Answer byeSchlosser 10 hours 23 minutes ago
  •  
eSchlosser
Everyone,

This issue turned out it was a FW defect from the scanner, not creating the mime boundry delimiter correctly.


My Thanks to everyone for there thoughts,


Eric
E Schlosser
  • Marked As Answer byeSchlosser 10 hours 23 minutes ago
  •  
eSchlosser

You can use google to search for other answers

Custom Search

More Threads

• DataContract serializer and static members
• Relative endpoint addresses on the client
• WCF Client in Session State
• Asyncpattern and instances
• Unresponsive NetworkStream.Read
• WPF (XBAP) & WCF - any chance to use UserCredential Token?
• Login failed for user 'sa' when trying to connect to remote database through WCF service
• Error when creating a net.tcp endpoint in wcf
• Error: Retrieving the COM class factory in WCF
• How to set message priority (message odering) with WCF NetMSMQ binding