Forum Replies Created
-
AuthorPosts
-
I’m having the same issue. I tried the way what you said above but still no success. Do you know any other reason?
Thanks,
Raja KumaravelOctober 6, 2009 at 2:58 PM in reply to: Evaluating on the amount of items returned in a message #23416Hi Daniel,
Syntax still an issue:
Thanks for a link to the tool
Kind Regards,
Grant
October 6, 2009 at 2:34 PM in reply to: Evaluating on the amount of items returned in a message #23415Hi Grant,
1. Try the following to see if this works:
vXmlNodeList = xpath(BACSRemittanceMsg, “/*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”][” + System.Convert.ToString(nLoopCount) + “]”)
Also, you might want to download and install this tool from the following link:
http://www.bizbert.com/bizbert/2007/11/25/DanSharp+XmlViewer.aspx
It helps with pinpointing and validating XPath expressions and queries from XML data that you load into it. I found it useful when doing certain projects in BizTalk using XPath.
2. No, you do NOT need that statement in your code anymore: MyVar = MyVar + “<BACSBody>”+sbRemitMsg.ToString()+”</BACSBody>”;
I hope this all works out for you.
Daniel.
October 6, 2009 at 2:15 PM in reply to: Evaluating on the amount of items returned in a message #23414Daniel,
I am really greatful for all your help:
1. still get the same syntax error:
2. If I have to construct the message as MyVar = MyVar + “<BACSBody>” + vXmlNode.InnerText + “</BACSBody>”;
Do I still need this MyVar = MyVar + “<BACSBody>”+sbRemitMsg.ToString()+”</BACSBody>”;
RemitXmlDoc.LoadXml(strHeaderRemitMsg + MyVar + strTrailerRemitMsg);
Sorry to be a pain
Grant
October 6, 2009 at 2:09 PM in reply to: Evaluating on the amount of items returned in a message #23413Hi Grant,
1) In your Decide shape, your If rule branch should have conditional statement set to nMessageCount == 30 only.
2) The syntax error in your xpath expression can be solved by doing this:
vXmlNodeList = xpath(BACSRemittanceMsg, “/*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”]/*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”][” + System.Convert.ToString(nLoopCount) + “]”)
3) You should construct your MyVar variable in the Expression shape as following:
MyVar = MyVar + “<BACSBody>” + vXmlNode.InnerText + “</BACSBody>”;
Hope this helps.
Daniel.
October 6, 2009 at 1:39 PM in reply to: Evaluating on the amount of items returned in a message #23412Hi Daniel,
Got slightly confused so I have update accordingly with some questions:
Initialize Loop variables
nRecordCount = System.Convert.ToInt32(xpath(BACSRemittanceMsg, “count(//*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”]/*[local-name()=’DocumentIdentifier’ and namespace-uri()=”])”));
On the Decide shape I have only got an nLoopCount <= 30 & nMessageCount == 30 // should this only be nMessageCount == 30 ?
Expression shape (get individual node) This error in bold
vXmlNodeList = xpath(BACSRemittanceMsg, “//*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”]/*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”][” + System.Convert.ToString(nLoopCount) + “]”);
Error msg Syste.convert.ToString(nLoop must be in form of xpath
vXmlNode = vXmlNodeList.Item(0);
MyVar = MyVar + vXmlNode.InnerText;
Do something here to construct your batch message with myVar (Grant(Added))
MyVar = MyVar + “<BACSBody>”+sbRemitMsg.ToString()+”</BACSBody>”;
RemitXmlDoc.LoadXml(strHeaderRemitMsg + MyVar + strTrailerRemitMsg);
Kind Regards,
Grant
October 6, 2009 at 1:01 PM in reply to: Evaluating on the amount of items returned in a message #23411Hi Grant,
See my response below, in the quote, I am highlighting the changes in bold… Hope this makes sense.
[quote user="Zen"]
Hi Daniel,
Can I just give you a summary of where I am so not to waste too much of your time before I deploy and test?
Expression Shape (Initialize variables)
nLoopCount = 1;
nMessageCount = 1;
nRecordCount = ? (put your line of code here)
Loop shape (nLoopCount <= nRecordCount)
Atomic Scope shape (contains the following expression shape)
Expression shape (get individual node)
vXmlNodeList = xpath(BACSRemittanceMsg, “//*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”]/*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”][” + System.Convert.ToString(nLoopCount) + “]”);
vXmlNode = vXmlNodeList.Item(0);
MyVar = MyVar + vXmlNode.InnerText;
Decide Shape
If Branch rule (nMessageCount == 30)
Expression shape (logic for batching message)
Do something here to construct your batch message with myVar
nMessageCount = 0;
myVar = “”;
Expression shape (Add counters)
nLoopCount = nLoopCount + 1;
nMessageCount = nMessageCount + 1;
End of Loop
Expression shape (logic for batching rest of message)
Do something here to construct your batch message with myVar
Any mistakes ?
Grant
[/quote]
October 6, 2009 at 12:37 PM in reply to: Evaluating on the amount of items returned in a message #23410Hi Daniel,
Can I just give you a summary of where I am so not to waste too much of your time before I deploy and test?
Shape
Expression
nLoopCount =1;
nMessageCount = 1;
Loop start
nLoopCount <= nRecordCount
Decide Shape
nLoopCount <= 30 & nMessageCount == 30
Atomic Scope
vXmlNodeList = xpath(BACSRemittanceMsg, “System.Convert.ToString(//*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”]/*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”][” + nLoopCount + “]”));
vXmlNode = vXmlNodeList.Item(0);
MyVar = MyVar + vXmlNode.InnerText;
Expression Add count
nLoopCount = nLoopCount + 1;
nMessageCount = nMessageCount + 1;
Any mistakes ?
Grant
Hi
Thank you Daniel. This information was very helpful
October 6, 2009 at 12:23 PM in reply to: Evaluating on the amount of items returned in a message #23408Hi Grant,
You can stick the function that does the conversion inside the call to xpath, when you pass the second argument to it.
Daniel.
October 6, 2009 at 11:26 AM in reply to: Evaluating on the amount of items returned in a message #23407Sorry Daniel,
But does the converstion have to be outside the xpath..?
This is what I have vXmlNodeList = xpath(BACSRemittanceMsg,”string(//*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”]/*[local-name()=’BACSRemittance_DATA’ and namespace-uri()=’http://P5.BizTalk.Schemas.PP_SAPToBottomlineBACSRemittance_App_FF’%5D/*%5Blocal-name()=’BACSBody’ and namespace-uri()=”]/*[local-name()=’BACSRemittance’ and namespace-uri()=”]/*[local-name()=’Remittance’ and namespace-uri()=”]/*[local-name()=’RemittanceDetail’ and namespace-uri()=”][” + System.Convert.ToString(nLoopCount) + “]”);
Grant
October 6, 2009 at 11:16 AM in reply to: Evaluating on the amount of items returned in a message #23406Hi Grant,
Yes, convert that variable to String like this: System.Convert.ToString(nLoopCount)
Sorry for the omission.
Daniel.
October 6, 2009 at 11:10 AM in reply to: Evaluating on the amount of items returned in a message #23405Daniel,
am I right in thinking
vXmlNodeList = xpath(InputMessage, “/*[local-name()=’Employees’ and namespace-uri()=”]/*[local-name()=’Employee’ and namespace-uri()=”][” + nLoopCount + “]”);
nLoopCount is of type System.Int32 as it complaing about the conversation and I want to makesure I am following you correctly?
October 6, 2009 at 10:44 AM in reply to: Evaluating on the amount of items returned in a message #23404ops ok you can let me do yhe rest of stuff you mention.
Thanks
Grant
October 6, 2009 at 10:42 AM in reply to: Evaluating on the amount of items returned in a message #23403Hi Daniel,
I am going to follow what you have said word for word so are you saying in the decide shape I have nLoopCount <= 30 &
nMessageCount == 30 ? did not think you could have both?Sorry
Grant
-
AuthorPosts