0

I got the below REST service, I need to test it from fiddler, and I've searched alot, I figured how the payload is structured like the below:

<Update xmlns="http://tempuri.org/">
    <value></value>
</Update>

"value" can be XElement or IEnumerable<XElement> and nothing else.

the above XML is okay (means it hits a break point with empty pure object instance passed) but if I put "anything" inside node, I get 400 Bad Request without hitting any of my break points.

public interface ISomeInterface
{
    [WebInvoke(Method = "PUT", UriTemplate = "/{key}", BodyStyle = WebMessageBodyStyle.WrappedRequest)]
    void Update(string key, object value);

    [WebInvoke(Method = "DELETE", UriTemplate = "/{key}")]
    void Delete(string key);        
}

public void Update(string key, object value)
{
    this.UpdateSomething(key, value, true);
}

The question is how to create a proper xml to pass it to the service with Fiddler?

Ryan Gates
  • 4,501
  • 6
  • 50
  • 90
nolimit
  • 814
  • 10
  • 19

2 Answers2

0

creating a template xml from the schema (if you are using any) used by your server-side component is a good start. other wise , you can compose a simple xml with all the attributes you are extracting at the Service(manual and error prone)

TheWhiteRabbit
  • 15,480
  • 4
  • 33
  • 57
  • As I mentioned, I'm expecting XElement or array of XElements, so no xml template of any kind. Also I don't get any help from the service help page because the schema cannot be inferred at this point because of the WrappedRequest attrib. I basically need to pass a flat xml in the form or key value pair in a form of XElement(s). – nolimit Jan 31 '13 at 14:44
-1

Try BodyStyle = WebMessageBodyStyle.Bare

Saverio Terracciano
  • 3,885
  • 1
  • 30
  • 42
Mev
  • 1