webinvoke

Accepting form fields via HTTP Post in WCF

I need to accept form data to a WCF-based service. Here's the interface: [OperationContract] [WebInvoke(UriTemplate = "lead/inff", BodyStyle = WebMessageBodyStyle.WrappedRequest)] int Inff(Stream input); Here's the implementation (sample - no error handling and other safeguards): public int Inff(Stream input) { StreamReader ...

WebInvoke/DataContractJsonSerializer, '1,6276' cannot be parsed as 'double'.

Hi, I am using WCF WebInvokeAttribute for declarative JSON requests (DataContractJsonSerializer), with DataContractAttribute/DataMemberAttribute based serialization. I'm using a service that supports returning JSON containing data based on different cultures. By default, this service uses en-US culture settings, which means the decimal...

How to load data from HTTPPOST request in server side?

I have a WebInvoke method like this; [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "/go", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml )] string go(string name); and I post the data like t...

WCF RequestFormat for WebGet and WebInvoke

I have WCF services exposed using WebGet and WebInvoke that require the data to be wrapped in xml. I would prefer to be able to return raw data without it being wrapped in xml and also allow clients the ability to invoke my service without needing to wrap the request in xml. I'm serializing the data using protocol buffers and convertin...

Get client IP address for WCF, post operation

I am trying to determine the client's IP address following this link: http://www.danrigsby.com/blog/index.php/2008/05/21/get-the-clients-address-in-wcf/. I have operationContracts of WebInvoke/Post and WebGet. The code works when the client request is a WebGet. But when the client request is a WebInvoke, I will get the WCF host IP. Any s...

How to do ad-hoc testing of web service PUT methods?

I've written a web service and it's nice that you can just navigate to http://whatever... and see the response to GETs. Is there some nifty way I can do something similar for PUTs? (presumably involving some tool to write the info that's PUTed). Obviously I'll have automated tests for these methods, but I'd like to be able to play arou...