all groups > dotnet web services > march 2005 >
You're in the

dotnet web services

group:

using .Net soap client wrappers - any way to get to post data?


using .Net soap client wrappers - any way to get to post data? Mark
3/31/2005 3:57:01 PM
dotnet web services: Hi...

I used wsdl.exe to generate some wrapper classes from someone's soap web
service, and I'm looking for some way to look at what the soap request packet
actually looks like. The webservice I'm consuming is https, so packet
sniffing won't help.

I put a demo in the debugger, and I found that if I get a non-200 status
from the Invoke(), I can catch the error and drill down into the object
hierarchy in the debugger to the PendingSyncRequest._SubmitWrite buffers, but
the VS debugger only shows those as numeric byte values (all 1035 of them);
I'd have to hand-translate all those byte codes to reconstruct the document.

I haven't seen it yet, but is there any method or api I can call at some
point to see what the POST data is? The <xml> soap request package?

Thanks
_mark
RE: using .Net soap client wrappers - any way to get to post data? lukezhan NO[at]SPAM online.microsoft.com
4/1/2005 5:57:19 AM
Hi Mark,

If it wasn't https, we can use packet sniffing as you said, or a simple
trace utility in Soap ToolKit. If you can build a test enviroment with
http, this will be the easiest way.

Wth Https (SSL), we cannot trace the message from network layer. I suggest
you may take a look at Soap Extensions in .NET. Here is two articles about
it:

Digging into SOAP Headers with the .NET Framework
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/h
tml/service06182002.asp

Altering the SOAP Message Using SOAP Extensions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconalteringsoapmessageusingsoapextensions.asp

With Soap Extensions, we can access the soap message at BeforeSerialize or
AfterSerialize, and log its content somewhere.

RE: using .Net soap client wrappers - any way to get to post data? Mark
4/1/2005 11:03:02 AM
Hi...

Thanks for the links; that's been very helpful. The sample SoapExtension is
basically what I wanted to do. The gap I'm finding in the documentation,
however, is how to get the SoapExtension plugged in and working. There are
some references to how to configure a web.config for ASP.Net, and in another
spot a small reference to gaccing your extensions and plugging them into the
machine.config for everything, but I'm not having any luck figuring out out
to phrase it for an app.config just for my test case.

Probably won't need a <system.web> wrapper, don't know if I'll need a
<webServices> wrapper. For an app.config, will I need a section header to
specify this, or will these be recognized as "built in"?

Thanks
-mark
RE: using .Net soap client wrappers - any way to get to post data? lukezhan NO[at]SPAM online.microsoft.com
4/4/2005 2:52:01 AM
Hi Mark,

On server side, you can put it in web.config. On client side, we need to
add it in app.config, for example:

<configuration>
<system.web>
<webServices>
<soapExtensionTypes>
<add
type="WebServiceProgress.ProgressExtension, WebServiceProgress"
priority="1" group="0" />
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>


RE: using .Net soap client wrappers - any way to get to post data? Mark
4/4/2005 8:53:01 AM
Hi Luke...

Thanks for responding. I took the TraceExtension example right out of the
msdn doc page you pointed me to, and then made a local config exactly like
the one below, except with TraceExtension in the add type.

I had the config file in the bin\debug directory with the project build.
First I called it app.config, then I called it <app>.exe.xml (which one msdn
page said should be the form. Neither worked, in that I don't get into the
extension code at all. And I didn't see any build/startup errors shown, so
I'm not sure what I'm doing wrong.

Should the app.config be somewhere else? Should it be built into the app as
a resource?

Thanks
_mark


RE: using .Net soap client wrappers - any way to get to post data? lukezhan NO[at]SPAM online.microsoft.com
4/5/2005 12:00:00 AM
Hi Mark,

If your windows application named "winapp.exe", your config file should be
in same folder and named "winapp.exe.config". You can add
"winapp.exe.config" mannually, or VS.NET compiler will help you generate it:

In VS.NET IDE, you can open the app.config and edit it. Then compile the
project.

RE: using .Net soap client wrappers - any way to get to post data? Mark
4/12/2005 8:59:01 AM
Thanks Luke... When you create an extension, do you need to register it in
the GAC or something? As I said, I copy and pasted the TraceExtension code
directly from the msdn webpage into my project and then added
<add type="TraceExtension" priority="1" group="0"/>

in the application config. Now that I've got the app config in the right
place, it blows up saying that the type value is illegal. Then I changed it
from being a free-range class to being in the app namespace and put
"t.TraceExtension" but it still blows up saying the type value is illegal,
but it doesn't say what's illegal about it.

Thanks
_mark


[quoted text, click to view]
RE: using .Net soap client wrappers - any way to get to post data? lukezhan NO[at]SPAM online.microsoft.com
4/13/2005 12:00:00 AM
Hello,

For the "type" element, we need to specify the full class name like:

<add
type="WebServiceProgress.ProgressExtension, WebServiceProgress"
priority="1" group="0" />


"WebServiceProgress.ProgressExtension" is the full class name with
namespace; WebServiceProgress is the assembly name in the application
folder.

AddThis Social Bookmark Button