ASP.NET - xmlformatter

Darryl Hoar 141 Reputation points
2024-03-27T19:42:09.1466667+00:00

I have software that was developed for me. It is ASP.NET which I have no experience with thus the development. This was delivered a long while ago. I need to make changes and am struggling.

This is a webservice with an api that you can call externally to retrieve data.

I am trying to figure out where the field order for export is specified.

A list of objects (records) is passed to the MediaTypeFormatter.WriteToStreamAsync method. Looking at method, I see no order specification.

Does the formatter just take the list of objects and output them using their properties as XML tags?

Any help greatly appreciated. A pointer to the (RTFM) fine manual would be helpful. I've googled but not found anything helpful.

Thanks.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,255 questions
{count} votes

Accepted answer
  1. Lan Huang-MSFT 25,556 Reputation points Microsoft Vendor
    2024-03-29T08:44:48.2133333+00:00

    Hi @Darryl Hoar,

    Why does it not return xml data for all the properties of the raweventrecord class?

    You mean to return only some properties. You didn't provide the code and can only guess at the cause.

    Service can't expose private/read-only properties.

    Maybe you can try using <XmlElement>.

    https://learn.microsoft.com/en-us/dotnet/standard/serialization/xml-serialization-with-xml-web-services

    0 comments No comments

0 additional answers

Sort by: Most helpful