1

If this makes any difference, the XML file is being sent from a handheld device.

There are a couple of interesting answers to a similar question here, but I'm not sure the more popular answer really addresses my situation (where the client seems to be passing a custom type (ComputerInfo)) whereas in my case it is an actual XML file is the arg being passed.

The second answer looks perhaps more "up my alley/what the doctor ordered" but I don't know what signature my method should have. Something like this:

public async Task<HttpResponseMessage> PostXMLFile(XMLDocument xmlFile) {

?

Adding to my doubts is that the XMLDocument type is unrecognized, and there is no "Resolve" context menu item to formally introduce it to the project).

And, can a CF app deal with a returned Task anyway? I doubt it, so: what should my Web API method receiving an XML file look like?

1 Answer 1

4

Try this instead,

public async Task<HttpResponseMessage> PostXMLFile(XElement xElement) {

Whether you user the above signature or,

public HttpResponseMessage PostXMLFile(XElement xElement) {

the client will see exactly the same response. Use the first signature when you need to make an async request within your action method.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.