none
Biztalk 2010 Application getting "use of unconstructed message 'ISA_ONLY' " error when Message appears to be Constructed

    Question

  • I am working to create an application to handle n inbound 5010 999 file. I receive the file in, construct an ISA_ONLY message to handle creating a schema for the ISA segment which would be otherwise unseen, and then run a 2 into 1 Transform to insert the data from the 999 into a table via a schema which calls a stored proc. I have the rest built--map looks good, and port to send to the stored proc. I am simply receiving the following error:

    "Error 1 use of unconstructed message 'ISA_ONLY' ...(path, etc) "

    I can provide screenshots to show the build--anybody interested in taking a crack at this?

    Thanks in advance---

    Tom

     

    Tuesday, July 02, 2013 9:15 PM

Answers

  • Oops ... I forgot to change double quote before http to single quote...

    xmlDoc.LoadXml("ns0:Rootxmlns:ns0='http://BTAHL7Schemas.Schemas.ISA_ONLY'><ISASegment>ISASegment_0</ISASegment></ns0:Root>");


    I hope this helps!!!!!! Please mark as Helpful. If this answers your question, please mark it as &amp;quot;Answered&amp;quot;. It will help to reduce visits to same post as it&#39;s already answered and will help guys with same question as yours without even posting it . Maheshkumar S. Tiwari|Team lead/Consultant(EDI/EAI)|iVision Software Pvt Ltd, Pune.


    Monday, July 08, 2013 4:16 PM

All replies

  • This error occurs because the message you are using is not constructed, hence the 'unconstructed error'.

    Before you use an XML message inside an orchestration, it must be constructed (populated with an XML). If there is an attempt to use this message before it's contructed you will see that error.
    Please do not that some message are already constructed for you, for example messages comming from a Receive Port.

    You can create/construct a message in an orchestration in following ways

    • Create the message using a Map
    • Assign a message to another message (create a copy)

    ex:
    msgCopy = msgIn --> this will copy the actual body part
    msgCopy(*) = msgIn(*) --> this will copy the context

    • Create a message with the help of System.Xml

    ex:
    xmlDoc = new System.Xml.XmlDocument()
    xmlDoc.LoadXML("<yourxml />")
    msgNew = xmlDoc


    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    Wednesday, July 03, 2013 5:14 AM
  • So for instance, if I use the msgCopy code, I would put that in an Expression box prior to the Transform? Would I have to reference it by creating another Message before it would work? If so, how do I tie it to the input section in the TRansform, or is simply having the additional Message in existence enough? (which I don't expect is likely)

    Thanks for your help so far--

    Tom

    Wednesday, July 03, 2013 2:26 PM
  • Yes, putting the msgCopy code before the expression will 'initialize' the ISA_ONLY message.
    Regarding your additional question, is the ISA_ONLY message used inside the mapping? Then yes you have to tie it to the input section of the Transform.


    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    Thursday, July 04, 2013 4:57 AM
  • Thanks Glen.

    Currently my expression reads as follows:

    ISA_ONLY.ISASegment = RECEIVE_INBOUND_999(EDI.ISA_Segment);

    The existing Messages and Variable for this Orchestration are as follow:

    The Orchestration is as follows:

    My questions are as follow:

    1. Do I include your suggested Message in the same Expression as I already have?

    2. If so, considering my configuration show below, what would the syntax be for that additional message in the expression?

    3. Is there any special EDI component for BizTalk necessary to process EDI files beyond perhaps the EDI Disassembler in the Pipeline and the EDI schema? I ask because my counterpart is chasing down that rabbit hole and if so I need to follow him, but I am hopeful my existing project should be able to parse this 999.

    Thanks in advance---

    Tom Banaski

    Monday, July 08, 2013 2:44 PM
  • Hi Tom,

    From what I understand:

    1. You receive "Receive_Inbound_999"

    2. Then in Message Assignment Shape you are doing : ISA_ONLY.ISASegment = RECEIVE_INBOUND_999(EDI.ISA_Segment);

    3. Then in Transform shape you are constructing Send_999_To_SP.

    Well if it is correct ,then you need to add one more step before step 2.

    1. Create a variable of type System.Xml.XmlDocument say xmlDoc.

    2.Generate instance from the schema which your ISA_ONLY Message belongs to and copy it.

    3.Add Expression Shape before Construct_Placeholder and 

    xmlDoc.LoadXml("Paste your instance which you have copied");

    4. And I believe you have promoted the "ISA.Segment" as distinguished , if not please do it.


    I hope this helps!!!!!! Please mark as Helpful. If this answers your question, please mark it as &amp;quot;Answered&amp;quot;. It will help to reduce visits to same post as it&#39;s already answered and will help guys with same question as yours without even posting it . Maheshkumar S. Tiwari|Team lead/Consultant(EDI/EAI)|iVision Software Pvt Ltd, Pune.

    Monday, July 08, 2013 3:07 PM
  • Did as prescribed:

    and...the new Expression based on the Instance generated from the schema:

    Same errors..which will follow in next post...and yes it was saved before Build attempted....

    Monday, July 08, 2013 3:37 PM
  • Same errors...

    Monday, July 08, 2013 3:38 PM
  • Hi Tom ,

    You misunderstood,

    You have to paste the instance of the ISA_ONLY schema .

    Suppose your schema is like this :

     <?xml version="1.0" encoding="utf-16" ?> 
     <xs:schema xmlns="http://TestingSchemas.ISA" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://TestingSchemas.ISA" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:element name="ISA">
    - <xs:complexType>
    - <xs:sequence>
      <xs:element name="ISA_Segment" type="xs:string" /> 
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:schema>

    Then in Expression Editor do this:

    xdoc.LoadXml("<ns0:ISA xmlns:ns0="http://TestingSchemas.ISA">
      <ISA_Segment>ISA_Segment_0</ISA_Segment> 
      </ns0:ISA>")


    I hope this helps!!!!!! Please mark as Helpful. If this answers your question, please mark it as &amp;quot;Answered&amp;quot;. It will help to reduce visits to same post as it&#39;s already answered and will help guys with same question as yours without even posting it . Maheshkumar S. Tiwari|Team lead/Consultant(EDI/EAI)|iVision Software Pvt Ltd, Pune.

    Monday, July 08, 2013 3:47 PM
  • Ok, my instance I generated reads as follows

    <ns0:Root xmlns:ns0="http://BTAHL7Schemas.Schemas.ISA_ONLY">
      <ISASegment>ISASegment_0</ISASegment>
    </ns0:Root>

    So when I pasted it into the Expression Editor I pasted the following:

    And I am getting:

    Syntax not quite right? My apologies--I have no real programming background...

    Thanks--

    Monday, July 08, 2013 3:55 PM
  • Hi Tom ,

    It is because new line is getting added and no semicolon at end.

    xmlDoc.LoadXml("ns0:Rootxmlns:ns0="http://BTAHL7Schemas.Schemas.ISA_ONLY"><ISASegment>ISASegment_0</ISASegment></ns0:Root>");

    Please remove newline and add semicolon at end as shown above and you should be all set now.


    I hope this helps!!!!!! Please mark as Helpful. If this answers your question, please mark it as &amp;quot;Answered&amp;quot;. It will help to reduce visits to same post as it&#39;s already answered and will help guys with same question as yours without even posting it . Maheshkumar S. Tiwari|Team lead/Consultant(EDI/EAI)|iVision Software Pvt Ltd, Pune.


    Monday, July 08, 2013 3:58 PM
  • Used what you sent as shown below:

    As you can see, I am still getting an error; it is saying a ')' is expected....

    I can see 3 sets of double quotes whereas usually they are always in pairs of 2, and one parenthesis which usually comes in pairs. But the exact syntax is a little beyond my kung fu still...

    Monday, July 08, 2013 4:13 PM
  • Oops ... I forgot to change double quote before http to single quote...

    xmlDoc.LoadXml("ns0:Rootxmlns:ns0='http://BTAHL7Schemas.Schemas.ISA_ONLY'><ISASegment>ISASegment_0</ISASegment></ns0:Root>");


    I hope this helps!!!!!! Please mark as Helpful. If this answers your question, please mark it as &amp;quot;Answered&amp;quot;. It will help to reduce visits to same post as it&#39;s already answered and will help guys with same question as yours without even posting it . Maheshkumar S. Tiwari|Team lead/Consultant(EDI/EAI)|iVision Software Pvt Ltd, Pune.


    Monday, July 08, 2013 4:16 PM
  • Thanks! It turned out I had something in my Message Assignment I didn't need, plus your syntax was almost right--the final version was like this:

    xmlDoc.LoadXml("ns0:Rootxmlns:ns0='http://BTAHL7Schemas.Schemas.ISA_ONLY'><ISASegment>ISASegment_0</ISASegment></ns0:Root>");

    The second set of double quotes after "schemas.ISA_ONLY" had to be changed to a single quote.

    The job has now Built Successfully--Thanks for your help!

    Monday, July 08, 2013 4:25 PM