I’m posting to a web page which I was told took XML as it’s body. Turns out that what it really requires is what looks like a URL encoded CGI query string:
<FIRST>
<ELEMENT1>Value1</ELEMENT1>
<ELEMENT2>Value1</ELEMENT2>
<ELEMENT3>Value1</ELEMENT3>
</FIRST>
<SECOND>
<ELEMENT1>Value1</ELEMENT1>
<ELEMENT2>Value1</ELEMENT2>
</SECOND>
Needs to be transmitted as
FIRST_ELEMENT1=VALUE1&FIRST_ELEMENT2=VALUE2&FIRST_ELEMENT3=VALUE3&SECOND_ELEMENT1=VALUE1&SECOND_ELEMENT2=VALUE2
The third party tells me this is a common usage, although I’ve not seen it before (as a method of submitting XML) it’s obvious that the service was designed to take an HTML POST with a form as the source of data.
While I can see how I could write a transform I’m wondering if there is a mthod in the .Net framwork which achieves this translation. Upto and including .Net 3.5 is available on this project.
Thanks in advance
Dave
I’ve never seen that usage, but something like: