logging soap req./resp. while invoking webservices

Discussion in 'ASP .Net Web Services' started by Manish Buttan, Apr 26, 2004.

  1. Hi
    I have a problem invoking my .Net webservice from behind a particular web proxy setup.( the setup being physically inaccessible to me
    I get the erro

    The request failed with HTTP status 417: Expectation Failed.
    StackTrace:
    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
    at WebServiceClient.com.maximizelearning.ecosystem1.ServerDate.GetDate()
    at WebServiceClient.Form1.btnInvokeWebService_Click(Object sender, EventArgs e)

    I am able to browse to a aspx page from behind the setup
    http://ecosystem1.maximizelearning.com/reports/default.asp

    1.) Does this mean that the http request headers sent for a webservice invocation, are supported by the proxy setup

    2.) How can i programatically deduce as to which particular request fails behind the proxy setup
    What i am looking for is to be able to log the individual requests sent while invoking a webservic
    and also logging the response to each of the requests

    Regard
    Manis
     
    Manish Buttan, Apr 26, 2004
    #1
    1. Advertisements

  2. Manish Buttan

    [MSFT] Guest

    Hi Manish,

    IE and Web service client may sent different header. When the web service
    work in IE, we can deduce that the web service is avaliable and the network
    is connected. I suggest you may trace the request with a tool named Network
    Monitor (NetMon). It can log the request and response between client and
    server. Besides netmon, there is also some third party products which can
    achieve same thing, for example:

    http://www.ethereal.com/

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], Apr 27, 2004
    #2
    1. Advertisements

  3. Hi Luke

    Thanks for the prompt reply

    I need a way to programmatically log the request and response, as the test setup is remote to me. ( i will not be able to take sniffs using netmon in the client environment

    Could you please suggest some programmable solution for getting the request/response log

    Regard
    -Manish
     
    Manish Buttan, Apr 27, 2004
    #3
  4. Manish Buttan

    [MSFT] Guest

    Hi Manish,

    You may consider using Soap Extension to get the Request and Response
    object from the web service. For detail information on this, you can refer
    to:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
    l/cpconAlteringSOAPMessageUsingSOAPExtensions.asp

    If you have further question about this, please feel free to let me know.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], Apr 28, 2004
    #4
  5. Manish Buttan

    [MSFT] Guest

    Hi Manish,

    Here is a completed sample to log such soap inforamtion in a text file:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
    frlrfsystemwebservicesprotocolssoapextensionclasstopic.asp

    Besides, you also can check the request object in a web method. For example:

    Context.Current.Request.SaveAs("request.log",True )

    hope this help,

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], Apr 28, 2004
    #5
  6. Manish Buttan

    [MSFT] Guest

    Hi Manish,

    Did my answer make sense on the issue? If you need more
    information/suggestions, please feel free to let me know.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], Apr 30, 2004
    #6
  7. Hi Luke

    Thanks for the suggestions which you had given

    We are passing the credentials to the proxy by the following method:
    webproxy.Credentials = new NetworkCredential(frmProxyInputs.txtProxyUserName.Text.Trim()
    frmProxyInputs.txtProxyPassword.Text.Trim())
    objServerDate.Proxy = webproxy;

    But the credentials are not being passed to the Cisco content/cache Engine.

    This is what we got from the Network Sniffer:
    199.49.183.75 - - [03/May/2004:10:22:03 -0400] "POST http://ecosystem1.maximizelearning.com/testwebsite/Serverdate.asmx HTTP/1.1" 417 0

    "- -" should contain the password and the user name which is not the case
    Could you please suggest as to what may be the problem

    Regards
    Manish
     
    Manish Buttan, May 4, 2004
    #7
  8. Manish Buttan

    [MSFT] Guest

    Hi Manish,

    You may test the web service via IE and perform a trace with Network
    Sniffer. Do you get different result with this?

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], May 5, 2004
    #8
  9. Hi Luke

    The webservice could be accessed from IE without any problems
    The credentials are not being passed only when I pass it through my application. Is there any other way to pass the credentials from the application

    Regards
    Manish.
     
    Manish Buttan, May 5, 2004
    #9
  10. Manish Buttan

    [MSFT] Guest

    Hi Manish,

    It is the only way we can set the credentials for web service request. Have
    you perform a trace with Network Sniffer when connecting to the web service
    within IE? Is there any difference from:

    199.49.183.75 - - [03/May/2004:10:22:03 -0400] "POST
    http://ecosystem1.maximizelearning.com/testwebsite/Serverdate.asmx
    HTTP/1.1" 417 0



    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    [MSFT], May 6, 2004
    #10
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.