title: Issue submitting XML from an iPhone to a .NET SOAP Web Service
body: <p>My iPhone application needs to submit an object to an already existing .NET SOAP Web Service so it can be saved to a database server. I figured the easiest way to go about this would be building an XML representation of the object and passing it to the web service. However, this doesn’t seem to be working. If the XML is more than one level deep the web service method appears to not be getting called (The web service method writes an entry to the event log when it is called).</p>
  
  <p>For example if the XML is:</p>
  
  <pre><code>&lt;Name&gt;Jim&lt;/Name&gt;
  </code></pre>
  
  <p>The web service method gets called and there is an entry in the event log on the web server.</p>
  
  <p>If the XML is:</p>
  
  <pre><code>&lt;Person&gt;&lt;Name&gt;Jim&lt;/Name&gt;&lt;/Person&gt;
  </code></pre>
  
  <p>The web service method is not called (there is no entry in the event log).</p>
  
  <p>Here is the web service method definition:</p>
  
  <pre><code>public string SubmitiPhoneObject(string theObjectAsXml) {
      WriteToEventLog("Begin Service.SubmitiPhoneObject");
      // Do some work…
  }
  </code></pre>
  
  <p>And here is the SOAP request I am submitting from the iPhone:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
      &lt;SubmitiPhoneObject xmlns="http://www.myServer.com/iPhoneService/"&gt;
          &lt;theObjectAsXml&gt;
              &lt;TheObject&gt;
                  &lt;PersonID&gt;5263&lt;/PersonID&gt;
                  &lt;DepartmentID&gt;379&lt;/DepartmentID&gt;
              &lt;/TheObject&gt;
          &lt;/theObjectAsXml&gt;
      &lt;/SubmitiPhoneObject&gt;
  &lt;/soap:Body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Anyone have any idea why the web service method isn’t getting called? Anyone have better/easier suggestions on how to submit an object to a web service from an iPhone application?</p>
  
  <p>Thanks!</p>