can't get the http post parametes in rest service - apache

I want to create a rest service, which should retrieve all the available HTTP POST parameters in the request, note that the parameters are dynamic hence I can't use FormParam.
I made the rest service to consume form url encoded and got access to HttpServletRequest object using org.apache.cxf.jaxrs.ext.MessageContext.getHttpServletRequest(), but I can't find any parameters in the request.
Any idea how to retrieve all the http post parameters available in the httpservletrequest object in rest server ?
Thanks

okay I just had to have MultivaluedMap as the argument for my rest service, this map will have all the http post parameters in it.

Related

Rest WCF Pass Parameter but no through URL

How to Pass Parameters to Rest WCF but not through URL,
Using Method "GET"
Can we use Message Header in WCF Rest?
Thanks in Advance.

ServiceStack Serialization Hook

Is there a hook in ServiceStack which will give me access to the serialized service response object and the http response?
Specifically, I want to add a hash of the serialized response object to the http headers which the client will use to verify the content.
An IHasResponseFilter implementation is almost right, but the service response hasn't been serialized and I want to avoid duplicating that work.

How to get the soap or http request object from a wcf class

From a wcf4 service need to access to the underlying http request,including it's soap message, how can I do that from code?, I know I can use fiddler, etc, but need to do it programatically.
Look at Message Inspectors.

How to perform GET web requests to WCF Service Without WCF Client?

I want to send a GET web Request to a WCF service:
for example to:
http://TheirServerIP:PortNumber/TheirService/TheirServiceName.svc?op=theirWCFmethod
i want to write a C# code in my page (web aplication) that send HTTP GET request to their service (without WCF Client)
can i do that ?
To create a WCF service that responds to HTTP GET or HTTP POST requests
http://msdn.microsoft.com/en-us/library/bb628610.aspx
Well, in that case, you need to create a WCF REST service, one that can be called from any language using any HTTP stack and no need for any WCF specifics.
Check out the WCF REST developer center for lots of great info on WCF REST services.
Basically, what it boils down to is
using the WebHttpBinding on your server side
defining a URL pattern to handle requests and their parameters
For the client part of this, use the answer Ladislav provided - just new up a HttpRequest object and make a HTTP GET request to a valid URL - that's all there is, really.
The basic approach to call HTTP resource is:
var request = HttpWebRequest.Create("YourURL");
request.Method = "GET";
var response = request.GetResponse();
...

How to validate HTTP request headers before receiving request body using WCF

I'm implementing a REST service using WCF which will be used to upload very large files. The HTTP headers in this request will communicate information which will be validated prior to allowing the upload to proceed (things like permissions, available disk space, etc). It's possible this validation will fail resulting in an error response. I'd like to do this validation prior to the client sending the body of the request, so it has a chance to detect failure before uploading potentially gigabytes of data.
RESTful web services use the HTTP 1.1 Expect: 100-continue in the request to implement this. For example Amazon S3's REST API can validate your key and ACLs in response to an object PUT operation, returning 100 Continue if all is well, indicating you may proceed to send your data.
I've rummaged around the WCF documentation and I just can't see a way to accomplish this without doing some pretty low-level hooking into the HTTP request processing pipeline. How would you suggest I solve this problem?