WCF Archives : Binary Bits https://blog.binarybits.net/tag/wcf/ Bits & Pieces - A blog by Kannan Balasubramanian Sat, 07 Sep 2013 04:58:47 +0000 en-GB hourly 1 https://wordpress.org/?v=6.5.3 WCF – The incoming message has an unexpected message format ‘Raw’ https://blog.binarybits.net/wcf-the-incoming-message-has-an-unexpected-message-format-raw/ https://blog.binarybits.net/wcf-the-incoming-message-has-an-unexpected-message-format-raw/#respond Sat, 07 Sep 2013 04:58:47 +0000 https://blog.binarybits.net/?p=550 I was testing out my own WCF REST Service using Fiddler and was getting error response “The incoming message has an unexpected message format ‘Raw'”. After spending time diagnosing the message the clue was, the WCF was getting a request with no content type. My contract was specifically expecting the request format to be XML […]

The post WCF – The incoming message has an unexpected message format ‘Raw’ appeared first on Binary Bits.

]]>
I was testing out my own WCF REST Service using Fiddler and was getting error response “The incoming message has an unexpected message format ‘Raw'”.

After spending time diagnosing the message the clue was, the WCF was getting a request with no content type.

My contract was specifically expecting the request format to be XML using the following attribute

RequestFormat = WebMessageFormat.Xml

Hence added the content type as “application/xml” and things went fine.

The following is an example of Fiddler’s request for a REST POST with composite data type

Type: POST
URL: http://localhost:1510/GalleryService.svc/RestService/GetDataUsingDataContract/
Protocol: HTTP/1.1

Request Header:

User-Agent: Fiddler
Host: localhost:1510
Content-Length: 198
Content-Type: application/xml

Request Body:

<CompositeType xmlns="http://schemas.datacontract.org/2004/07/Net.BinaryBits.Apps.BBGallery.WebService"><BoolValue>true</BoolValue><StringValue>String content</StringValue></CompositeType>

The post WCF – The incoming message has an unexpected message format ‘Raw’ appeared first on Binary Bits.

]]>
https://blog.binarybits.net/wcf-the-incoming-message-has-an-unexpected-message-format-raw/feed/ 0
Expose WCF 4.0 Service as SOAP and REST https://blog.binarybits.net/expose-wcf-4-0-service-as-soap-and-rest/ https://blog.binarybits.net/expose-wcf-4-0-service-as-soap-and-rest/#respond Sat, 07 Sep 2013 02:46:36 +0000 https://blog.binarybits.net/?p=547 During our course of developing applications we might come across number of scenarios. One of the scenarios might be creating a .NET web service which can be exposed as SOAP and REST. The following link explains with code on how to implement that. Expose WCF 4.0 Service as SOAP and REST

The post Expose WCF 4.0 Service as SOAP and REST appeared first on Binary Bits.

]]>
During our course of developing applications we might come across number of scenarios. One of the scenarios might be creating a .NET web service which can be exposed as SOAP and REST.

The following link explains with code on how to implement that.

Expose WCF 4.0 Service as SOAP and REST

The post Expose WCF 4.0 Service as SOAP and REST appeared first on Binary Bits.

]]>
https://blog.binarybits.net/expose-wcf-4-0-service-as-soap-and-rest/feed/ 0