I have a couple of questions about exposing the web service activities in a runtime-compiled worklfow:
1. If my .xoml workflow definition includes a couple of WebServiceReceive and WebServiceResponse activities and I compile it in runtime with a WorkflowCompiler object, are the appropriate web services and methods going to be generated As I understand, in VS.NET the web service is generated when the project is being compiled.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
2. If a composite custom activity is composed of a WebServiceReceive and WebServiceResponse methods and I use it in some workflow, is the web service going to be generated when the workflow is compiled What about in the black-box scenario (WebServiceReceive.Visible=false)
3. The parameters of runtime-defined workflow are not known in advance, so we're forced to use a generic class as a parameter of the method that the generated web service will implement. Is it possible to map the workflow parameters to, for instance, an item in a name-value collection What about to a custom class property Can we use XPath queries for mapping in case the method parameter in interface is of type XmlNode
4. Is it possible to customize the web service generation process like in ordinary ASP.NET web services, for instance with the XmlElementAttribute or with the SoapExtensionReflector
5. What approach would you suggest for runtime-defined workflows which include web services Is it better (or maybe even necessary) to develop a custom generic web service which communicates to workflow instances (using data activities or local services)
Thanks,
Bogdan

Web services and runtime compilation
bbonnifield
Thanks, your answers were really helpful.
Bogdan
Daniel Dosen&#58; XML Commerce
I think I understand how you're trying to bind paramters from the webservice calls. The crux of the problem lies in the fact that the all the workflows are created dynamically, at runtime. How are the generated webservices going to be invoked, and by whom Although technically its feasible to pack all the parameters into a Name/Value collection or Dictionary, this would certainly be difficult for the consumer of the service. Could you shed any light on the requirements and context of your application Maybe we can think of a better way to integrate workflow into it.
Arjun
Rob Davis
1. Yes, the proxy should be generated with the class name [Workflow Name]_Service.
2. Yes, the web service will be generated even if the receive is defined in the custom activity. By the way, in Beta2, all custom activities will appear as black boxes, unless they are pure composites.
3. I don't think I followed your question here - could you elaborate Are you trying to bind a workflow parameter to a workflow property/variable
4. See http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=92524&SiteID=1.
5. What issues are you running into when using WS-activities with runtime generated workflows If they are being generated against well-known interfaces, then I think you should be okay. Deployment might be one of the issues you enocunter; you'll have to ensure that the generated assembly is correctly hosted by ASP.NET. If you don't want to deal with individual deployment, then the generic web service route might be more appealing. I'm not sure if I'm fully addressing your question - if not, could you detail the architecture of the system you're building
Thanks!
Arjun
Espen G&#228;tzschmann
3. I don't think I followed your question here - could you elaborate Are you trying to bind a workflow parameter to a workflow property/variable
I'm trying to bind WebServiceReceive method parameters (defined in an interface) to workflow parameters. Is there anything else we can do here besides a simple one to one mapping For instance:
- If a method parameter is of custom type TimeInterval, can we map the TimeInterval.From to a workflow parameter VacationStart
- If a method parameter is a name-value collection, can we somehow map one of the collection items by its name to a workflow parameter
- If a method parameter is XmlNode, can we use XPath queries for mapping
In the IDE there is a Parameters property group, which contains each of the method parameters. It's not clear when and how exactly the Path property should be used.
Can we somehow use the ParameterBindings runtime property to do a more complex binding
Maybe it seems that there is no need for a complex mapping. But think about the runtime-defined .xoml definition of workflow. In design time, we have no knowledge of workflow parameters nor WebServiceReceive method parameters. All we could do is define a generic enough interface method and parameters to be used in every WebServiceReceive activity that will be defined in runtime. But we're not allowed to do that either because two WebServiceReceive activities in the same workflow can't use the same interface method (web methods are named after the interface methods instead of after the activity names, and we get one web method only for each of the used instance methods). It looks like customizing the web service generation process (with a WebServiceCodeGenerator as in the sample under the answer #4 ) is the only solution here.
5. What issues are you running into when using WS-activities with runtime generated workflows If they are being generated against well-known interfaces, then I think you should be okay.
That's my problem exactly. The interfaces are not well-known in design time. The workflow is defined completely in runtime, including the workflow and method parameters.
Deployment might be one of the issues you enocunter; you'll have to ensure that the generated assembly is correctly hosted by ASP.NET.
I didn't cross my mind, but yes, the WorkflowCompiler will probably only generate and compile the base class which needs to be inherited and armed with an .asmx file. That means some additional runtime code generation and compilation.
If you don't want to deal with individual deployment, then the generic web service route might be more appealing.
I'll wait for the Beta2 and make some prototypes. I'll be easier for me to decide about the final solution architecture then.
Regards,
Bogdan