none
biztalk wcf-sql adapter send port error RRS feed

  • Question

  • Hi ,

    we are getting an error message when i process edi data to sql server database using wcf-sql adaptor . 

     :"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The start element with name "N" and namespace "http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo" was unexpected. Please ensure that your input XML conforms to the schema for the operation let me know how to fix the issue

    Jaison

    Tuesday, August 20, 2013 2:36 PM

Answers

  • I suggest logging the EDI to SQL Server using a custom pipeline component rather than calling WCF-SQL. The problem is you need to serialize the EDI back to the native EDI format. Sending the Xml form of the EDI to WCF-SQL will not pass the WCF-SQL schema validation.

    If this answers your question, please use the "Answer" button to say so | Ben Cline

    • Marked as answer by Pengzhen Song Tuesday, August 27, 2013 1:24 AM
    Tuesday, August 20, 2013 6:35 PM
    Moderator

All replies

  • Save the document to a file, either by Tracking and saving or routing to a File Adapter.

    Validate against the SQL Schema.

    You probably have a missing field prior to 'N' so check the Map and source document to see what's missing there.

    Tuesday, August 20, 2013 2:44 PM
  • when i am  routing to other location i am getting  below xml (after map ) but when i call procedure i am getting error message

    <?xml version="1.0"?>
    -<ns0:ins_x12_850_edi xmlns:ns3="http://schemas.microsoft.com/Sql/2008/05/Types/TableTypes/dbo" xmlns:ns4="http://schemas.datacontract.org/2004/07/System.Data" xmlns:ns0="-<ns0:ORD>-<ns3:Order850><ns3:orderNo>251519</ns3:orderNo><ns3:PO_DATE>20130313</ns3:PO_DATE></ns3:Order850></ns0:ORD>-<ns0:DTM>-<ns3:OrderDtl850dtm><ns3:DtmorderNo>251519</ns3:DtmorderNo><ns3:DtType>010</ns3:DtType><ns3:DtStr>20130509</ns3:DtStr></ns3:OrderDtl850dtm>-<ns3:OrderDtl850dtm><ns3:DtmorderNo>251519</ns3:DtmorderNo><ns3:DtType>001</ns3:DtType><ns3:DtStr>20130523</ns3:DtStr></ns3:OrderDtl850dtm></ns0:DTM>-<ns0:N>-<ns3:OrderDtl850NDet><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:N1_TYPE>VN</ns3:N1_TYPE><ns3:N1_CODE>048</ns3:N1_CODE><ns3:N1_NAME>BOW</ns3:N1_NAME><ns3:N2_ADDR1/><ns3:N3_ADDR1>NO">http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">-<ns0:ORD>-<ns3:Order850><ns3:orderNo>251519</ns3:orderNo><ns3:PO_DATE>20130313</ns3:PO_DATE></ns3:Order850></ns0:ORD>-<ns0:DTM>-<ns3:OrderDtl850dtm><ns3:DtmorderNo>251519</ns3:DtmorderNo><ns3:DtType>010</ns3:DtType><ns3:DtStr>20130509</ns3:DtStr></ns3:OrderDtl850dtm>-<ns3:OrderDtl850dtm><ns3:DtmorderNo>251519</ns3:DtmorderNo><ns3:DtType>001</ns3:DtType><ns3:DtStr>20130523</ns3:DtStr></ns3:OrderDtl850dtm></ns0:DTM>-<ns0:N>-<ns3:OrderDtl850NDet><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:N1_TYPE>VN</ns3:N1_TYPE><ns3:N1_CODE>048</ns3:N1_CODE><ns3:N1_NAME>BOW</ns3:N1_NAME><ns3:N2_ADDR1/><ns3:N3_ADDR1>NO. 16 XIECHENG ROAD.</ns3:N3_ADDR1><ns3:N4_City>QINGDAON, SHANDONG</ns3:N4_City><ns3:N4_Cntry_Code>CN</ns3:N4_Cntry_Code></ns3:OrderDtl850NDet></ns0:N>-<ns0:N>-<ns3:OrderDtl850NDet><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:N1_TYPE>LG</ns3:N1_TYPE><ns3:N1_CODE>TLO</ns3:N1_CODE><ns3:N1_NAME>TRADELINK ONE</ns3:N1_NAME><ns3:N2_ADDR1/><ns3:N3_ADDR1/><ns3:N4_Cntry_Code>US</ns3:N4_Cntry_Code></ns3:OrderDtl850NDet></ns0:N>-<ns0:N>-<ns3:OrderDtl850NDet><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:N1_TYPE>DV</ns3:N1_TYPE><ns3:N1_CODE>MWJ</ns3:N1_CODE><ns3:N1_NAME>MARC WOMENS JEWELRY</ns3:N1_NAME><ns3:N2_ADDR1>MARC WOMENS JEWELRY</ns3:N2_ADDR1><ns3:N3_ADDR1>72 SPRING STREET</ns3:N3_ADDR1><ns3:N4_City>NEW YORK</ns3:N4_City><ns3:N4_Cntry_Code>US</ns3:N4_Cntry_Code></ns3:OrderDtl850NDet></ns0:N>-<ns0:NL3>-<ns3:OrderDtl850NL3Det><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:OrDtlLineNo>72</ns3:OrDtlLineNo><ns3:N1_TYPE>MP</ns3:N1_TYPE><ns3:N1_CODE>025</ns3:N1_CODE><ns3:N2_ADDR1/><ns3:N3_ADDR1/></ns3:OrderDtl850NL3Det></ns0:NL3>-<ns0:NL3>-<ns3:OrderDtl850NL3Det><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:OrDtlLineNo>72</ns3:OrDtlLineNo><ns3:N1_TYPE>ST</ns3:N1_TYPE><ns3:N1_CODE>TWSI</ns3:N1_CODE><ns3:N1_NAME>TRANS WORLD SHIPPING SPA</ns3:N1_NAME><ns3:N2_ADDR1/><ns3:N3_ADDR1>CONTRADA BRANCADORO</ns3:N3_ADDR1><ns3:N4_City>S. ELPIDIO A MARE (FM)</ns3:N4_City><ns3:N4_Cntry_Code>IT</ns3:N4_Cntry_Code></ns3:OrderDtl850NL3Det></ns0:NL3>-<ns0:NL3>-<ns3:OrderDtl850NL3Det><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:OrDtlLineNo>72</ns3:OrDtlLineNo><ns3:N1_TYPE>AG</ns3:N1_TYPE><ns3:N1_CODE>048</ns3:N1_CODE><ns3:N1_NAME>WILLIAM E CONNOR - MBM ACC</ns3:N1_NAME><ns3:N2_ADDR1/><ns3:N3_ADDR1/></ns3:OrderDtl850NL3Det></ns0:NL3>-<ns0:NL3>-<ns3:OrderDtl850NL3Det><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:OrDtlLineNo>73</ns3:OrDtlLineNo><ns3:N1_TYPE>MP</ns3:N1_TYPE><ns3:N1_CODE>025</ns3:N1_CODE><ns3:N2_ADDR1/><ns3:N3_ADDR1/></ns3:OrderDtl850NL3Det></ns0:NL3>-<ns0:NL3>-<ns3:OrderDtl850NL3Det><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:OrDtlLineNo>73</ns3:OrDtlLineNo><ns3:N1_TYPE>ST</ns3:N1_TYPE><ns3:N1_CODE>TWSI</ns3:N1_CODE><ns3:N1_NAME>TRANS WORLD SHIPPING SPA</ns3:N1_NAME><ns3:N2_ADDR1/><ns3:N3_ADDR1>CONTRADA BRANCADORO</ns3:N3_ADDR1><ns3:N4_City>S. ELPIDIO A MARE (FM)</ns3:N4_City><ns3:N4_Cntry_Code>IT</ns3:N4_Cntry_Code></ns3:OrderDtl850NL3Det></ns0:NL3>-<ns0:NL3>-<ns3:OrderDtl850NL3Det><ns3:N1orderNo>251519</ns3:N1orderNo><ns3:OrDtlLineNo>73</ns3:OrDtlLineNo><ns3:N1_TYPE>AG</ns3:N1_TYPE><ns3:N1_CODE>048</ns3:N1_CODE><ns3:N1_NAME>WILLIAM E CONNOR - MBM ACC</ns3:N1_NAME><ns3:N2_ADDR1/><ns3:N3_ADDR1/></ns3:OrderDtl850NL3Det></ns0:NL3>-<ns0:PID>-<ns3:OrderDtl850PID><ns3:PIDorderNo>251519</ns3:PIDorderNo><ns3:ProdNo>M3PE515</ns3:ProdNo><ns3:OrdDtlLineNo>72</ns3:OrdDtlLineNo><ns3:pidtype1>F</ns3:pidtype1><ns3:pidtype2>08</ns3:pidtype2><ns3:ProdDET>ZIP IT STUDS</ns3:ProdDET></ns3:OrderDtl850PID>-<ns3:OrderDtl850PID><ns3:PIDorderNo>251519</ns3:PIDorderNo><ns3:ProdNo>M3PE515</ns3:ProdNo><ns3:OrdDtlLineNo>72</ns3:OrdDtlLineNo><ns3:pidtype1>F</ns3:pidtype1><ns3:pidtype2>73</ns3:pidtype2><ns3:ProdDET>ARGENTO</ns3:ProdDET></ns3:OrderDtl850PID>-<ns3:OrderDtl850PID><ns3:PIDorderNo>251519</ns3:PIDorderNo><ns3:ProdNo>M3PE515</ns3:ProdNo><ns3:OrdDtlLineNo>72</ns3:OrdDtlLineNo><ns3:pidtype1>F</ns3:pidtype1><ns3:pidtype2>74</ns3:pidtype2><ns3:ProdDET>1SZ</ns3:ProdDET></ns3:OrderDtl850PID>-<ns3:OrderDtl850PID><ns3:PIDorderNo>251519</ns3:PIDorderNo><ns3:ProdNo>M3PE515</ns3:ProdNo><ns3:OrdDtlLineNo>73</ns3:OrdDtlLineNo><ns3:pidtype1>F</ns3:pidtype1><ns3:pidtype2>08</ns3:pidtype2><ns3:ProdDET>ZIP IT STUDS</ns3:ProdDET></ns3:OrderDtl850PID>-<ns3:OrderDtl850PID><ns3:PIDorderNo>251519</ns3:PIDorderNo><ns3:ProdNo>M3PE515</ns3:ProdNo><ns3:OrdDtlLineNo>73</ns3:OrdDtlLineNo><ns3:pidtype1>F</ns3:pidtype1><ns3:pidtype2>73</ns3:pidtype2><ns3:ProdDET>ORO</ns3:ProdDET></ns3:OrderDtl850PID>-<ns3:OrderDtl850PID><ns3:PIDorderNo>251519</ns3:PIDorderNo><ns3:ProdNo>M3PE515</ns3:ProdNo><ns3:OrdDtlLineNo>73</ns3:OrdDtlLineNo><ns3:pidtype1>F</ns3:pidtype1><ns3:pidtype2>74</ns3:pidtype2><ns3:ProdDET>1SZ</ns3:ProdDET></ns3:OrderDtl850PID></ns0:PID>-<ns0:PO1>-<ns3:OrderDtl850PO1><ns3:PO1orderNo>251519</ns3:PO1orderNo><ns3:OrdDtlLineNo>72</ns3:OrdDtlLineNo><ns3:OrderQty>25</ns3:OrderQty><ns3:ProdType>EA</ns3:ProdType><ns3:UnitPrice>3.12</ns3:UnitPrice><ns3:ProdNo>M3PE515</ns3:ProdNo></ns3:OrderDtl850PO1>-<ns3:OrderDtl850PO1><ns3:PO1orderNo>251519</ns3:PO1orderNo><ns3:OrdDtlLineNo>73</ns3:OrdDtlLineNo><ns3:OrderQty>65</ns3:OrderQty><ns3:ProdType>EA</ns3:ProdType><ns3:UnitPrice>4.31</ns3:UnitPrice><ns3:ProdNo>M3PE515</ns3:ProdNo></ns3:OrderDtl850PO1></ns0:PO1>-<ns0:REF>-<ns3:OrderDtl850REF><ns3:REForderNo>251519</ns3:REForderNo><ns3:Ref_TYPE>AAY</ns3:Ref_TYPE><ns3:Ref_HTS>FA13</ns3:Ref_HTS></ns3:OrderDtl850REF>-<ns3:OrderDtl850REF><ns3:REForderNo>251519</ns3:REForderNo><ns3:Ref_TYPE>8X</ns3:Ref_TYPE><ns3:Ref_HTS>FOB</ns3:Ref_HTS></ns3:OrderDtl850REF>-<ns3:OrderDtl850REF><ns3:REForderNo>251519</ns3:REForderNo><ns3:Ref_TYPE>XY</ns3:Ref_TYPE><ns3:Ref_HTS>HOT PERM USNJ1</ns3:Ref_HTS></ns3:OrderDtl850REF></ns0:REF></ns0:ins_x12_850_edi>

    Tuesday, August 20, 2013 3:05 PM
  • You have to apply the same Map there as well.  Once you've done that, Validate against the SQL Schema in Visual Studio.


    • Edited by Johns-305MVP Tuesday, August 20, 2013 3:34 PM clarity
    Tuesday, August 20, 2013 3:32 PM
  • I suggest logging the EDI to SQL Server using a custom pipeline component rather than calling WCF-SQL. The problem is you need to serialize the EDI back to the native EDI format. Sending the Xml form of the EDI to WCF-SQL will not pass the WCF-SQL schema validation.

    If this answers your question, please use the "Answer" button to say so | Ben Cline

    • Marked as answer by Pengzhen Song Tuesday, August 27, 2013 1:24 AM
    Tuesday, August 20, 2013 6:35 PM
    Moderator
  • Can you explain how can i use custom pipeline to save edi data to sql server database ?
    Tuesday, August 27, 2013 12:40 PM