You are currently offline, waiting for your internet to reconnect

Token StartElement in state EndRootElement would result in an invalid XML document error message in Web Services for Microsoft Dynamics GP

SYMPTOMS
1. A GetByKey method call for a sales document using Web Services for Dynamics GP will return the following error message:

Token StartElement in state EndRootElement would result in an invalid XML document. Make sure that the ConformanceLevel setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto if you want to write an XML fragment.


2. A GetList method call for a sales document will show duplicate sales documents.

CAUSE
The problem is caused by the dual nature of voided sales documents while the SOP Transaction Entry window in Dynamics GP remains open:

1. The voided sales document exists in History (SOP30200 table).
2. The voided Invoice exists in Work (SOP10100 table).
RESOLUTION
The SQL view used by Web Services for Dynamics GP must be edited to accomodate this behavior. The following SQL script must be run against the company databases:


ALTER VIEW [dbo].[ReqSOHeaderView] AS select  1 "TrxState", -- Set to 1 for Work  SOP10100.SOPTYPE,DOCID,   -- Fields Added for CRM Integration isnull(ORIGTYPE,0) as ORIGTYPE,    -- Original Transaction Type before migrationisnull(ORIGNUMB,'') as ORIGNUMB,   -- Original Document Number before migration -- End Integration FieldsSOP10100.SOPNUMBE,TAXSCHID,FRTSCHID,MSCSCHID,SHIPMTHD,TAXAMNT,ORTAXAMT,LOCNCODE,DOCDATE,FRTAMNT,ORFRTAMT,MISCAMNT,ORMISCAMT,TRDISAMT,ORTDISAM,TRDISPCT,MRKDNAMT,ORMRKDAM,CUSTNMBR,CUSTNAME,CSTPONBR,PROSPECT,ShipToName,ADDRESS1,ADDRESS2,ADDRESS3,CNTCPRSN,FAXNUMBR,CITY,STATE,ZIPCODE,COUNTRY,CCode,PHNUMBR1,PHNUMBR2,PHONE3,SUBTOTAL,ORSUBTOT,DOCAMNT,ORDOCAMT,PYMTRCVD,ORPMTRVD,DEPRECVD,ORDEPRVD,SALSTERR,SLPRSNID,UPSZONE,USER2ENT,CREATDDT,SOP10100.DEX_ROW_TS,BACHNUMB,BCHSOURC,(SELECT CREATDDT FROM SY00500 WHERE SOP10100.BACHNUMB = SY00500.BACHNUMB AND  SOP10100.BCHSOURC = SY00500.BCHSOURC) AS BatchCreatedDate,(SELECT TIME1 FROM SY00500 WHERE SOP10100.BACHNUMB = SY00500.BACHNUMB AND  SOP10100.BCHSOURC = SY00500.BCHSOURC) AS BatchCreatedTime,PRBTADCD,PRSTADCD,FRTTXAMT,ORFRTTAX,MSCTXAMT,ORMSCTAX,MSTRNUMB,PYMTRMID,COMAPPTO,COMMAMNT,OCOMMAMT,CMMSLAMT,ORCOSAMT,CURNCYID,XCHGRATE,EXCHDATE,FRGTTXBL,MISCTXBL,COMMNTID,ReqShipDate,ACTLSHIP,FUFILDAT,QUOEXPDA,QUOTEDAT,SOP10106.CMMTTEXT,PRCLEVEL,TAXEXMT1,TAXEXMT2,TXRGNNUM,TRXSORCE,ECTRX,VOIDSTTS,REFRENCE,SHIPCOMPLETE,SY03900.TXTFIELD,GPSFOINTEGRATIONID,INTEGRATIONSOURCE,INTEGRATIONID,INVODATE,BACKDATE,RETUDATE,-- The following columns only apply to Sales OrderREPTING,TRXFREQU,TIMETREP,DYSTINCR,SOPSTATUS,-- End of Sales Order-- The following columns only apply to Sales InvoiceDISTKNAM,ORDISTKN,DUEDATE,DISCDATE,DISAVAMT,ORDAVAMT,DSCDLRAM,ORDDLRAT,DSCPCTAM,GLPOSTDT,POSTEDDT,PTDUSRID,DIRECTDEBIT,-- End of Sales Invoice-- The following columns only apply to Sales ReturnDISCRTND,ORDISRTD,-- End of Sales Return-- Workflow fieldsCASEWHEN SOP10100.SOPTYPE=1 THENWorkflowPriorityQuoteELSEWorkflowPriorityCreditLmEND AS WorkflowPriority,CASEWHEN SOP10100.SOPTYPE=1 THENWorkflowApprStatusQuoteELSEWorkflowApprStatCreditLmEND AS ApprovalWorkflowStatus,-- End Workflow fieldsSOP10100.DEX_ROW_IDfrom SOP10100 (nolock)left outer join SOP10106 on (SOP10100.SOPNUMBE = SOP10106.SOPNUMBE  and SOP10100.SOPTYPE = SOP10106.SOPTYPE)left outer join SY03900 on (SOP10100.NOTEINDX = SY03900.NOTEINDX)Where SOP10100.TRXSORCE=''union allselect3 "TrxState", -- Set to 3 for HistorySOP30200.SOPTYPE,DOCID,  -- Fields Added for CRM Integrationisnull(SOP30200.ORIGTYPE,0) as ORIGTYPE,    -- Original Transaction Type before migrationisnull(SOP30200.ORIGNUMB,'') as ORIGNUMB,   -- Original Document Number before migration-- End Integration FieldsSOP30200.SOPNUMBE,TAXSCHID,FRTSCHID,MSCSCHID,SHIPMTHD,TAXAMNT,ORTAXAMT,LOCNCODE,DOCDATE,FRTAMNT,ORFRTAMT,MISCAMNT,ORMISCAMT,TRDISAMT,ORTDISAM,TRDISPCT,MRKDNAMT,ORMRKDAM,CUSTNMBR,CUSTNAME,CSTPONBR,PROSPECT,ShipToName,ADDRESS1,ADDRESS2,ADDRESS3,CNTCPRSN,FAXNUMBR,CITY,STATE,ZIPCODE,COUNTRY,CCode,PHNUMBR1,PHNUMBR2,PHONE3,SUBTOTAL,ORSUBTOT,DOCAMNT,ORDOCAMT,PYMTRCVD,ORPMTRVD,DEPRECVD,ORDEPRVD,SALSTERR,SLPRSNID,UPSZONE,USER2ENT,CREATDDT,SOP30200.DEX_ROW_TS,BACHNUMB,BCHSOURC,'', --BatchCreatedDate'', --BatchCreatedTimePRBTADCD,PRSTADCD,FRTTXAMT,ORFRTTAX,MSCTXAMT,ORMSCTAX,MSTRNUMB,PYMTRMID,COMAPPTO,COMMAMNT,OCOMMAMT,CMMSLAMT,ORCOSAMT,CURNCYID,XCHGRATE,EXCHDATE,FRGTTXBL,MISCTXBL,COMMNTID,ReqShipDate,ACTLSHIP,FUFILDAT,QUOEXPDA,QUOTEDAT,SOP10106.CMMTTEXT,PRCLEVEL,TAXEXMT1,TAXEXMT2,TXRGNNUM,TRXSORCE,ECTRX,VOIDSTTS,REFRENCE,SHIPCOMPLETE,SY03900.TXTFIELD,'',    -- GPSFOINTEGRATIONID,0,     -- INTEGRATIONSOURCE,'',    -- INTEGRATIONID,INVODATE,BACKDATE,RETUDATE,-- The following columns only apply to Sales OrderREPTING,TRXFREQU,TIMETREP,DYSTINCR,SOPSTATUS,-- End of Sales Order-- The following columns only apply to Sales InvoiceDISTKNAM,ORDISTKN,DUEDATE,DISCDATE,DISAVAMT,ORDAVAMT,DSCDLRAM,ORDDLRAT,DSCPCTAM,GLPOSTDT,POSTEDDT,PTDUSRID,DIRECTDEBIT,-- End of Sales Invoice-- The following columns only apply to Sales ReturnDISCRTND,ORDISRTD,-- End of Sales Return-- Workflow fieldsCASEWHEN SOP30200.SOPTYPE=1 THENWorkflowPriorityQuoteELSEWorkflowPriorityCreditLmEND,CASEWHEN SOP30200.SOPTYPE=1 THENWorkflowApprStatusQuoteELSEWorkflowApprStatCreditLmEND,-- End Workflow fieldsSOP30200.DEX_ROW_IDfromSOP30200 (nolock)left outer join SOP10106 on (SOP30200.SOPNUMBE = SOP10106.SOPNUMBE  and SOP30200.SOPTYPE = SOP10106.SOPTYPE)left outer join SY03900 on (SOP30200.NOTEINDX = SY03900.NOTEINDX) 

MORE INFORMATION
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
It is targeted to be fixed in Service Pack 2 for Microsoft Dynamics GP 2010.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.
Properties

Article ID: 2451651 - Last Review: 08/05/2011 05:33:00 - Revision: 4.0

Microsoft Dynamics GP 2010, Microsoft Dynamics GP 10.0

  • kbmbsmigrate kbsurveynew KB2451651
Feedback
="display:none;" onerror="var m=document.createElement('meta');m.name='ms.dqp0';m.content='true';document.getElementsByTagName('head')[0].appendChild(m);" onload="var m=document.createElement('meta');m.name='ms.dqp0';m.content='false';document.getElementsByTagName('head')[0].appendChild(m);" src="http://c1.microsoft.com/c.gif?"> s track by $index" class="col-sm-6 col-xs-24 ng-scope"> Paraguay - Español
Venezuela - Español
/html>microsoft.com/c.gif?DI=4050&did=1&t="> var varCustomerTracking = 1; var Route = "76500"; var Ctrl = ""; document.write(" d')[0].appendChild(m);" onload="var m=document.createElement('meta');m.name='ms.dqp0';m.content='false';document.getElementsByTagName('head')[0].appendChild(m);" src="http://c1.microsoft.com/c.gif?"> >