0

I need some help with this code, i'm almost new with this language. I got (for example) this SOAP input:

<person xmlns="http://www.example.com/ws/">
  <name>Elmer</name>
  <sex>Male</sex>
  <boxes>
     <box>
       <title>shoes</title>
       <items>5</items>
     </box>
     <box>
       <title>shirts</title>
       <items>2</items>
     </box>
     <box>
       <title>hats</title>
       <items>4</items>
     </box>
  </boxes>
</person >

I have a method that processes the arguments and stored in a database. But my question is, how can i process the multiple values of 'boxes'?

By example:

public string person(string name, string sex, ??? boxes)
    {
        foreach(??? in boxes)
        {
            boxes.title???
            boxes.items???
        }
        string response = "ok";
        return response;
    }

How can i get that values?

it is a POST. The soap came like a parameter (or argument) in the method. I can't read it like a text and then convert to XML!

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • How are your arguments derived from the soap input? – Ian Sep 29 '15 at 16:32
  • I've got no access to that. I just receive and work with that – Elmer Quero Sep 29 '15 at 16:52
  • Can i do something like this? public string person(XmlDocument everything) { ??? } – Elmer Quero Sep 29 '15 at 16:53
  • possible duplicate of [Read Soap Message using C#](http://stackoverflow.com/questions/12201822/read-soap-message-using-c-sharp) – Ian Sep 30 '15 at 09:01
  • Check out this question, I think it will help you: http://stackoverflow.com/questions/12201822/read-soap-message-using-c-sharp – Ian Sep 30 '15 at 09:02
  • Thanks for your help, but in that example, they read an xml document. In my case, it is a soap/xml method, that in some cases, an xml node call an argument, and in other, a tree of nodes call something else. It's like an hybrid – Elmer Quero Sep 30 '15 at 11:44

0 Answers0