BizTalk Gurus

How to pass XML document as string parameter to Scripting Functoid

rated by 0 users
Not Answered This post has 0 verified answers | 2 Replies | 2 Followers

posted on Mon, Jul 6 2009 5:56 AM

Hello,

I have a problem. I want to pass XML document as parameter to Scripting Functoid. Where I run this code I get a null variable.

I want pass strTmp which is document

<POLISY xmlns="http://E.M.P.FD">
 <HEADERINFO>
  <RaportDateCreate>2009-06-08T11:57:25</RaportDateCreate>
 </HEADERINFO>
  <POLISA>
      <NUMER>A0/DOK/I/00006/2009</NUMER>
  </POLISA>
  <POLISA>
      <NUMER>A0/DOK/I/00007/2009</NUMER>
  </POLISA>
</POLISY>

[IN EXPRESSION EDITOR]

strTmp = xmlTmpDocOut.InnerText.ToString();

strXmlTmp = "<HashString><strcontractNo>"+strcontractNo+"</strcontractNo>";

strXmlTmp = strXmlTmp + "<xmlDoc>"+strTmp+"</xmlDoc>";

strXmlTmp = strXmlTmp + "<pass></pass></HashString>";

[IN Scripting Functoid]

PARAMETER

/*[local-name()='<Schema>']/*[local-name()='HashString']/*[local-name()='xmlDoc']

When I want to get a parameter value I get null.

Where is an error.

Please HELP.

Paul.

 

All Replies

Top 50 Contributor
32 Posts

Hi Paul,

I don't believe you can use a .net variable inside the map that you define outside of the map. I think you can create a schema with the following structure. Then create and populate a XLangMessage of this type of schema and use the XLangMessage as an input to the map. hope that helps.

 

 

 

Top 10 Contributor
877 Posts

How do you assign the content to xmlTmpDocOut?

There are a couple of issues with your code:
strTmp = xmlTmpDocOut.InnerText.ToString();

The InnerText property only returns the text content of your Xml, basically strips all the xml tags.
You should use:
strTmp = xmlTmpDocOut.OuterXml;

The xpath statement in your map is also incorrect, there is no <Schema> root node in your message.
You should use:
/*[local-name()='HashString']/*[local-name()='xmlDoc']

This may not be the best way of achieving your result. Are you using custom Xslt? What is the purpose of passing the Xml to the scripting functoid?

 

Page 1 of 1 (3 items) | RSS