Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Construct Message from Orch Parameters

Construct Message from Orch Parameters

Construct Message from Orch Parameters

I am not sure what I am doing wrong.
I have four variables that are passed to an orchestration.
I have a message within that orchestration called ErrorNotice.
I want to assign the four variable parameters to the corresponding fields in the error notice message.
The message fields are promoted as distinguished fields.
This is the code I am using now:
ErrorNotice = new System.Xml.XmlDocument();
//Message.Field = Parameter
ErrorNotice.ErrorCode = ErrorCode;
ErrorNotice.ErrorDescription = ErrorDescription;
ErrorNotice.ErrorLocation = ErrorLocation;
ErrorNotice.ErrorResolution = ErrorResolution;
This code is generating the following error
Microsoft.XLANGs.RuntimeTypes.XPathUpdateException: A failure occurred while evaluating the distinguished field ErrorCode against the message part data. The message part data does not contain at least one of the nodes specified by the XPath expression (listed below) that corresponds to the distinguished field. The cause for this error may be that the message part data has not been initialized or that the message part data does not conform to the message part schema. Ensure that the message part data is initialized correctly.

XPath expression: /*[local-name()='ErrorNotice' and namespace-uri()='http://BHPB.E2E.Schemas.Common_ErrorNotice']/*[local-name()='ErrorCode' and namespace-uri()=']

   at Microsoft.XLANGs.Core.XSDPart.SetDistinguishedField(String dottedPath, Object val)

   at BHPB.E2E.Orchestrations.Common_ErrorNotice.segment1(StopConditions stopOn)

   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

Any assistance would be greatly appreciated.

RE: Construct Message from Orch Parameters

Did you try to assign a template to the message rather than declaring it as XmlDocument. I would think that there is the error. An XmlDocument is not the same as a BizTalk Message. It misses all of the Property Bag where your distinguished fields are located. So what you could try is that:

Orchestration Varibale of Type XmlDocument myTempXml
Orchestration Message of Type ErrorNotice myErrorNotice

Then in your first Expression Shape go
myTempXml = new System.Xml.XmlDocument();

Then you need a create Message Shape, and an assign Message Shape.
In you assign Message shape do this:
myErrorNotice = myTempXml;
myErrorNotice.ErrorCode = ErrorCode;
myErrorNotice.ErrorDescription = ErrorDescription;
myErrorNotice.ErrorLocation = ErrorLocation;
myErrorNotice.ErrorResolution = ErrorResolution;

You also want to have at look at this blog entry:




RE: Construct Message from Orch Parameters

Thanks heaps for that Stephan,

Does the instantiated XmlDocument, myTempXml,have to contain the same schema as myErrorNotice.
Or can I just include the root node like you have above.

Thanks again for your assistance.


RE: Construct Message from Orch Parameters

I have answered that myself now.
I had to include the elements that I wished to assign variables to.
I have this working now and have very much appreciated your assistance.
It seems a little convoluted to have to create a xml doc with the message structure to assign to hte message in order to use this feature.
It means that I have to maintain the schema in two places.

Thanks again

RE: Construct Message from Orch Parameters

I know it is weird that creating a new message is sooo difficult in BizTalk. Maybe they fixed that in the 2006 edition, that will be released this fall. ;)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close