Initialize message for use in Send-Receive-Port

Home Page Forums BizTalk 2004 – BizTalk 2010 Initialize message for use in Send-Receive-Port

Viewing 1 reply thread
  • Author
    Posts
    • #24832

      Hi Gurus,

      you helped me in the past with extend an external developed applikations, so I hope the best for this project.

      I develop my first own applikation in BizTalk which should transfer data between Siebel and SAP. So I received the schemes via SAP-adapter and an RFC-Call, declared four messages (Siebel-request, -response, SAP-request, -response). A map transfers the data from the siebel-request to the sap-request. This sap-request should be send via send-receive-adapter to SAP. The answer from the sap-adapter should saved in the SAP-response message. This should be mapped to the Siebel-response message.

      At first there was the error, that the message sap-response, that was linked the the answer-part of the send-receive-adapter, wasn’t initialized in the construct statement. So I placed a message assignement shape and placed this code in it:

      XMLDOM = new System.Xml.XmlDocument();

      XMLDOM.LoadXml(@”<ns0:Z_M2M_RECHNUNG_ANLEGEN_Response xmlns:ns0=””http://schemas.microsoft.com/BizTalk/2003″”>&nbsp; <PE_BELNR>0815</PE_BELNR>  <PE_BUKRS>PE_B</PE_BUKRS>  <PE_DATUM>20100527</PE_DATUM>  <PE_GJAHR>2010</PE_GJAHR>  <PE_STATUS>P</PE_STATUS>  <PE_UZEIT>121213</PE_UZEIT>  <PT_MESSAGE>    <MSGTY>M</MSGTY>    <MESSAGE>MESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMES</MESSAGE>  </PT_MESSAGE>  <PT_MESSAGE>    <MSGTY>M</MSGTY>    <MESSAGE>MESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMES</MESSAGE>  </PT_MESSAGE>  <PT_MESSAGE>    <MSGTY>M</MSGTY>    <MESSAGE>MESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMESSAGEMES</MESSAGE>  </PT_MESSAGE>  <PT_RPOS>    <KOSTL>KOSTLKOSTL</KOSTL>    <HKONT>HKONTHKONT</HKONT>    <MWSKZ>MW</MWSKZ>    <WRBTR>50</WRBTR>  </PT_RPOS>  <PT_RPOS>    <KOSTL>KOSTLKOSTL</KOSTL>    <HKONT>HKONTHKONT</HKONT>    <MWSKZ>MW</MWSKZ>    <WRBTR>90</WRBTR>  </PT_RPOS>  <PT_RPOS>    <KOSTL>KOSTLKOSTL</KOSTL>    <HKONT>HKONTHKONT</HKONT>    <MWSKZ>MW</MWSKZ>    <WRBTR>74</WRBTR>  </PT_RPOS></ns0:Z_M2M_RECHNUNG_ANLEGEN_Response>”);

      m_SAP_Response = XMLDOM;

      m_SAP_Response.PE_GJAHR = “2010”;

      Furthermore I created the variable XMLDOM as “System.Xml.XmlDocument” and promoted the element PE_GJAHR to fill it with a test value.

       

      Now the building succeed but the orchestrastion crash, with the following error message:

            Internal exception: The part ‘part’ of message ‘SAP-Response’ contains zero bytes of data.

      I tested the orchestration with a map to initialize the message, but the error (Internal exception…) is the same.

      I found a lot of posts (not only here) with similarly problems. From that I use the code lines of the assignement. But no one was successful for me.

      I think it is a problem of the basics of biztalk developement. Please give me a hint, where I can look for a solution or what I can try. I work with BizTalk 2006.

      Thanks

      Ulf

    • #24844

      You should receive the SAP response message from your request response port to SAP. You should not construct this message in the orchestration.

      If you are gettin a compile time error that the message is not constructed it could be that there is a code path that uses the SAP response message, that can be performed  without calling the send port to SAP

      • #24849

        Hi Greg,

        thanks for your reaction. I construct the message because of the compile time error, that this message is not constructed. What do you mean with [quote user="greg.forsythe"]

        … it could be that there is a code path that uses the SAP response message, that can be performed  without calling the send port to SAP

        [/quote]

        How can I avoid the error, that “Message has not been initialized in construct statement”?

        Here a overview about my message flow throug the orchestration

        Shape Message Port
        Receive SiebelRequest unidirektional receive
        Transform SiebelRequest->SAPRequest none
        Send SAPRequest Send-Receive-Port (Request)
        Receive SAPResponse Send-Receive-Port (Response)
        Transform SAPResponse->SiebelResponse none
        Send SiebelResponse unidirektional send

        Thanks.

        Ulf

        • #24965

          As I said it was a junior failure. I checked two messages in the transform shape. Perhaps it helps other juniors 🙂

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