Using a BizTalk orchestration to call .NET class library to read xml when there is new xml file in the directory

一笑奈何 提交于 2019-12-13 05:39:52

问题


I have set up receive message and receive port to monitor for XML files. I also added expression shape to execute .NET class library by using

System.Diagnostics.Process.Start
        (@"C:\TEMP\XmlReader\XmlReader\bin\Release\XmlReader.exe");

When I deploy the BizTalk, as soon as new file gets received on the receive location, file disappears and nothing happens. I have other orchestration project with receive and send port where the file disappears and does not move to send location


回答1:


I am not sure I am following your logic. However, assuming that you have correctly set up a subscription between the orchestration and the message published by the receive port. By the time the orchestration is activated, the original file system XML is gone forever. In fact it is gone once the receive location is enabled and consumes it. So if you are trying to manually read the original XML file off the file system, from the orchestration, you will not be successful.

BizTalk has some pitfalls, when in doubt, stick to the incremental approach;

  1. Create/Enable the receive port and location straight from the administration console (forget VisualStudio for now).
  2. Pass in an XML (or whatever)
  3. Use the management console to see if any message were created and what their status is.
  4. Create the orchestration that includes

    System.Diagnostics.Debug.WriteLine()

    statements, subscribe it to the receive port.

  5. Drop in a message and use DebugView to see the output from the WriteLine method calls.



回答2:


If I'm not misunderstanding you, you are using a custom xmlreader.exe to read Xml documents and submit them to a BizTalk Orchestration. This is exactly what a BizTalk Receive Port + Receive Location (+ XmlPipeline) will do for you.

To me your problem looks as if your xmlreader.exe and your BizTalk Receive Port + Receive Location are working against each other.

If you have to do special processing on incoming Messages you need to create a Pipeline Component.

Check your BizTalk Admin Console - I'll bet you'll find all your received messages suspended because your Orchestration didn't pick them up.



来源:https://stackoverflow.com/questions/5233838/using-a-biztalk-orchestration-to-call-net-class-library-to-read-xml-when-there

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!