1

Is there anyway to configure WCF endpoint/binding to send the data "as-is" without wrapping as a soap message (with the Envelope tag, etc.)?

I'm trying to send an xml using WCF and its ended up wrapped as a soap and i would like that the server side would get it as plain xml (exactly as the original) because i can't change the server side at this point.

jmiserez
  • 2,629
  • 1
  • 18
  • 34
Or A
  • 1,759
  • 5
  • 29
  • 54

2 Answers2

3

Check out the excellent screen cast series by Pluralsight, which covers all of WCF REST extensively:

Specifically, there's on screen cast on:

HTTP Plain XML (POX) Services

marc_s
  • 675,133
  • 158
  • 1,253
  • 1,388
  • can you use POX for non-http endpoints? i'm using TIBCO as my "service" and when i try to set the end-point with the "webHttp" element, it complains that 'System.ServiceModel.Description.WebHttpBehavior' is only intended for use with WebHttpBinding or similar bindings. any other alternative? – Or A Jan 11 '10 at 14:55
  • 1
    I don't think so - POX is really usually associated with HTTP. You should be able to expose your TIBCO service as a HTTP endpoint, however - I'm doing that right now :-) (as a client) – marc_s Jan 11 '10 at 15:28
  • how can i do it? do i need to configure anything on the server side or i just change my TIBCO address (tcp://....) to http one? – Or A Jan 11 '10 at 15:58
  • Well, if your service normally requires tcp://, then you'd have to build a "front" service that can take in http:// requests, and then turn around and call your TIBCO stuff on tcp.// – marc_s Jan 11 '10 at 16:31
  • See this 2-part MSDN article on building a "WCF Router": http://msdn.microsoft.com/en-us/magazine/dvdarchive/cc500646.aspx - it'll be part of WCF 4 with .NET 4, too (out sometime later this spring) – marc_s Jan 11 '10 at 16:32
  • in the case of TIBCO, you can extense TemsMessageProtocol and then you can override and control how the message will get piped out. I got it to work and it makes everything else much easier. – Or A Jan 11 '10 at 20:44
  • 1
    The Pluralsight video seems to be "subscriber only" That said, I've found it at http://www.msdev.com/Directory/Description.aspx?eventId=1312 – SteveC Jul 05 '10 at 14:59
  • All links on this answer as well the links in the comments are stale. I couldn't find where the content moved to. – rene Feb 19 '14 at 07:37
  • @rene: Microsoft has once again re-organized all it's development stuff - and now all those wonderful videos seem to have gone away - sorry...... see the [WCF documentation on MSDN](http://msdn.microsoft.com/en-us/library/vstudio/dd456779%28v=vs.110%29.aspx) for some tutorials and walkthroughs (text and code only, I'm afraid) – marc_s Feb 19 '14 at 07:42
  • Ok, thanks if I stumble across content that fits here I'll leave a comment – rene Feb 19 '14 at 07:47
1

There is a write up on MSDN for "POX" (plain old xml), but I haven't tried it out. (http://msdn.microsoft.com/en-us/library/aa395208.aspx)

I was able to use the answer from a REST/SOAP stackoverflow question to return plain text (which I assume could be xml): REST / SOAP endpoints for a WCF service

Community
  • 1
  • 1
smaglio81
  • 481
  • 1
  • 5
  • 13
  • can you use POX for non-http endpoints? i'm using TIBCO as my "service" and when i try to set the end-point with the "webHttp" element, it complains that 'System.ServiceModel.Description.WebHttpBehavior' is only intended for use with WebHttpBinding or similar bindings. any other alternative? – Or A Jan 11 '10 at 14:55
  • Thanks for the vote-up. I also liked marc_s answer. I'm glad he was able to clear up the binding issues. – smaglio81 Jan 11 '10 at 23:43