Custom Message Encoder for WCF Rest web service

Cancelled Posted Oct 5, 2010 Paid on delivery
Cancelled Paid on delivery

We receive XML posts to our WCF REST web service (ASP.NET, C#) and sometimes the text for some of the elements may contain an ampersand. We suggested to the company that is submitting the posts that they enclose the text in CDATA sections to avoid the parsing error that results when there is an ampersand in the text, but they have reasons for not changing their application.

It appears that the only option is to define a custom binding, based on a custom message encoder, which fixes the incoming stream before passing it through the XmlDictionaryReader bus. Optimally the fix would be to change the literal ampersand to &amp.

Another developer has developed a custom message encoder for our REST service, but is not sure how to get it to work. I can provide this code.

I came across this article that may be helpful. It explains the steps needed to implement a custom message encoder to change the content of the XML post, but not sure if it is applicable to dealing with invalid XML - a literal ampersand:

[url removed, login to view]

Amazon Web Services Engineering Project Management Software Architecture Software Testing

Project ID: #3772367

About the project

1 proposal Remote project Active Oct 11, 2010

1 freelancer is bidding on average $170 for this job

piXelicidio

See private message.

$170 USD in 21 days
(43 Reviews)
7.3