error generating the XML document - Workday WebAPI

0

When calling a Workday API Assign_Costing_Allocation there is suddenly an XML generation error:

System.ServiceModel.CommunicationException
  HResult=0x80131501
  Message=There was an error in serializing body of message Assign_Costing_AllocationInput: 'There was an error generating the XML document.'.  Please see InnerException for more details.
  Source=mscorlib
  StackTrace:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at PostBudget.PayrollService.PayrollPort.Assign_Costing_Allocation(Assign_Costing_AllocationInput request)
...
Inner Exception 1:
InvalidOperationException: There was an error generating the XML document.

Inner Exception 2:
InvalidOperationException: The type PostBudget.PayrollService.Tenanted_Payroll_WorktagObjectIDType was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.

PostBudget.PayrollService.Tenanted_Payroll_WorktagObjectIDType is supplied in References.cs, auto-generated and has the serialization tags:

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.2612.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:com.workday/bsvc")]
public partial class Tenanted_Payroll_WorktagObjectIDType : object, System.ComponentModel.INotifyPropertyChanged { ... }

How to debug this? What can I do to make this work?

c#
xml
soap
xml-serialization
workday-api
asked on Stack Overflow May 22, 2018 by jprusakova • edited May 22, 2018 by jprusakova

1 Answer

0

There is an error in References.cs, generated from the WSDL, listing incorrect type Tenanted_Payroll_WorktagObjectType, instead of Tenanted_Payroll_WorktagObjectIDType where an Tenanted_Payroll_WorktagObjectIDType is required. Manually changing the auto-generated file fixed the issue.

answered on Stack Overflow May 22, 2018 by jprusakova

User contributions licensed under CC BY-SA 3.0