Workflow - Same Contract used in two service - Conversion problem RRS feed

  • Question

  • Hello,

    I'm trying at the moment to use WF to create a basic Workflow, and face a conversion problem. Here's the setup :

    • Service 1 : Create objects based on a defined Data Contract
    • Service 2 : Apply an operation on objects of type defined in service 1. Service 1 is imported as Service reference.

    I created a simple Workflow which imports both services. It first call Service one to get an object, and then send it to Service 2 to apply the operation. But when I try to do this I receive an error of type : 'WF.Service1.Entity' cannot be converted to 'WF.Service2.Entity'. The Contract used is only defined in the Service 1 and reused in Service 2, so it's the same object. The only difference is in the proxy client generated which creates both definitions, each one in it's specific namespace (Service1 and Service2).

    Do you see any solution to this situation ? Except creating an activity that copy every property from one object to another :-)

    P.S. : I uploaded the basic setup here : http://www.mediafire.com/?e6j9c2dv4rvcdoh

    Thursday, September 16, 2010 9:23 AM


  • There is an Advanced dialog in 'Add Service Reference ...' dialog. Before you do Add Service Reference,  you can check the 'Reuse types in all referenced assemblies' in that dialog. Then generated service proxy will reuse the Contract1 from referenced assembly instead of creating a new one. Note: You should add reference to the assembly which contains Contract1 before doing Add Service Reference.

    Friday, September 17, 2010 1:45 AM