locked
Routing Messages synchronously to services RRS feed

  • Question

  • Hi,

    We are using CSF 3.0 Dev edition. We have been able to create and terminate session synchronously. However we are not clear on how to call services ( as defined manifest) synchrounously. As in case of Create Session, there is a class "CreateSessionResponse",which holds response of Create Session. Which class is used to hold response of TResponse SendSync<TResponse> (message) when we want to route manifest to services through Session Web service.

    We have been able to send messages to services asynchronously.

    Would be great if somebody could throw some light?

    Thanks

    Ruchi

     

     

     

     

    Wednesday, August 23, 2006 9:36 AM

Answers

  • Hi San,

    Thanks for the information.

    Adding more to it, messages can be routed asynchronously only. However synchronous behavior can be simulated using Async calls. For more information on how to do simulate sync behavior, refer to SyncSession sample of CSF 3.0.

    Ruchi

     

     

    Thursday, August 24, 2006 12:48 PM

All replies

  • Hello Ruchi,

    There is a class called CsfService in Microsoft.ConnectedServices.Sdk.Messaging namespace.

    To get the responses asynchronously you need to create a class that inherits CsfService. Following is a snippet as to how it looks:

    public class CsfClientService : CsfService

    {

    public CsfClientService()

    {

    //

    // TODO: Add constructor logic here

    //

    }

    public void CreateSession()

    {

    // Code to create session

    // Here use sender.SendAsync(message); from Microsoft.ConnectedServices.Sdk.Client 's MessageSender

    }

    private void TerminateSession()

    {

    // Code to create session

    // Here use sender.SendAsync(message); from Microsoft.ConnectedServices.Sdk.Client 's MessageSender

    }

    // This is the Syntax to accept asynshronous responses for session creation

    [Operation(Name = "CreateSessionResponse", Action = SessionActions.CreateResponse)]

    private void CreateSessionResponse(CreateSessionResponse response)

    {

    }

    }

    Hope this would help you.

    Regards

    Vikram 

    Wednesday, August 23, 2006 1:54 PM
  • Hi Ruchi,

    There are two approaches in CSF 3.0 programming.

    1. SDK approach ( like csf 2.5)

    2. Attribute approach.

    In order to work on 1st approach, you can refer the samples. But for 2nd approach i'm also tried like

    [Operation(Oneway = true, Name="RouteResponse", Action = "http://tempuri.org/HelloWorldResponse")]

    public void RouteResponse(Message mess)

    {

    // do something

    }

    but getting failed. If anybody has done, Could you please calrify me how to get service's response using Attribute approach?

    Rgs

    Vasu

     

     

    Wednesday, August 23, 2006 2:09 PM
  • Hi Vasu n Vikram,

    Thanks for the reply. However please note that I want to call services (as specified in manifest) asynchronously. I have been able to call Session creation and termination requests synchronously. But what I want to do is to submit manifest to Session Web service and use SendSync method so that services are called synchronously.

    Also "Oneway = true" specifies that you want to make asynchronous call and hence oneway.

    I have also gotten in touch with Senthil from Microsoft. Will update you as I recieve update from him.

    Ruchi

     

     

     

     

    Thursday, August 24, 2006 4:24 AM
  • Hi Ruchi,
        we cannot Route Messages synchronously to services in csf 3.0.we can route only Async Message......
    san.

     

    Thursday, August 24, 2006 11:12 AM
  • Hi San,

    Thanks for the information.

    Adding more to it, messages can be routed asynchronously only. However synchronous behavior can be simulated using Async calls. For more information on how to do simulate sync behavior, refer to SyncSession sample of CSF 3.0.

    Ruchi

     

     

    Thursday, August 24, 2006 12:48 PM
  • hi ruchi

    actually i am new in csf framwork .

    i have already created "helloword  csfservice" and consume it locally using add web ref.

    but now i am trying to consume helloworld web service in our local web portal using session

    i have gone through  all the samples of csf,  but except that sync session all these sample are based on windows app. only

    but i am working on web, can you help me out to create and terminate session.

    actully i am not able to use  available session codes in my application

    please help me out   

    Wednesday, April 18, 2007 6:48 AM
  • hi Abhi,
    Can you be more specific about the problem that you are facing? I have used this in a Web Application.
    Please check that you have added web reference to appropriate services, like Session service.


    Saturday, April 21, 2007 10:56 PM
  • hi ruchi,

    i an also using the web application.

    and i am trying to consume helloworld csf service asynchronously.

    can you help me out

    Monday, April 23, 2007 10:32 AM
  • What is the error that you are getting?
    Monday, April 23, 2007 5:53 PM
  • now i got my answer about async session

    but can you tell me

    how can i route the message between two participant services through session using routing table .

    Friday, May 18, 2007 9:22 AM
  • hey, look at the samples that Microsoft has provided with CSF download.
    Tuesday, May 22, 2007 7:01 AM
  • Please refer the following documentation for routing message between participants via session

     

    http://msdn2.microsoft.com/en-us/library/aa303146.aspx

     

    Thanks

    Sunday, June 10, 2007 7:18 AM