Calling ASP. NET workflows: bearer and restrictions

Source: Internet
Author: User
Tags web hosting

The Windows Workflow Foundation framework supports Web Service interoperability. This framework can expose workflows as Web services to ASP. NET clients and other workflows. Windows Workflow Foundation allows you to publish workflows as ASP. NET Web services to Web servers or server farms that run ASP. NET on Internet Information Service (IIS) 6.0. Because Windows Workflow Foundation Web Service supports ASP. NET 2.0, It inherits most of the functions of the standard ASP. NET Web service.

Windows Workflow Foundation basic activity libraries include WebServiceInputActivity and WebServiceOutputActivity, which allow workflows to be used as Web service endpoints. For more information about using these Web service activities, see use WebServiceInputActivity and use WebServiceOutputActivity.

Web Hosting of ASP. NET workflows

The main types used for workflow Web hosting include:

WorkflowWebHostingModule

ManualWorkflowSchedulerService

WorkflowWebHostingModule

The WorkflowWebHostingModule class is the default routing mechanism used to route Web service requests to the corresponding workflow by Using ASP. NET cookies. Of course, the client sending these requests must support cookies.

Although Windows Workflow Foundation provides this default routing mechanism, you can implement your own custom routing mechanism. For example, if you cannot enable Cookie on the client, you can configure the client to create a workflow instance with a specific Id and pass the Id in each Web service request. You can use SOAP or HTTP processing programs to configure the request pipeline to intercept calls, retrieve the workflow instance Id from the header information, and then set HttpContext. current. items. add ("_ WorkflowInstanceId _", workflowInstanceId) is set to the input Id.

ManualWorkflowSchedulerService

ManualWorkflowSchedulerService class is a dedicated implementation of WorkflowSchedulerService. It issues ASP by reusing a thread.. NET Web requests to run workflow instances.. NET process. This ensures that the number of active threads in the workflow Runtime is equal to the number of active Web requests in the ASP. NET process at any time.

Restrictions on ASP. NET workflows exposed as Web Services

Instance routing works on the basis of ASP. NET sessions. As a Web service user, it must support ASP. NET cookies.

Even if you can model "receive request-Send Response" as asynchronous operations in the workflow, ASP.. NET is still applicable to Web service users, that is, the instance cannot migrate between unprocessed request-response operations.

Enable Cookie to call ASP. NET workflow Web Service

The workflow Web Service uses cookies to track the status. If you publish a workflow as a Web service, you must enable Cookie in the client code that calls it. For example:

CalculatorWorkflow_WebService service = new CalculatorWorkflow_WebService ();

Service. CookieContainer = new System. Net. CookieContainer ();

This allows you to call methods on the "service" object.

  1. Create and start an ASP. NET Workflow
  2. ASP. NET database connection class ClassConn and oledb database connection method
  3. Implementation of ASP. NET database Driver Class: DBHelper
  4. ASP. NET database operation class written in C #
  5. ASP. NET database image storage to Sql2000

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.