Showing posts with label Receive Port. Show all posts
Showing posts with label Receive Port. Show all posts

Friday, September 19, 2008

Tip: Error Handling

Situation:
I had 2 receive locations (1 Receive Port).
Each receive location did validation of a schema in the XmlReceive Pipeline
When an invalid message arrived, i wanted to send an email to the helpdesk and copy the incoming message in the error directory.

I had enabled routing for failed messags in the Receive Port



I created a send port group, adding filter BTS.ReceivePortName = the ReceiveLocation
+ ErrorReport.ErrorType exists.

Problem:
When an invalid message arrived at the location, I received error entries in the eventlog, but the email nor the copy was processed.

Solution:
I changed the filter to ErrorPort.ReceivePortName = receivelocation



It worked great.

Wednesday, August 20, 2008

Schema Validation at Port level

Situation:
When receiving a message at the Receive Port (Location). BizTalk isn't really validating the incoming Xml against th Xsd.

What is happening is that BizTalk looks at the NameSpace + Root Element, place it in the MessageBox and the Orchestrations will pick it up.

But in meany cases, we want to validate the incoming Xml and be sure that the Xml corrspond to the Xsd

Solution:
- On the receive port, select the XmlReceive Pipeline



- Click on th Properties of the XmlReceive Pipeline
- Set ValidateDocument to true
- Fill in the DocumentSpecNames property



How to find the DocumentSpecNames Value ?

- In the BizTalk Admin Console, go to the BizTalk Application
- Click on the Schemas
- Got to the properties of the Schema you want to Validate
- Concatenate the value of Name and Assembly, using a comma

[Name Value],[Assembly Value]



When using this method, the incoming Xml file will be validated against the given schema. When an error occured in th validation, an error will be written to the eventlog.