Problem with running method from orchestration

Home Page Forums BizTalk 2004 – BizTalk 2010 Problem with running method from orchestration

Viewing 1 reply thread
  • Author
    Posts
    • #12514

      Hello,

      I have a simple orchestration with 3 shapes, a Receive, Send and an Expression shape. Also I got a class with a simple method that just writes a line to a text file. The class has a strong name and I installed it into GAC with gacutil. Also I’ve added the reference of the class.
      The problem is that when I run the orchestration, I put some file in the input folder (the pipelines are passthru), the file disappears and that’s it, no further actions. The file does not appear in the output folder and there are no any actions from my method, also there are no errors or exceptions in Administration Console.
      But if I delete the Expression shape, leaving just Receive and Send shapes, the file is sent to output folder.

      Here is the code from Expression shape:
      MailVar = null;
      MailVar.TestFunc(\”Launch.\”); //MailVar is the variable of my custom class

      And here is the code of my method:
      public void TestFunc(string launcher)
      {
      FileStream fout;
      fout = new FileStream(@\”C:\\BTalk\\MailTest\\new.txt\”, FileMode.Create);
      StreamWriter fstr_out = new StreamWriter(fout);
      fstr_out.Write(launcher);
      fstr_out.Flush();
      fstr_out.Close();
      }

      Does anyone have an idea why it’s not working ?
      It would be very nice, if anyone can help me.

      Thanks a lot.
      Roman.

    • #12515

      Thanks for the answer Greg,

      I tried the following:
      MailVar = new <MyNamespace>.<MyClass>();
      MailVar.TestFunc(\”Launch.\”);

      But, unfortunatelly, the same situation with no result.
      What could it be?

      Roman.

      • #12516

        Yes, the class is marked as serializable.

        And thanks for idea about using static methods, everything worked fine!

        Thank you very much Greg.

        • #12517

          Try this in the expression shape:

          MailVar = new <Your Namespace>.MailVar();
          MailVar.TestFunc(\”Launch.\”); //MailVar is the variable of my custom class

          • #12518

            Is your .NET class marked as serializable?
            If not is the expression shape inside an atomic scope?

            Are you submitting more than one message at a time or does the new.txt file already exist?

            What error message results in the event log?

            Have you considered a static method, i.e. no object instance required
            and expression shape code should be:
            <yournamespace>.<yourclass>.TestFunc(\”Launch.\”);

            Greg

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.