failed to serialize message part

Home Page Forums BizTalk 2004 – BizTalk 2010 failed to serialize message part

Viewing 1 reply thread
  • Author
    Posts
    • #15970

      Hi

      I need to call a webservice by sendig some parameters (date as parameter) and that is the first step in my orchestration. I don't have a receive shape so i construct the web service request in my message assignment. below is the code

       

      jeTraxRequest.LoadXml("<JE_Record_Outgoing_Element><ns0:date_From>2006-09-28T13:20:00.000-05:00</ns0:date_From><ns0:date_To>2006-09-29T13:20:00.000-05:00</ns0:date_To><ns0:getOnlyUnsentRecords>true</ns0:getOnlyUnsentRecords><ns0:valid></ns0:valid></ns0:JE_Record_Outgoing_Element>");

      msgJEReq.q = jeTraxRequest;

       

      And i have a web reference to my biztalk project and have multi-part message types and the reference.xsd looks like below

        <?xml version="1.0" encoding="utf-16" ?>
        <xs:element name="JE_Record_Query_Parameter" nillable="true" type="tns:JE_Record_Query_Parameter" />
      <xs:complexType name="JE_Record_Query_Parameter">
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="1" name="date_From" nillable="true" type="xs:dateTime" />
        <xs:element minOccurs="1" maxOccurs="1" name="date_To" nillable="true" type="xs:dateTime" />
        <xs:element minOccurs="1" maxOccurs="1" name="getOnlyUnSentRecords" type="xs:boolean" />
        <xs:element minOccurs="1" maxOccurs="1" name="valid" type="xs:boolean" />
        </xs:sequence>
        </xs:complexType>
        <xs:element name="JE_Record_Query_Element" nillable="true" type="tns:JE_Record_Query_Element" />
      <xs:complexType name="JE_Record_Query_Element">
      <xs:complexContent mixed="false">
        <xs:extension base="tns:JE_Record_Query_Parameter" />
        </xs:complexContent>
        </xs:complexType>
        <xs:element name="Gl_Account" nillable="true" type="tns:Gl_Account" />
      <xs:complexType name="Gl_Account">
      <xs:complexContent mixed="false">
        <xs:extension base="tns:GL_Account_Outgoing_Type" />
        </xs:complexContent>
        </xs:complexType>
      <xs:complexType name="GL_Account_Outgoing_Type">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="GL" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="GL_Category" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="GL_Company" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="GL_Cost_Center" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="GL_Description" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="GL_Expenditure" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="modified_By" type="xs:string" />
        <xs:element minOccurs="1" maxOccurs="1" name="valid" type="xs:boolean" />
        </xs:sequence>
        </xs:complexType>
        <xs:element name="JE_Record_Outgoing_Type" nillable="true" type="tns:JE_Record_Outgoing_Type" />
      <xs:complexType name="JE_Record_Outgoing_Type">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="AC" type="xs:string" />
        <xs:element minOccurs="1" maxOccurs="1" name="JE_Date" nillable="true" type="xs:dateTime" />
        <xs:element minOccurs="0" maxOccurs="1" name="PN" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="PN_Category" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="PN_SN" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="ac_Series" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="ac_Type" type="xs:string" />
        <xs:element minOccurs="1" maxOccurs="1" name="amount" nillable="true" type="xs:decimal" />
        <xs:element minOccurs="1" maxOccurs="1" name="batch" type="xs:long" />
        <xs:element minOccurs="0" maxOccurs="1" name="category" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="category_Code" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="created_By" type="xs:string" />
        <xs:element minOccurs="1" maxOccurs="1" name="created_Date" nillable="true" type="xs:dateTime" />
        <xs:element minOccurs="1" maxOccurs="1" name="credit_debit_sequence" type="xs:long" />
        <xs:element minOccurs="0" maxOccurs="1" name="currency" type="xs:string" />
        <xs:element minOccurs="1" maxOccurs="1" name="currency_Exchange_Rate" nillable="true" type="xs:decimal" />
        <xs:element minOccurs="0" maxOccurs="1" name="gl_Account" type="tns:Gl_Account" />
        <xs:element minOccurs="1" maxOccurs="1" name="interface_transaction" type="xs:long" />
        <xs:element minOccurs="0" maxOccurs="1" name="invoice" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="legacy_System_Order_Number" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="location" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="location_Financial" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="order_Capital_Expenditure" type="xs:string" />
        <xs:element minOccurs="1" maxOccurs="1" name="order_Number" type="xs:long" />
        <xs:element minOccurs="0" maxOccurs="1" name="order_Type" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="site" type="xs:string" />
        <xs:element minOccurs="0" maxOccurs="1" name="task_Card" type="xs:string" />
        <xs:element minOccurs="1" maxOccurs="1" name="transaction" type="xs:long" />
        <xs:element minOccurs="0" maxOccurs="1" name="transaction_No" type="xs:string" />
        <xs:element minOccurs="1" maxOccurs="1" name="valid" type="xs:boolean" />
        <xs:element minOccurs="0" maxOccurs="1" name="vendor_Financial" type="xs:string" />
        </xs:sequence>
        </xs:complexType>
        <xs:element name="JE_Record_Outgoing_Element" nillable="true" type="tns:JE_Record_Outgoing_Element" />
      <xs:complexType name="JE_Record_Outgoing_Element">
      <xs:complexContent mixed="false">
        <xs:extension base="tns:JE_Record_Outgoing_Type" />
        </xs:complexContent>
        </xs:complexType>
        <xs:element name="JE_Record_Outgoing_Array_Type" nillable="true" type="tns:JE_Record_Outgoing_Array_Type" />
      <xs:complexType name="JE_Record_Outgoing_Array_Type">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" name="JE_Record_Outgoing_Element" type="tns:ArrayOfJE_Record_Outgoing_Element" />
        <xs:element minOccurs="1" maxOccurs="1" name="JE_Record_Outgoing_ElementCount" type="xs:int" />
        <xs:element minOccurs="1" maxOccurs="1" name="valid" type="xs:boolean" />
        </xs:sequence>
        </xs:complexType>
      <xs:complexType name="ArrayOfJE_Record_Outgoing_Element">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="JE_Record_Outgoing_Element" nillable="true" type="tns:JE_Record_Outgoing_Element" />
        </xs:sequence>
        </xs:complexType>
        <xs:element name="JE_Record_Outgoing_Array_Element" nillable="true" type="tns:JE_Record_Outgoing_Array_Element" />
      <xs:complexType name="JE_Record_Outgoing_Array_Element">
      + <xs:complexContent mixed="false">
        <xs:extension base="tns:JE_Record_Outgoing_Array_Type" />
        </xs:complexContent>
        </xs:complexType>
        </xs:schema>
      when i tried to run the project i get error as failed message part error. i attached the error below

      "Failed to serialize the message part "q" into the type "JE_Record_Query_Element" using namespace "http://journal_entry.glinterface.castor.trax.aero&quot;. Please ensure that the message part stream is created properly. ".

      iif anybody have an answer please let me know.

    • #15993

      Have you tried to validate your Xml string against the Schema?

       

      I’d save your string as an Xml file and make sure it validates. 

       

      That’s the first thing I can think of with that error…

      • #19885

         

        I have the same problem !!!

        I need a help too.

        • #19890

           In the example at the top the <valid> is mandatory and boolean, it must contain either tru or false.

          I would follow Stephen’s advice. Save the Xml into a file and use the Validate Instance command from the schema.

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