2 minute read

When you define a CSF session, InChannelResponse partecipant’s parameter allows to define how CSF session server communicate with the selected endpoint. In particular it allows to specify whether it should hold open the channel that the session server uses to communicate with the service when it routes a message, or whether it should close the channel. In the following example, CSF can recognize successfully the “OneWayFalseMethod” response only if the partecipant have InChannelResponse=true <PRE class=code> public class GenericSoapService : SoapService { public GenericSoapService() {

    }

    [SoapMethod(ServiceActions.OneWayFalseMethodRequest, ResponseAction = ServiceActions.OneWayFalseMethodResponse)]
    public String OneWayFalseMethod()
    {
        return "GenericSoapService OneWayFalseMethodResponse: OK";
    }
}

</PRE>

If you use CsfService instead of SoapService to derive your service class, It have enough logic inside to undestand how CSF is calling him and decide how to deliver the answer in the correct way.

Infact the following example works with both InChannelResponse=true and InChannelResponse=false

    [CsfService(Name = "TestCSFService", Namespace = "http://TestCSFService")]
    public class Service : CsfService
    {
        [Operation(Name = "OneWayFalseMethod",
                   Action = ServiceActions.OneWayFalseMethodRequest,
                  ResponseAction = ServiceActions.OneWayFalseMethodResponse,
                   Oneway = false)]
        public String OneWayFalseMethod(String OneWayFalseMethodRequest)
        {
            return "OneWayFalseMethodResponse: OK";
        } 
    }

More information: