SOAP .Net client wrapper questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?TWFyaw==?=

    SOAP .Net client wrapper questions

    Hi...

    I've got a .Net client to a soap service that works for the most part, but
    there are a couple of things I'd like to improve:

    1) the first request to the client wrapper always takes 12-15 seconds even
    though the web server shows < a half second spent on the request. What takes
    so much time for the client wrapper to warm up? All subsequent requests,
    even to the same method, take the half second.

    2) I tried using the async methods, but for some reason when I have 2
    outstanding async web service requests one never registers as finished, even
    though they both have different completion routines. What do I have to do to
    get async calls to work?

    Thanks
    Mark

  • Steven Cheng [MSFT]

    #2
    RE: SOAP .Net client wrapper questions

    Hi Mark,

    From your description, you're encountering two problems:

    1. the startup delay of 1st webservice call(at client proxy)
    2. Async operation with the webservice (not work for more than 1 calls)

    Regarding on the first issue, a common cause is the XML serialization
    assembly's dynamic generation. From .NET 2.0/VS 2005, it support
    pregenerate some XML serialization assembly for webservice client. You can
    find the option in Visual studio project properties's "build-->generate
    serialization assembly" section(in property dialog). Her are some reference
    on this;

    #Improving Performance of XML Serializers in .Net
    Problem background .Net infrastructure makes it very easy to define and use strongly typed wrappers (XML serializes) to read from and write to an XML document. Default implementation of this suppor…

    lizers-in-net/

    #XML Serializer Generator Tool (Sgen.exe)


    Also, when using WCF client to call XML webservice, you'll also encounter
    this startup preformance issue:



    Learn more about: How to: Improve the Startup Time of WCF Client Applications using the XmlSerializer


    For the second async method call issue, would you provide some further
    description and code snippet to demonstrate the problem scenario?

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we

    can improve the support we provide to you. Please feel free to let my
    manager know what you think of

    the level of service provided. You can send feedback directly to my manager
    at: msdnmg@microsof t.com.

    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to

    http://msdn.microsoft.com/en-us/subs...#notifications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response

    from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take

    approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution.

    The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump

    analysis issues. Issues of this nature are best handled working with a
    dedicated Microsoft Support

    Engineer by contacting Microsoft Customer Support Services (CSS) at

    http://support.microsoft.com/select/...tance&ln=en-us.
    =============== =============== =============== =====
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    From: =?Utf-8?B?TWFyaw==?= <mmodrall@nospa m.nospam>
    Subject: SOAP .Net client wrapper questions
    Date: Thu, 14 Aug 2008 11:03:01 -0700


    Hi...

    I've got a .Net client to a soap service that works for the most part, but
    there are a couple of things I'd like to improve:

    1) the first request to the client wrapper always takes 12-15 seconds even
    though the web server shows < a half second spent on the request. What
    takes
    so much time for the client wrapper to warm up? All subsequent requests,
    even to the same method, take the half second.

    2) I tried using the async methods, but for some reason when I have 2
    outstanding async web service requests one never registers as finished,
    even
    though they both have different completion routines. What do I have to do
    to
    get async calls to work?

    Thanks
    Mark


    Comment

    • =?Utf-8?B?TWFyaw==?=

      #3
      RE: SOAP .Net client wrapper questions

      Hi Steven...

      Thank you for your suggestions. My program is written in the 2.0 framework,
      so WCF and svcutil.exe don't apply. I did try manually executing sgen.exe
      but it didn't help. I looked at my project under the build properties, and
      found Generate serialization assemblies was set to "Auto" - but it wasn't
      generating them. I set it to On and now the MyApp.XmlSerial izers.dll is
      getting generated, but it also doesn't appear to help. There's still an
      extra ~12 seconds of overhead coming from somewhere.

      Your point about the serializers sounds right, but for some reason the
      XmlSerializers. dll doesn't seem to be helping.

      On the async question, here's the code from my app:
      //tm.WS.Method1Co mpleted += new
      Method1Complete dEventHandler(A syncMethod1Comp leted);
      //tm.WS.Method2Co mpleted += new
      Method2Complete dEventHandler(A syncMethod2Comp leted);
      //tm.WS.Method1As ync();
      //tm.WS.Method2As ync();
      //for (; meth1Result == null && meth2Result == null; )
      // System.Threadin g.Thread.Sleep( 50);
      ....
      private void AsyncMethod1Com pleted(object sender, Method1Complete dEventArgs e)
      {
      this.meth1Resul t = e.Result;
      Debug.WriteLine ("Finished Executing Method1");
      }

      private void AsyncMethod2Com pleted(object sender, Method2Complete dEventArgs e)
      {
      this.meth2Resul t = e.Result;
      Debug.WriteLine ("Finished Executing Method2");
      }

      The problem is that the 2nd async call never comes back on the client side.
      The web service says that it served both requests but the client
      infrastructure never seems to notice that.

      Any more ideas you have would be appreciated.

      Thanks
      Mark

      Comment

      • =?Utf-8?B?TWFyaw==?=

        #4
        RE: SOAP .Net client wrapper questions

        Hi Steven...

        I got to wondering - did you mean that the XmlSerializer had to be created
        on the client side or the web service side? I tried turning generation on
        for the web service and that didn't produce any result.

        I found some other posts indicating that the problem may be with the
        automatic Proxy setting detection, and that seems like it might be involved.
        I enabled net tracing and found a couple of things:

        1) the long delay does seem to have something to do with proxy; when it is
        very slow, there's a long delay between HttpWebRequest: :GetRequestStre am()
        and WebProxy failed to autodetect a Uri...

        2) that failure seems to be cached for a little while, even across
        processes. If I stop and restart the process immediately, and then hit the
        same web service, I don't get the delay. But the cache setting of the proxy
        detect appears somewhat short-lived. If I wait 30 seconds between process
        starts, the first request is slow again.

        3) When I code to the web request directly, I've disabled proxy setting
        detects by setting HttpWebRequest. Proxy = null; but when I use WSClient
        client = new WSClient();, it appears that it starts the proxy detect
        immediately.

        I can set client.Proxy = null; immediately after construction, but that
        doesn't seem to help.

        How do you disable proxy setting detection for a web service client?

        Thanks
        Mark


        "Steven Cheng [MSFT]" wrote:
        Hi Mark,
        >
        From your description, you're encountering two problems:
        >
        1. the startup delay of 1st webservice call(at client proxy)
        2. Async operation with the webservice (not work for more than 1 calls)
        >
        Regarding on the first issue, a common cause is the XML serialization
        assembly's dynamic generation. From .NET 2.0/VS 2005, it support
        pregenerate some XML serialization assembly for webservice client. You can
        find the option in Visual studio project properties's "build-->generate
        serialization assembly" section(in property dialog). Her are some reference
        on this;
        >
        #Improving Performance of XML Serializers in .Net
        Problem background .Net infrastructure makes it very easy to define and use strongly typed wrappers (XML serializes) to read from and write to an XML document. Default implementation of this suppor…

        lizers-in-net/
        >
        #XML Serializer Generator Tool (Sgen.exe)

        >
        Also, when using WCF client to call XML webservice, you'll also encounter
        this startup preformance issue:
        >

        >
        Learn more about: How to: Improve the Startup Time of WCF Client Applications using the XmlSerializer

        >
        For the second async method call issue, would you provide some further
        description and code snippet to demonstrate the problem scenario?
        >
        Sincerely,
        >
        Steven Cheng
        >
        Microsoft MSDN Online Support Lead
        >
        >
        Delighting our customers is our #1 priority. We welcome your comments and
        suggestions about how we
        >
        can improve the support we provide to you. Please feel free to let my
        manager know what you think of
        >
        the level of service provided. You can send feedback directly to my manager
        at: msdnmg@microsof t.com.
        >
        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        >
        http://msdn.microsoft.com/en-us/subs...#notifications.
        >
        Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
        where an initial response
        >
        from the community or a Microsoft Support
        Engineer within 1 business day is acceptable. Please note that each follow
        up response may take
        >
        approximately 2 business days as the support
        professional working with you may need further investigation to reach the
        most efficient resolution.
        >
        The offering is not appropriate for situations
        that require urgent, real-time or phone-based interactions or complex
        project analysis and dump
        >
        analysis issues. Issues of this nature are best handled working with a
        dedicated Microsoft Support
        >
        Engineer by contacting Microsoft Customer Support Services (CSS) at
        >
        http://support.microsoft.com/select/...tance&ln=en-us.
        =============== =============== =============== =====
        This posting is provided "AS IS" with no warranties, and confers no rights.
        >
        --------------------
        From: =?Utf-8?B?TWFyaw==?= <mmodrall@nospa m.nospam>
        Subject: SOAP .Net client wrapper questions
        Date: Thu, 14 Aug 2008 11:03:01 -0700
        >
        >
        Hi...
        >
        I've got a .Net client to a soap service that works for the most part, but
        there are a couple of things I'd like to improve:
        >
        1) the first request to the client wrapper always takes 12-15 seconds even
        though the web server shows < a half second spent on the request. What
        takes
        so much time for the client wrapper to warm up? All subsequent requests,
        even to the same method, take the half second.
        >
        2) I tried using the async methods, but for some reason when I have 2
        outstanding async web service requests one never registers as finished,
        even
        though they both have different completion routines. What do I have to do
        to
        get async calls to work?
        >
        Thanks
        Mark
        >
        >

        Comment

        • =?Utf-8?B?TWFyaw==?=

          #5
          RE: SOAP .Net client wrapper questions

          Hi Steven...

          I think I figured it out. Setting WSClient.Proxy = null; didn't seem to be
          stopping the auto-detect drag, so I replaced it with
          WSClient.Proxy = new WebProxy("http://bogus.url:8888" , true, new string[]
          {myWebServiceUr l});

          Basically, I gave it an instance of a proxy specifically designed to bypass
          my web service url - and it seemed to help a lot.

          Thanks
          Mark


          "Steven Cheng [MSFT]" wrote:
          Hi Mark,
          >
          From your description, you're encountering two problems:
          >
          1. the startup delay of 1st webservice call(at client proxy)
          2. Async operation with the webservice (not work for more than 1 calls)
          >
          Regarding on the first issue, a common cause is the XML serialization
          assembly's dynamic generation. From .NET 2.0/VS 2005, it support
          pregenerate some XML serialization assembly for webservice client. You can
          find the option in Visual studio project properties's "build-->generate
          serialization assembly" section(in property dialog). Her are some reference
          on this;
          >
          #Improving Performance of XML Serializers in .Net
          Problem background .Net infrastructure makes it very easy to define and use strongly typed wrappers (XML serializes) to read from and write to an XML document. Default implementation of this suppor…

          lizers-in-net/
          >
          #XML Serializer Generator Tool (Sgen.exe)

          >
          Also, when using WCF client to call XML webservice, you'll also encounter
          this startup preformance issue:
          >

          >
          Learn more about: How to: Improve the Startup Time of WCF Client Applications using the XmlSerializer

          >
          For the second async method call issue, would you provide some further
          description and code snippet to demonstrate the problem scenario?
          >
          Sincerely,
          >
          Steven Cheng
          >
          Microsoft MSDN Online Support Lead
          >
          >
          Delighting our customers is our #1 priority. We welcome your comments and
          suggestions about how we
          >
          can improve the support we provide to you. Please feel free to let my
          manager know what you think of
          >
          the level of service provided. You can send feedback directly to my manager
          at: msdnmg@microsof t.com.
          >
          =============== =============== =============== =====
          Get notification to my posts through email? Please refer to
          >
          http://msdn.microsoft.com/en-us/subs...#notifications.
          >
          Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
          where an initial response
          >
          from the community or a Microsoft Support
          Engineer within 1 business day is acceptable. Please note that each follow
          up response may take
          >
          approximately 2 business days as the support
          professional working with you may need further investigation to reach the
          most efficient resolution.
          >
          The offering is not appropriate for situations
          that require urgent, real-time or phone-based interactions or complex
          project analysis and dump
          >
          analysis issues. Issues of this nature are best handled working with a
          dedicated Microsoft Support
          >
          Engineer by contacting Microsoft Customer Support Services (CSS) at
          >
          http://support.microsoft.com/select/...tance&ln=en-us.
          =============== =============== =============== =====
          This posting is provided "AS IS" with no warranties, and confers no rights.
          >
          --------------------
          From: =?Utf-8?B?TWFyaw==?= <mmodrall@nospa m.nospam>
          Subject: SOAP .Net client wrapper questions
          Date: Thu, 14 Aug 2008 11:03:01 -0700
          >
          >
          Hi...
          >
          I've got a .Net client to a soap service that works for the most part, but
          there are a couple of things I'd like to improve:
          >
          1) the first request to the client wrapper always takes 12-15 seconds even
          though the web server shows < a half second spent on the request. What
          takes
          so much time for the client wrapper to warm up? All subsequent requests,
          even to the same method, take the half second.
          >
          2) I tried using the async methods, but for some reason when I have 2
          outstanding async web service requests one never registers as finished,
          even
          though they both have different completion routines. What do I have to do
          to
          get async calls to work?
          >
          Thanks
          Mark
          >
          >

          Comment

          • Steven Cheng [MSFT]

            #6
            RE: SOAP .Net client wrapper questions

            Hi Mark,

            As for the xmlserializers assemblies, they're used for webservice client
            proxy rather than server-side ASP.NET webservice. The client-side proxy
            will need to generated some dynamic assemblies for xml serialization and we
            can pregenerate them to improve performance.

            Also, as you mentioned, you found that adjust the proxy setting helps much
            on this. So the problem here is somewhat caused by the proxy detection(the
            delay on initial request). For more information about configuring
            proxy(via code or configuration), I suggest you have a look at the
            following article:

            #Proxy Detection Take the Burden Off Users with Automatic Configuration in
            .NET


            Sincerely,

            Steven Cheng

            Microsoft MSDN Online Support Lead


            Delighting our customers is our #1 priority. We welcome your comments and
            suggestions about how we can improve the support we provide to you. Please
            feel free to let my manager know what you think of the level of service
            provided. You can send feedback directly to my manager at:
            msdnmg@microsof t.com.

            =============== =============== =============== =====
            Get notification to my posts through email? Please refer to
            http://msdn.microsoft.com/en-us/subs...#notifications.

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


            --------------------
            From: =?Utf-8?B?TWFyaw==?= <mmodrall@nospa m.nospam>
            References: <5E5FD358-6148-4609-83FE-7BC4C6A9B556@mi crosoft.com>
            <f8uUV9o$IHA.47 92@TK2MSFTNGHUB 02.phx.gbl>
            Subject: RE: SOAP .Net client wrapper questions
            Date: Mon, 18 Aug 2008 09:45:01 -0700


            Hi Steven...

            I think I figured it out. Setting WSClient.Proxy = null; didn't seem to be
            stopping the auto-detect drag, so I replaced it with
            WSClient.Proxy = new WebProxy("http://bogus.url:8888" , true, new string[]
            {myWebServiceUr l});

            Basically, I gave it an instance of a proxy specifically designed to bypass
            my web service url - and it seemed to help a lot.

            Thanks
            Mark


            "Steven Cheng [MSFT]" wrote:
            Hi Mark,
            >
            From your description, you're encountering two problems:
            >
            1. the startup delay of 1st webservice call(at client proxy)
            2. Async operation with the webservice (not work for more than 1 calls)
            >
            Regarding on the first issue, a common cause is the XML serialization
            assembly's dynamic generation. From .NET 2.0/VS 2005, it support
            pregenerate some XML serialization assembly for webservice client. You
            can
            find the option in Visual studio project properties's "build-->generate
            serialization assembly" section(in property dialog). Her are some
            reference
            on this;
            >
            #Improving Performance of XML Serializers in .Net
            >
            http://eprystupa.wordpress.com/2008/...e-of-xml-seria
            lizers-in-net/
            >
            #XML Serializer Generator Tool (Sgen.exe)

            >
            Also, when using WCF client to call XML webservice, you'll also encounter
            this startup preformance issue:
            >

            >
            Learn more about: How to: Improve the Startup Time of WCF Client Applications using the XmlSerializer

            >
            For the second async method call issue, would you provide some further
            description and code snippet to demonstrate the problem scenario?
            >
            Sincerely,
            >
            Steven Cheng
            >
            Microsoft MSDN Online Support Lead
            >
            >
            Delighting our customers is our #1 priority. We welcome your comments and
            suggestions about how we
            >
            can improve the support we provide to you. Please feel free to let my
            manager know what you think of
            >
            the level of service provided. You can send feedback directly to my
            manager
            at: msdnmg@microsof t.com.
            >
            =============== =============== =============== =====
            Get notification to my posts through email? Please refer to
            >
            http://msdn.microsoft.com/en-us/subs...#notifications.
            >
            Note: The MSDN Managed Newsgroup support offering is for non-urgent
            issues
            where an initial response
            >
            from the community or a Microsoft Support
            Engineer within 1 business day is acceptable. Please note that each
            follow
            up response may take
            >
            approximately 2 business days as the support
            professional working with you may need further investigation to reach the
            most efficient resolution.
            >
            The offering is not appropriate for situations
            that require urgent, real-time or phone-based interactions or complex
            project analysis and dump
            >
            analysis issues. Issues of this nature are best handled working with a
            dedicated Microsoft Support
            >
            Engineer by contacting Microsoft Customer Support Services (CSS) at
            >
            >
            http://support.microsoft.com/select/...tance&ln=en-us.
            =============== =============== =============== =====
            This posting is provided "AS IS" with no warranties, and confers no
            rights.
            >
            --------------------
            From: =?Utf-8?B?TWFyaw==?= <mmodrall@nospa m.nospam>
            Subject: SOAP .Net client wrapper questions
            Date: Thu, 14 Aug 2008 11:03:01 -0700
            >
            >
            Hi...
            >
            I've got a .Net client to a soap service that works for the most part,
            but
            there are a couple of things I'd like to improve:
            >
            1) the first request to the client wrapper always takes 12-15 seconds
            even
            though the web server shows < a half second spent on the request. What
            takes
            so much time for the client wrapper to warm up? All subsequent requests,
            even to the same method, take the half second.
            >
            2) I tried using the async methods, but for some reason when I have 2
            outstanding async web service requests one never registers as finished,
            even
            though they both have different completion routines. What do I have to
            do
            to
            get async calls to work?
            >
            Thanks
            Mark
            >
            >

            Comment

            Working...