How to pass XML document as string parameter to Scripting Functoid

Home Page Forums BizTalk 2004 – BizTalk 2010 How to pass XML document as string parameter to Scripting Functoid

Viewing 1 reply thread
  • Author
    Posts
    • #22788

      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.

       

    • #22793

      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.

       

       

       

      • #22797

        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?

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.