locked
Add Workflow service to existing ASP.NET application RRS feed

  • Question

  • I have an existing application with WCF AJAX enabled web services. I am trying to add the bindings and enpoints needed to host a WCF Workflow along side the other services and I am breaking both services.

    Is there a guide to hosting more than one service type in the same web application?  I know that my problem is web config related.

    Tuesday, December 14, 2010 1:14 AM

Answers

  • I am not sure what the contract name should be.

    In Workflow Service, operation/service contract is exposed from Receive activity. Receive has a property "ServiceContractName", you can configure it to your own contract name if you want. The default value is "{http://tempuri.org/}IService", which means the contract name is "IService", namespace is http://tempuri.org

    I am not sure what the service name should be (There does not even appear to be an .svc file for WF services)

    You can find the Service name either from xamlx file (open xamlx in Xml Editor, you will find something like,

    ConfigurationName

     

     

    ="Service1", this is the name you can use in configuration file) or in designer click the margin outside any activities, you can find ConfigurationName property from Properties window.

    The Bukovics book for WF 4.0 says to use wsHttpBinding

    You can use any binding like basicHttpBinding. If you do not configure workflow service at all, it will use basicHttpBinding by default.

    I am not sure how to modify the <serviceHostingEnvironment> for the addition of the service.

    No need to update for workflow service.

    Wednesday, December 15, 2010 10:22 PM

All replies

  • Maybe I need to clarify a bit.  Most if not all tutorials on WF show the workflows running in a development environment using what is commonly referred to as the "Cassini Server" and they say that deploying to IIS is beyond the scope of their demonstration.

    I have an application currently running in IIS which already is hosting a WCF AJAX service which I am accessing with som JQuery calls. I now need to add a WCF WorkFlow Service to the application and have the Webconfig below.

    1. I am not sure what the contract name should be.
    2. I am not sure what the service name should be (There does not even appear to be an .svc file for WF services)
    3. The Bukovics book for WF 4.0 says to use wsHttpBinding
    4. I am not sure how to modify the <serviceHostingEnvironment> for the addition of the service.

    I came up with this almalgamation for the Webconfig based on the book.  I am not not sure if I am doing it right.  I just need some guidelines for adding this WF service to an existing application.

    	<system.serviceModel>
    		<behaviors>
    			<serviceBehaviors>
    				<behavior name="MyWorkflowTypeBehaviors" >
    					<serviceMetadata httpGetEnabled="true" />
    				</behavior>
    			</serviceBehaviors>
    
    			<endpointBehaviors>
    				<behavior name="EHSRiskAuditWeb.EHSAuditWCFAjaxServiceAspNetAjaxBehavior">
    					<enableWebScript/>
    				</behavior>
    			</endpointBehaviors>
    		</behaviors>
    		<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
    		<services>
    			<service name="EHSRiskAuditWeb.EHSAuditWCFAjaxService">
    				<endpoint address="" 
    						 behaviorConfiguration="EHSRiskAuditWeb.EHSAuditWCFAjaxServiceAspNetAjaxBehavior" 
    						 binding="webHttpBinding"
    						 contract="EHSRiskAuditWeb.EHSAuditWCFAjaxService"
    						 bindingConfiguration="AJAXBinding" />
    			</service>
    			<service name="EHSRiskAuditRecurringServices">
    				<endpoint 
    						 
    						 binding="wsHttpBinding" 
    						 bindingConfiguration="EHSWorkflowBinding"
    							contract="IService"
    						 address="WorkFlowServices"						 />
    			</service>
    		</services>
    		<bindings>
    			<webHttpBinding>
    				<binding name="AJAXBinding">
    					<security mode="None">
    					</security>
    				</binding>
    			</webHttpBinding>
    			<wsHttpBinding>
    				<binding name="EHSWorkflowBinding">
    					<security mode="Message">
    						<message clientCredentialType="Windows"
    								 algorithmSuite="TripleDesRsa15"
    								 establishSecurityContext="true"
    								 negotiateServiceCredential="true" />
    					</security>
    				</binding>
    			</wsHttpBinding>
    		</bindings>
    
    	</system.serviceModel>
    
    
    Tuesday, December 14, 2010 8:02 PM
  • I am not sure what the contract name should be.

    In Workflow Service, operation/service contract is exposed from Receive activity. Receive has a property "ServiceContractName", you can configure it to your own contract name if you want. The default value is "{http://tempuri.org/}IService", which means the contract name is "IService", namespace is http://tempuri.org

    I am not sure what the service name should be (There does not even appear to be an .svc file for WF services)

    You can find the Service name either from xamlx file (open xamlx in Xml Editor, you will find something like,

    ConfigurationName

     

     

    ="Service1", this is the name you can use in configuration file) or in designer click the margin outside any activities, you can find ConfigurationName property from Properties window.

    The Bukovics book for WF 4.0 says to use wsHttpBinding

    You can use any binding like basicHttpBinding. If you do not configure workflow service at all, it will use basicHttpBinding by default.

    I am not sure how to modify the <serviceHostingEnvironment> for the addition of the service.

    No need to update for workflow service.

    Wednesday, December 15, 2010 10:22 PM