Skip to main content
Oct 23, 2020 9:10 AM UTC
Solved

C# SDK XML BaseType Mapping

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

Oct 27, 2020 4:56 PM UTC

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)

3 replies

Oct 27, 2020 2:36 PM UTC

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_9534978AuthorAnswer
Oct 27, 2020 4:56 PM UTC

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)

Oct 27, 2020 6:05 PM UTC

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