Asynchronous calling problem in Web service.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jim

    #1

    Asynchronous calling problem in Web service.

    Hi All,

    I try to make an asynchronous call to a web service method as below under MS
    visual .NET studio 2003:

    WebService webSrv = new WebService();
    AsyncCallback cb = new AsyncCallback(T rsWebSvsCallbac k);
    IAsyncResult ar = webSrv.BeginPro cessCall( 1, cb, transWeb40);

    while (ar.IsCompleted == false)
    {
    ....
    }

    ..
    ..
    ..

    public static void TrsWebSvsCallba ck(IAsyncResult ar)
    {
    WebService webSrv = (WebService) ar.AsyncState;
    string strResponse = webSrv.EndProce ssCall( ar );
    }

    But in while statement, ar.IsCompleted is always false.

    In the debug environment of Visual .NET Studio 2003, the callBack thread was
    created. But it seems stoped at location:
    System.Web.Serv ices.UnsafeNati veMethods.OnSyn cCallReturn.

    It never invoke the TrsWebSvsCallba ck method. And also ar.IsCompleted never
    be set to 'true'.

    Anybody have idea on this would be appreciated.

    Thanks in advance,
    Jim



  • John Bailo

    #2
    Re: Asynchronous calling problem in Web service.


    Sounds like your getting closer to the problem that is being reported in
    several current threads on this subject.

    Also, have you tried launching multiple callbacks ( in a loop ) ?

    Question: does the call to the web service appear in your iis server logs?

    jim wrote:
    [color=blue]
    > Hi All,
    >
    > I try to make an asynchronous call to a web service method as below under
    > MS visual .NET studio 2003:
    >
    > WebService webSrv = new WebService();
    > AsyncCallback cb = new AsyncCallback(T rsWebSvsCallbac k);
    > IAsyncResult ar = webSrv.BeginPro cessCall( 1, cb, transWeb40);
    >
    > while (ar.IsCompleted == false)
    > {
    > ...
    > }
    >
    > .
    > .
    > .
    >
    > public static void TrsWebSvsCallba ck(IAsyncResult ar)
    > {
    > WebService webSrv = (WebService) ar.AsyncState;
    > string strResponse = webSrv.EndProce ssCall( ar );
    > }
    >
    > But in while statement, ar.IsCompleted is always false.
    >
    > In the debug environment of Visual .NET Studio 2003, the callBack thread
    > was created. But it seems stoped at location:
    > System.Web.Serv ices.UnsafeNati veMethods.OnSyn cCallReturn.
    >
    > It never invoke the TrsWebSvsCallba ck method. And also ar.IsCompleted
    > never be set to 'true'.
    >
    > Anybody have idea on this would be appreciated.
    >
    > Thanks in advance,
    > Jim[/color]

    --
    Texeme Textcasting Technology

    Comment

    • John Bailo

      #3
      Re: Asynchronous calling problem in Web service.


      Sounds like your getting closer to the problem that is being reported in
      several current threads on this subject.

      Also, have you tried launching multiple callbacks ( in a loop ) ?

      Question: does the call to the web service appear in your iis server logs?

      jim wrote:
      [color=blue]
      > Hi All,
      >
      > I try to make an asynchronous call to a web service method as below under
      > MS visual .NET studio 2003:
      >
      > WebService webSrv = new WebService();
      > AsyncCallback cb = new AsyncCallback(T rsWebSvsCallbac k);
      > IAsyncResult ar = webSrv.BeginPro cessCall( 1, cb, transWeb40);
      >
      > while (ar.IsCompleted == false)
      > {
      > ...
      > }
      >
      > .
      > .
      > .
      >
      > public static void TrsWebSvsCallba ck(IAsyncResult ar)
      > {
      > WebService webSrv = (WebService) ar.AsyncState;
      > string strResponse = webSrv.EndProce ssCall( ar );
      > }
      >
      > But in while statement, ar.IsCompleted is always false.
      >
      > In the debug environment of Visual .NET Studio 2003, the callBack thread
      > was created. But it seems stoped at location:
      > System.Web.Serv ices.UnsafeNati veMethods.OnSyn cCallReturn.
      >
      > It never invoke the TrsWebSvsCallba ck method. And also ar.IsCompleted
      > never be set to 'true'.
      >
      > Anybody have idea on this would be appreciated.
      >
      > Thanks in advance,
      > Jim[/color]

      --
      Texeme Textcasting Technology

      Comment

      • jim

        #4
        Re: Asynchronous calling problem in Web service.

        Yes, after calling BeginProcessCal l( 1, cb, transWeb40), the ProcessCall web
        method was called. When it finished and returned successfully, ar.IsCompleted
        still was kept 'false' and Callback function never be called.

        Thanks,
        Jim


        "John Bailo" wrote:
        [color=blue]
        >
        > Sounds like your getting closer to the problem that is being reported in
        > several current threads on this subject.
        >
        > Also, have you tried launching multiple callbacks ( in a loop ) ?
        >
        > Question: does the call to the web service appear in your iis server logs?
        >
        > jim wrote:
        >[color=green]
        > > Hi All,
        > >
        > > I try to make an asynchronous call to a web service method as below under
        > > MS visual .NET studio 2003:
        > >
        > > WebService webSrv = new WebService();
        > > AsyncCallback cb = new AsyncCallback(T rsWebSvsCallbac k);
        > > IAsyncResult ar = webSrv.BeginPro cessCall( 1, cb, transWeb40);
        > >
        > > while (ar.IsCompleted == false)
        > > {
        > > ...
        > > }
        > >
        > > .
        > > .
        > > .
        > >
        > > public static void TrsWebSvsCallba ck(IAsyncResult ar)
        > > {
        > > WebService webSrv = (WebService) ar.AsyncState;
        > > string strResponse = webSrv.EndProce ssCall( ar );
        > > }
        > >
        > > But in while statement, ar.IsCompleted is always false.
        > >
        > > In the debug environment of Visual .NET Studio 2003, the callBack thread
        > > was created. But it seems stoped at location:
        > > System.Web.Serv ices.UnsafeNati veMethods.OnSyn cCallReturn.
        > >
        > > It never invoke the TrsWebSvsCallba ck method. And also ar.IsCompleted
        > > never be set to 'true'.
        > >
        > > Anybody have idea on this would be appreciated.
        > >
        > > Thanks in advance,
        > > Jim[/color]
        >
        > --
        > Texeme Textcasting Technology
        > http://www.texeme.com
        >[/color]

        Comment

        • jim

          #5
          Re: Asynchronous calling problem in Web service.

          Yes, after calling BeginProcessCal l( 1, cb, transWeb40), the ProcessCall web
          method was called. When it finished and returned successfully, ar.IsCompleted
          still was kept 'false' and Callback function never be called.

          Thanks,
          Jim


          "John Bailo" wrote:
          [color=blue]
          >
          > Sounds like your getting closer to the problem that is being reported in
          > several current threads on this subject.
          >
          > Also, have you tried launching multiple callbacks ( in a loop ) ?
          >
          > Question: does the call to the web service appear in your iis server logs?
          >
          > jim wrote:
          >[color=green]
          > > Hi All,
          > >
          > > I try to make an asynchronous call to a web service method as below under
          > > MS visual .NET studio 2003:
          > >
          > > WebService webSrv = new WebService();
          > > AsyncCallback cb = new AsyncCallback(T rsWebSvsCallbac k);
          > > IAsyncResult ar = webSrv.BeginPro cessCall( 1, cb, transWeb40);
          > >
          > > while (ar.IsCompleted == false)
          > > {
          > > ...
          > > }
          > >
          > > .
          > > .
          > > .
          > >
          > > public static void TrsWebSvsCallba ck(IAsyncResult ar)
          > > {
          > > WebService webSrv = (WebService) ar.AsyncState;
          > > string strResponse = webSrv.EndProce ssCall( ar );
          > > }
          > >
          > > But in while statement, ar.IsCompleted is always false.
          > >
          > > In the debug environment of Visual .NET Studio 2003, the callBack thread
          > > was created. But it seems stoped at location:
          > > System.Web.Serv ices.UnsafeNati veMethods.OnSyn cCallReturn.
          > >
          > > It never invoke the TrsWebSvsCallba ck method. And also ar.IsCompleted
          > > never be set to 'true'.
          > >
          > > Anybody have idea on this would be appreciated.
          > >
          > > Thanks in advance,
          > > Jim[/color]
          >
          > --
          > Texeme Textcasting Technology
          > http://www.texeme.com
          >[/color]

          Comment

          Working...