locked
Silverlight + WCF Service (WF4) RRS feed

  • Question

  • Hi,

    In my scenario: Silverlight app, Workflow , where I call (in Silverlight) the workflow as a WCF service

    When I call the workflow in Silverlight:

    private void OKBtn_Click(object sender, RoutedEventArgs e)

     

    {

     WorkFlow.ServiceClient proxy = new WorkFlow.ServiceClient();

            proxy.CriarProcessoCompleted += new EventHandler<WorkFlow.CriarProcessoCompletedEventArgs>(WFProcesso);

            proxy.CriarProcessoAsync(12345);

    }

     

     

    void WFProcesso(object sender, WorkFlow.CriarProcessoCompletedEventArgs e)

    {

    }

    When it enteres in WFPRocesso it gives this error:

     

     System.NullReferenceException ->  {"Object reference not set to an instance of an object."}

     

    But if I debug the Workflow, and go step by step till the end it doesn't give any error!!

    Is there any way to force the call to wait till the workflow finish?

     

    Thanks,

    BeFFes



    Thursday, July 21, 2011 10:02 AM

Answers

All replies

  • Hi all,

     

    I've been checking with Fiddler2 and it gives the error:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

    <s:Body>

    <s:Fault>

    <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">

    a:TransactionAborted

    </faultcode>

    <faultstring xml:lang="pt-PT">

    The transaction under which this method call was executing was asynchronously aborted.

    </faultstring>

    </s:Fault>

    </s:Body>

    </s:Envelope>

     

    Thanks

    Monday, July 25, 2011 2:05 PM
  • I just narrow the problem to a codeactivity in the Workflow.

     

    So the problem is when i try to open a connection to a oracle database (using devart dotconnect)

     

    ....(code)...

    protected override void Execute(CodeActivityContext context)

    {

    OracleConnection oConn = new OracleConnection("Data Source=ora;User Id=utiliz;Password=pass;");

     oConn.Open();

     oConn.Close();

    }
    If I run the workflow step by step no problem, but if i call via silverlight I get a crash from aspnet_wp.exe with System.NullReferenceException

     

    What can I do to resolve this problem?



    Thursday, July 28, 2011 3:07 PM
  • Hi,

    ->"If I run the workflow step by step no problem, but if i call via silverlight I get a crash from aspnet_wp.exe with System.NullReferenceException"
    Is there a BeginOpen and EndOpen method? if yes, you can try this synchronous openning method.

    Regards

    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Monday, August 1, 2011 10:28 AM
  • Hi,

     

    I think I've found the problem, the driver I'm using to connect to Oracle is dotConnect for Oracle from Devart and I found in theirs forum a similiar issue, so I'm waiting for a test machine so I can try this new update (I have a previous version) and close this issue.

     

    possible solution:

    http://www.devart.com/forums/viewtopic.php?t=19993&sid=6b4ea16310112bca8bd099509f876404

     

    Thanks,


    • Proposed as answer by Andrew_Zhu Tuesday, August 2, 2011 1:26 AM
    • Marked as answer by Andrew_Zhu Tuesday, August 2, 2011 1:26 AM
    Monday, August 1, 2011 11:06 AM