Same Session with Multiple SendActivity in WF

Our workflow in the Workflow Foundation is used to invoke ASMX web services using an InvokeWebService activity that has a SessionId property to correlate multiple activities in the same session (by sending an ASP.NET session cookie on every request ). It worked.

We have now switched to WCF web interface and we changed our workflows to use SendActivity instead . However, we have not found a solution for correlating web service calls, i.e. sending a session cookie on every request.

Is it possible to achieve this in WF or do we need our own solution?

+1


source to share


1 answer


I am not aware of any built-in cookie handling facility in any of the WF / WCF integrations ( SendActivity and ReceiveActivity ). This makes sense since WCF is transport-agnostic and therefore, at a high level, APIs cannot be tied to any HTTP-specific functionality, such as in the case of ASMX Web Services .

The solution in your case might be to expose the WCF services through an endpoint that uses basicHttpBinding which is compatible with the protocol supported by the ASMX web services and then fall back to using InvokeWebServiceActivity to invoke them.

Also, since a WCF service can be exposed through any number of endpoints , you can simply add an endpoint that uses basicHttpBinding to those that already exist. Here's an example:



<configuration>
    <system.serviceModel>
        <services>
            <service name="MyNamespace.MyServiceImpl">
                <endpoint binding="wsHttpBinding" name="WsHttp"
                    contract="MyNamespace.IMyService" />
                <endpoint address="basic" binding="basicHttpBinding" name="BasicHttp"
                    contract="MyNamespace.IMyService" />
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost/myservice" />
                    </baseAddresses>
                </host>
            </service>
        </services>
    </system.serviceModel>
</configuration>

      

Then, workflows that use InvokeWebServiceActivity will invoke the service using the following URL:

http: // localhost / myservice / basic

0


source







All Articles