IIS: How to log ws request and response with body data? - iis

i have a wcf web service running on IIS 10.
I need to log every request and response with body data.
How to do it?
Thanks in advance,
Massimo

Related

How to capture request header in azure web app

I'm currently running a windows azure web app behind an application gateway v2.
I would like to use header information for x-forwarded-host or x-original-host - but it does not work.
Now I'd like to trace what request headers are actually received by the web app. I'm trying network-capturing. But as the whole traffic is HTTPs - I guess I'm not seeing all the fields.
Any Idea?
You can configure application gateway to modify request and response headers and URL by using Rewrite HTTP headers and URL or to modify the URI path by using a path-override setting. However, unless configured to do so, all incoming requests are proxied to the backend.
For more details, you can read the offical document.

How to pass HTTP header information to a SonarQube Server running behind a Proxy?

We have a SonarQube Server running behind IIS which is configured as a reverse proxy and we are trying to implement SSO for SonarQube by delegating user authentication to IIS. Now SonarQube is expecting HTTP header information related to authenticated users.
Where can we find those HTTP header information in IIS?
How do we pass them to SonarQube?
Expected HTTP Headers in SonarQube.
X-Forwarded-Login
X-Forwarded-Name
X-Forwarded-Groups
Any help would be greatly appreciated.
Thank you!:)

How to confirm HTTP request including header, body and url parameter in azure mobile apps

Hi I have a question about azure mobile apps.
Can I confirm HTTP request including header, body and url parameter in azure mobile apps when troubleshooting?
If yes, how can I confirm that?
For example, let me assume that client send a HTTP request to azure mobile apps, and a the response is bad request(status code 400).
Then I would like to figure out the cause.
First of all I set [Diagnostics log] - [Web server logging] as Storage in portal.azure.com,and confirmed the IIS log.
But there is no header, body info in the HTTP request.
So I did not find out the cause by that log.
Finally problem is solved by client logs by taking fiddler and cause is wrong info in body of the http request.
Above all, by taking fiddler log in client side, I was able to solve the problem but I would like to know if there is a way to confirm http request's header, body and url parameter in azure mobile apps side.
You can log the inbound query on the client or server side, or use something like Fiddler. For the server side, just use regular methods for Node.js or ASP.NET - nothing special is needed. For the client side, I documented the process for all platforms on my blog. Although the documentation is for adjusting the HTTP request, it's the same recipe for logging.

Why is no request logged by IIS?

I am making Ajax DELETE request (from another server) to my asp.net web api. I can see that the OPTIONS request was logged in IIS and also captured by Wireshark. But just after that, DELETE is not captured. I have enabled 'All Verbs' in Request Filtering and restarted IIS too. Is there any reason as to why this happens? In my client, I am always getting 403 Access Denied as response on DELETE request, while OPTIONS, like I said, is 200 OK.

Azure WebRole and WCF Data Service - Preventing Redirect

I have a WCF Data service hosted in Azure as a Azure Web Role. Have added a Http Module for authentication. The custom Http Module looks at the Authorization header in the request headers and authenticates the user.
When I make a Http request to the WCF Data Service, I run into two issues. There is a Http redirect happening.
I make the request to http:\northwindsample.cloudapp.net\SampleService.svc. The message I get is that "There is no operation listening for http://rd00155d341b52/SampleService.svc, but there is an operation listening for http://northwindsample.cloudapp.net/SampleService.svc/, so you are being redirected there.
Though I am making the request to http:\northwindsample.cloudapp.net\SampleService.svc, it is somehow going to http://rd00155d341b52/SampleService.svc and then gets redirected to the actual service. I get an Http 307 and in the redirect the authorization header is missing.
Later I found that when I add the trailing slash, then there is no redirect happening.
How can I prevent this redirection because of missing trailing slash ? Also the issue is that the authorization header is not sent to the redirected Uri.
Thanks
Take a look at this:
http://gavinmckay.wordpress.com/2009/03/24/howto-fix-wcf-host-name-on-iis/
For updating this in Azure, you will want to either create a startup task or use the IIS management APIs like is used here:
http://blogs.msdn.com/b/tom/archive/2011/02/18/installing-and-using-an-httpmodule-in-windows-azure.aspx

Resources