How to intercept the XML requests sent by the proxy?

Discussion in 'ASP .Net Web Services' started by Gabriel Lacatus, May 9, 2006.

  1. Hello,

    I am trying to intercept and analyze the XML request that is being sent by
    the generated web reference to a 3rd party web service. The web service is
    giving me an error when calling a method saying I didn't send correct data.
    Whilst I am working with objects in my client code I cannot really
    understand my mistake. That unless I can actually SEE what does the form of
    the serialized XML request look like and compare it to the schema given in
    the web service documentation I received.

    I have tried overriding the GetResponse method in the web reference file but
    I cannot read from the request stream ("This stream does not support seek
    operations" exception).

    I also tried Soap Extensions but again I can't seem to get my hands on the
    data being sent to the web service.
    Many of the examples I found on the internet explain how to intercept and
    modify a request but in reality the modification is really a complete
    replacement of the request so it has nothing to do with actually seeing what
    was originally inside that request.

    I learnt that TCP sniffers could be used but I don't know the ports used by
    the .NET framework to communicate with the remote host. I couldn't find a
    good such sniffer anyway...

    I am completely lost. Can anybody give a hand?

    Thank you.
    Gabriel Lacatus, May 9, 2006
    #1
    1. Advertising

  2. Hi Gabriel,

    Thank you for posting.

    Regarding on the intercepting the SOAP message sent by webservice proxy
    generated by .net framework, I think you can just some some certain trace
    tools like tcpTrace, proxyTrace or traceUtility in soaptoolkit 3.0.

    #SOAP Toolkit 3.0
    http://www.microsoft.com/downloads/details.aspx?FamilyId=C943C0DD-CEEC-4088-
    9753-86F052EC8450&displaylang=en

    And when you want to start tracing(for your case, we're the webservice
    client-side), just start the trace utility and listening on a local
    port(specify a unused one, such as 8888), and then, forward the request to
    the remote destination server(and a specified port, this is usually 80 for
    http ). Then, for our webservice proxy's code, we should change its
    service url to the local port we specified earlier. e.g:

    =================
    MyProxy mp = new MyProxy();

    mp.Url = "http:localhost:8888/xxxxx/xxxx.xxx";
    ..................
    ==================

    Then, the SOAP message will be passed through the local 8888 port(our trace
    utlity ) first, then be forwarded to the destination server(port) after be
    logged.

    Hope this helps. If there is anything I missed, please feel free to post

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    here.
    Steven Cheng[MSFT], May 10, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Abhijit

    Intercept WebDAV requests

    Abhijit, Jul 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    752
    =?Utf-8?B?dnBsdXNwbHVz?=
    Oct 17, 2004
  2. =?Utf-8?B?cnBhbGU=?=

    httphandler to intercept pages before sent to user

    =?Utf-8?B?cnBhbGU=?=, Dec 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    560
    Steven Cheng[MSFT]
    Dec 16, 2004
  3. Fernando Arámburu

    web requests and mobile requests

    Fernando Arámburu, Apr 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    433
    Joerg Jooss
    Apr 8, 2005
  4. Matthias S.

    Webservice - Intercept all requests

    Matthias S., Apr 23, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    371
    Matthias S.
    Apr 23, 2008
  5. decepti0n

    Intercept Flash HTTP requests with JS

    decepti0n, Mar 2, 2008, in forum: Javascript
    Replies:
    3
    Views:
    193
    Erwin Moller
    Mar 4, 2008
Loading...

Share This Page