How to store xml file into database

Home Page Forums BizTalk 2004 – BizTalk 2010 How to store xml file into database

Viewing 1 reply thread
  • Author
    Posts
    • #14043

      I want to store an xml file into database.
      I have created a message and assign it to a stored procedures input parameter.
      the sample code is in message assignment is

      vardoc = POMessage;// vardoc-xmlDocType variable..
      and Pomessage is schema type

      rawstring = varDoc.OuterXml(); //rawstring is string variable

      OutDoc = \”<Xsd attrb=rawString>\” //Outdoc is xmlDocType variable.

      ProcedureInParameter = OutDoc.
      ////———-
      Here I get an Exception as

      ‘<‘ hexadecimal value 0x3c is an invalid attribute charactor.

      Exception type :XmlException
      Source: System.Xml
      TargetSite : Boolean.scanLiteral()

      Can anyone sort this out…

    • #14044

      I want to store an xml file into database.
      I have created a message and assign it to a stored procedures input parameter.
      the sample code is in message assignment is

      vardoc = POMessage;// vardoc-xmlDocType variable..
      and Pomessage is schema type

      rawstring = varDoc.OuterXml(); //rawstring is string variable

      OutDoc = \”<Xsd attrb=rawString>\” //Outdoc is xmlDocType variable.

      ProcedureInParameter = OutDoc.
      ////———-
      Here I get an Exception as

      ‘<‘ hexadecimal value 0x3c is an invalid attribute charactor.

      Exception type :XmlException
      Source: System.Xml
      TargetSite : Boolean.scanLiteral()

      Can anyone sort this out

      1. First use an Ascii chart to find out what is 0x3c.
      http://www.lookuptables.com/ – shows it is the less-than < sign.

      2. I’m not sure why you are using the variable OutDoc.
      Is OutDoc the name of your message?
      I don’t understand the right side of your equal sign on the OutDoc statement at all. You don’t concatenate in \”rawString\” – you just have it as a literal. I don’t know why you have the xsd and attrb either.

      Seems like you need something like this:
      mySQLMessage.xmlString = rawstring;

      where mySqlMessage is the message you are constructing, and xmlString is a distinguished field that will pass the xml string to the stored. proc.

      Neal

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