Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 01 Apr 2005 00:57 GMT
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
[MSFT] - 01 Apr 2005 06:57 GMT
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.

Luke
Mark - 01 Apr 2005 20:03 GMT
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
[MSFT] - 04 Apr 2005 03:52 GMT
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>

Luke
Mark - 04 Apr 2005 16:53 GMT
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
[MSFT] - 05 Apr 2005 03:43 GMT
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.

Luke
Mark - 12 Apr 2005 16:59 GMT
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

> Hi Mark,
>
[quoted text clipped - 14 lines]
>
> Luke
[MSFT] - 13 Apr 2005 03:42 GMT
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.

Luke

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.