开发者

See the SOAP request from Proxy class method calls

I'm using .NET 2.0 web services. If I add a reference to a WSDL and make a proxy class method call, what's the easiest way in VS to see the SOAP being sent?

Example, I added the PayPal WSDL Web Service Reference and made a call as so:

PayPalAPIAASoapBinding _client =  new PayPalAPIAASoapBinding();
...rest of code and then
    SetExpressCheckoutResponseType checkoutResponse = new SetExpressCheckoutResponseType();
    checkoutResponse = _client.SetExpressCheckout(request); // makes the call here

I tried setting a debug point on line 2 but not sure how to dive in to see the SOAP. Obviously I could use something like Fiddler but want to just use Intellisense during debugging to drill down to the object that has the request. I would assume client would have it, my i开发者_Python百科nstance above but could not find it. Client is an instance of the PayPal Service.

I do see when I drill down into the base class PayPalAPIAASoapBinding that there is a version property but I can't get the value for this:

System.Web.Services.Protocols.SoapProtocolVersion.Default

when I try to paste that into my watch window, the value just shows the word Default not the true value that's sent. So this is why I need to look at the SOAP and so far in that binding object I don't see a property holding it. But it's gotta be somewhere in any requests you make in a web service in .NET, just don't know where to look during debug?

My end goal here is to be able to read the SOAP envelop before it's being sent really using any WSDL reference in VS.


There's no very easy way. See the example in the SoapExtension documentation on MSDN for a way to log the information.

If you were using WCF, you could just turn on logging in the configuration.


The easiest way to see the SOAP messages (regardless of the programming language) is to use a tool like SoapUI or TCPmon which lets you intercept send and received messages.

This is very easy (if the SOAP is not encrypted). Although it is not in VS.


The easiest way is to use the Fiddler. You can let your VS make Soap calls and see the traffic in raw view on the Fiddler. If the Soap calls are made over SSL, there are some extra steps that needs to be taken for Fiddler to trace them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜