Skip to main content
1-Visitor
October 23, 2020
Solved

C# SDK XML BaseType Mapping

  • October 23, 2020
  • 1 reply
  • 1707 views

Hello 

 

I am struggling   to find how to map a XML parameter  of a service to a C# type.

 

Currently I have that:

 

public static void PutWorkOrder(
[ThingworxServiceParameter(name = "WorkOrder", description = "XML document", baseType = "XML")]
XmlDocument WorksOrder)

 

But I am not sure that  XmlDocument is the right type for mapping . ( Always null when debugging)

Thanks a lot

Best answer by SD_9534978

Hi

 

I found the problem. It was a typo in the parameters 😉

 

public static void PutWorkOrder(
[ThingworxServiceParameter(name = "WorkOrder", description = "XML document", baseType = "XML")]
XmlDocument WorksOrder)

1 reply

Support
October 27, 2020

Hi @SD_9534978.

 

This looks like a small portion of the code.  Is there somewhere else in the code where you loading in the XML document?

 

Regards.

 

--Sharon

SD_95349781-VisitorAuthorAnswer
1-Visitor
October 27, 2020

Hi

 

I found the problem. It was a typo in the parameters 😉

 

public static void PutWorkOrder(
[ThingworxServiceParameter(name = "WorkOrder", description = "XML document", baseType = "XML")]
XmlDocument WorksOrder)

Support
October 27, 2020

Hi @SD_9534978.

 

Glad you figured it out!  Please mark your last response as the Accepted Solution for the benefit of others with the same issue.

 

Regards.

 

--Sharon