Error Biztalk server Orchestration while creating dummy message and passing it to BRE.

HI,

1) i have a input message with schema structure as XML. The input message is received from 3 different sql servers. based on teh receive location from which i got i need to assign into variable and pass as input paramater to BRE.

2) from BRE receive location as input i need to return two values as output of BRE( SiteID and URL Name) which are used to build dynamic Port for HTTP.

i am getting below error in the starting Message assignment shape . can anyone help me out this scenario with some code and process.

Error: xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'BP.BizTalk.PCTASToMOBILDelivery.Orchestrations.Orchestration_PCTAS_to_MOBILDelivery(d8bb2101-16b3-b5fa-bfe0-bc90498b4d6b)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 6301411f-64b7-4f9b-a275-ab9ebd6e66fa
Shape name: Construct_BRERequest
ShapeId: cb0470de-795b-4145-85f7-f6e4afd1d605
Exception thrown from: segment 2, progress 11
Inner exception: Expression must evaluate to a node-set.
        
Exception type: XPathException
Source: System.Xml
Target Site: System.Xml.XPath.XPathNodeIterator Select(System.Xml.XPath.XPathExpression)
The following is a stack trace that identifies the location where the exception occured

   at System.Xml.XPath.XPathNavigator.Select(XPathExpression expr)
   at System.Xml.XmlNode.SelectNodes(String xpath)
   at Microsoft.XLANGs.Core.Part.XPathStore(Object rValue, String xpath)
   at BP.BizTalk.PCTASToMOBILDelivery.Orchestrations.Orchestration_PCTAS_to_MOBILDelivery.segment2(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

Code in the Message assignment shape :

msg_Snd_BRERequest  = new System.Xml .XmlDocument ();
msg_Snd_BRERequest .LoadXml("<Request><InboundLocation></InboundLocation><SiteID></SiteID><DynamicURL></DynamicURL><PCTASMessage></PCTASMessage></Request>");
Var_InboundURL = Msg_Rcv_PCTAS(BTS.InboundTransportLocation );
System.Diagnostics.EventLog.WriteEntry("SNA Migration", Var_InboundURL );

xpath (msg_Snd_BRERequest , "/Request/InboundLocation")= Var_InboundURL ;

July 15th, 2013 10:00pm

Bala, I think this problem is being caused because you are trying to execute the XPath on variable. All you have to do is in your orchestration create a message, e.g. with name MsgXmlDoc, of type Syste.Xml.XmlDocument and then try to set the value by passing this message to XPath:

msg_Snd_BRERequest  = new System.Xml .XmlDocument ();
msg_Snd_BRERequest .LoadXml("<Request><InboundLocation></InboundLocation><SiteID></SiteID><DynamicURL></DynamicURL><PCTASMessage></PCTASMessage></Request>");
Var_InboundURL = Msg_Rcv_PCTAS(BTS.InboundTransportLocation );
System.Diagnostics.EventLog.WriteEntry("SNA Migration", Var_InboundURL );

construct MsgXmlDoc
{
 MsgXmlDoc = msg_Snd_BRERequest;
}


xpath (MsgXmlDoc , "/Request/InboundLocation")= Var_InboundURL ;

Free Windows Admin Tool Kit Click here and download it now
July 15th, 2013 11:13pm

Hi sharma,

 thanks for the reply but i am getting error while building he orchestration as "Unexpected word construct " in the message assignment shape. can you please suggest what can be done.

July 16th, 2013 12:50am

xpath (msg_Snd_BRERequest , "/Request/InboundLocation")

This will result in a nodeset and you cannot assign values to a nodeset. However is you were to use the following expression it would give you access to the InnerText property of the node and allow you to assign the variable

xpath (msg_Snd_BRERequest , "string(/Request/InboundLocation)")= Var_InboundURL;

Note the "string(XPATH)" which provides the InnerText.

Regards.

Free Windows Admin Tool Kit Click here and download it now
July 16th, 2013 1:02am

Bala if you are using the message assignment shape then you can construct the message using the enclosing construct shape and can just assign the value of msg_Snd_BRERequest to the constructed message.
July 16th, 2013 5:34am

Bala,

You cannot assing value using xpath function. Please read through this on msdn.

xpath function can be used only for reading values it cannot be used for assinginig values. If you want to assign a value you much either mark that field as Promoted property or distinguished property and assign it using Message Construct + Message Assignment shape.

On the other hand You can rearrange/ modify your statements  as follows:

Var_InboundURL = Msg_Rcv_PCTAS(BTS.InboundTransportLocation);
msg_Snd_BRERequest = new System.Xml.XmlDocument();
msg_Snd_BRERequest.LoadXml("<Request><InboundLocation>" + Var_InboundURL + "</InboundLocation><SiteID></SiteID><DynamicURL></DynamicURL><PCTASMessage></PCTASMessage></Request>");
System.Diagnostics.EventLog.WriteEntry("SNA Migration", Var_InboundURL);

Free Windows Admin Tool Kit Click here and download it now
July 16th, 2013 9:22am

Hi,

Thanks for the suppport and solutions provided. assigning of values issue got resolved as of now and i am able to call the BRE from orchestration and fetch the response.

1) can you please let me know with some line of code to convert system.datetime.now to DDHHMMSS format  in the orchestration.

2) when i am sending files from Dynamic HTTP send port i am getting "The remote server returned an error: (500) Internal Server Error."

i had assigned "Msg_Snd_MOBIL (HTTP.ContentType )= "Text";" property in the message assignment shape before sending. can you please suggest how to resolve this.

Thanks for the Support and responses providing by you.

July 16th, 2013 8:00pm

@balagangadhar:

please, mark the correct answer it there is any or provide the solution!

Free Windows Admin Tool Kit Click here and download it now
July 17th, 2013 1:18am

For your new questions, please see my answer in this thread:

http://social.technet.microsoft.com/Forums/en-US/27ba2ac1-c410-456c-8d16-a07a346a30cb/facing-error-while-sending-files-from-orchestration-using-dynamic-send-port

July 17th, 2013 7:23am

HI,

i am using Dynamic HTTP Send Port.i am passing the URI from Message assignment shape as shown below with Query string.but, i am receiving the" [500] internal server Error".

The remote server returned an error: (500) Internal Server Error.

Here is the Dynamic URI generated in the context property of Biztalk.can you please let me know the resolution for this.

OutboundTransportLocation          http://161.100.78.88/BP.BizTalk.Mobil/BTSHTTPReceive.dll?sitecode=QCD&filename=18173558.TAS   Promoted       http://schemas.microsoft.com/BizTalk/2003/system-properties

 

Here is the code written in the orchestration. Does Bts.HTTPReceive.dll support query string? if not how to acheive it to add dynamically query string.

// Set base properties

BP_BizTalk_PCTASToMOBILDelivery_SendtoMOBIL(Microsoft.XLANGs.BaseTypes.Address) = Var_MOBIL_URL+"?"+"sitecode="+Var_SiteID+"&filename="+var_Date+".TAS" ;

 

BP_BizTalk_PCTASToMOBILDelivery_SendtoMOBIL(Microsoft.XLANGs.BaseTypes.TransportType) = "HTTP";

 

// Set HTTP adapter specific properties

Msg_Snd_MOBIL(HTTP.AuthenticationScheme) = "Anonymous";

Msg_Snd_MOBIL(HTTP.RequestTimeout ) = 10;

 

Msg_Snd_MOBIL (HTTP.ContentType )= "Text";

Msg_Snd_MOBIL (HTTP.MaxRedirects ) = 5;

 

 

Free Windows Admin Tool Kit Click here and download it now
July 18th, 2013 3:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics