BizTalk - WMI script to publish the message to message Box - biztalk

I am trying to publish a message to BizTalk message box using a WMI script . Basically, I am reading the message from non resumable instance. I need to publish this message back to message box instead of saving as file.
Is there a way to achieve this?

Actually, MQ would probably work for you. What you can do is 'encode' the properties and write them to the MSMQ Label property for example.
Then, you can use a custom Pipeline Component on the Receive Location that 'decodes' the MQ property and re-writes the message context properties.
I've done similar in the past and it works just fine.

Related

NServiceBus MessageDeserializationException on DataBusProperty<byte[]>

We have an NServiceBus 6 environment with a number of services that send files between each other using DataBusProperty over a custom SqlDataBus : IDataBus.
This works fine on NSB6 using the built in JSON serializer, but is now broken after we moved to NSB7 and the NewtonsoftSerializer.
Removing DataBusProperty from our classes and just using byte[] works fine. We also tried changing the DataBus to FileShareDataBus but got the same exception:
NServiceBus.MessageDeserializationException: An error occurred while attempting to extract logical messages from incoming physical message c7b5cd47-c1b7-4610-9f6c-aa7800cc9b64 --->
Newtonsoft.Json.JsonReaderException: Error reading bytes. Unexpected token: StartObject. Path 'Data.Key', line 1, position 68.
This fails even if a service is sending messages to itself. Also we can see the files written to the file store, whether on Sql or File Share, so they're serializing fine.
An example payload from the error queue is
{"ExecutionId":"1db85105-a71c-4b29-87da-9b7ae6518c1c","Data":{"Key":"2019-06-26_13\\6a2b63c7-12b0-46dd-8b92-f1fc743d27c1","HasValue":true}}
How can we get this to deserialize in NSB7+NewtonsoftSerializer when it works fine in NSB6+JsonSerializer?
Thanks
I just spent about 8 hours trying to figure out what was going on, and realized, that for whatever reason, NSB7 wants a paramaterless constructor and settable properties. I am going back to Particular to see if this change is expected, but I expect we will have to adjust all of our message classes to fit that paradigm.
Although data bus properties should work there is also an alternative to data bus properties which is using stream attachments via send options:
https://docs.particular.net/nservicebus/messaging/attachments-sql
Depending on the use case using Streams might be a more efficient approach.

No output (send part) on BizTalk pipeline

I have built a flatfile schema with the flatfile schema wizard.
The schema is valid and I could successfully validate my test instance against the schema.(So the XML file was created correctly).
But when I put my test flat file into a receive location that uses a flatfile disassembler pipeline, nothing happens after the receive location has picked up the message (the logical receive port is bounded to an orchestration)
In the BizTalk Admin Console I only see in the tracked message events from the pipeline that the message has been received. But not sent.
Maybe some of you already had a similar issue and could help me here.
Tracked message events in the pipeline
So. The issue was a wrong declared header schema. I have rebuild it and after that it was working fine.
I have recognized the issue by removing the header schema from the pipeline properties and trigger a new process. At this time the message was created correctly (but with the header line due to a missing header schema that would prevent that line).
Thanks to all who helped here!

No eventlogs from BizTalk

I've got a new production computer and installed my BizTalk app on there. The problem is that I don't see any messages in the event log, nor from my BizTalk app or BizTalk Server itself. The only message that appears in the event log is the following:
The following BizTalk host instance has initialized successfully.
BizTalk host name: BizTalkServerApplication
Windows service name: BTSSvc$BizTalkServerApplication
The source of that message is BizTalk Server. And no messages at all, even no logs about errors which I suppose already took place.
Just a quick thought incase you are still having problems.
I tried to write to the event log with a source type that didnt already exist and my BizTalk Host user account didn’t have permissions to create a new source type. This meant I never saw the entry in the event log.
E.g. (from example #Bill Osuch)
System.Diagnostics.EventLog.WriteEntry("MyBiztalkApp", "oh i did something");
Make sure either the MyBiztalkApp source exists or that your user has permissions on the event log to create it.
Also, if you have a lot of messages going through BizTalk you will probably want to implement your own logging so your event log doesn’t fill up. We used Log4Net for our implementation and a database to store messages.
If you're not getting any errors (suspended messages) as the messages process, you're not going to see anything in the app log. You could try adding an Expression shape to your orchestration and manually writing out some debug info:
System.Diagnostics.EventLog.WriteEntry("event type", "whatever...");
Does your application actually use the BiztalkServerApplication host? Check in the Biztalk Administration Console if all the host instances are indeed running. Is your application fully started? Messages are "put on hold" if your receive location is disabled for example.
To check this functionality, write to event log after every operation or shape in BizTalk orchestration.
Scenario-
Suppose you have to assigned a value to xpath of node in a map after transformation so in message assignment shape after you assign some value, you can write eventlog to admin console.
Ex. Suppose we have already initialized - "orderType" as "PO" in our expression shape and now we have to assign the value of "orderType" to the xpath of a node in our map then-
Shape- MessageAssignment(Under constructMessage Shape after transformation of map)
xpath(msgGetOrderReq, "/[local-name()='CustomerOrders' and namespace-uri()='http://example.com/EAI/IEmployee/v1.0']/[local-name()='ordertype' and namespace-uri()='http://example.com/EAI/IEmployee/v1.0']") = ordertype;
Next to this we want to print this information on the admin console so we need to write:-
System.Diagnostics.EventLog.WriteEntry("msgGetOrderReq", ordertype, msgGetOrderReq);
Build the project, Deploy and GAC it. Restart the host instance. Run the orchestration, process something and now you will be able to see the logs in admin console.
Regards
Mayank

Biztalk Message Promotions

I'm relatively new to Biztalk and I'm having a bit of hassle with this:
I have built a simple orchestration, hooked it up correctly to a receive port, I'm using the correct schema and map and the orchestration seems to be subscribing ok.
However, when the file I want to process gets picked up at the port I'm getting the 'could not be routed because no subscribers were found' error.
I ran a HAT query and can see the orch has an active subsription to the correct thing, is there anything else I can check on this?
Is your port hooked directly to the orchestration or is the orchestration picking the message up from the message box? Has the orchestration receive been set to Activate?
What does your subscription filter look like for the orchestration?
As a futher test:
a) create a sendport (FILE)
b) add a filter to it; BTS.ReceivePortName =
c) grab the resulting file - it should be the XML thats produced by your Custom PL
d) Use this file with a receive location using an XML Receive PL and see how your orchestration reacts to
This will at least rule out a Pipeline issue...
HTH
Check your pipeline is XMLReceive. This will promote the MessageType property and hopefully your orchestration will subscribe successfully.
Find the failed message in HAT and look at the body of the message. Copy it out and then run validate it against the schema of the message you are expecting. If it doesn't validate then you have set your flat file disassembler up incorrectly.

configuring error messages in flex application

I'm trying to create a Flex based internet application with an EJB layer in the server. This layer provides the XML used by the flex application. It uses the Cairngorm architecture. Currently, on an error I call the handler function defined in all the command files. How can I centralize this?
My idea is to create a XML file that contains all the error messages and the types of error message eg:- Warning, Error etc. In the error handler, I will call the error handling function and pass a unique id which in turn will display the error message defined in the xml config file. Do I need to load this XML file in the Model layer of the application itself and store them as say global variables?
Please suggest me ideas on overriding the Alert box so that I can create Warning alert, Error alert etc.
Load the xml file when the app loads, and store the messages on a model. When you need to fire off an error message, you can fire the appropriate event, and you can have a command that pulls the right one from the model and displays it. Alert is definitely the way to go if you want to have a command open a window.
The better (but harder) option is to have a view that binds to a model, which model has a property like "hasError" and "errorMessage", so if hasError gets set to true, the view opens a custom popup.
TitleWindow is not good enough?

Resources