title: How do I create a Request in XML for a .NET web service?
body: <p>How can I specify the Request object formatting in XML? My web services look like this:</p>
  
  <pre><code>[WebMethod]
  public string MethodName(string str, string str2)
  {
      if (random())
          return "123";
      else
          return "no";
  }
  </code></pre>
  
  <p>Everything is in strings. How do I specify to a consumer what to request in XML? I am used to specifying this as HTTP GET:</p>
  
  <pre><code>http://domain.tld/service.asmx/MethodName?str=textgoeshere&amp;str2=moretext
  </code></pre>
  
  <p>What does the whole XML Request object look like, and where can I find this format/specification in the future if I change data types or parameter names?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Current WSDL output:</p>
  
  <pre><code>&lt;wsdl:definitions targetNamespace="my namespace"&gt;
  &lt;wsdl:types&gt;
  &lt;s:schema elementFormDefault="qualified" targetNamespace="my namespace"&gt;
  &lt;s:element name="MyMethodName"&gt;
  &lt;s:complexType&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="str" type="s:string"/&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="str2" type="s:string"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;/s:element&gt;
  &lt;s:element name="MyMethodNameResponse"&gt;
  &lt;s:complexType&gt;
  &lt;s:sequence&gt;
  &lt;s:element minOccurs="0" maxOccurs="1" name="MyMethodNameResult" type="s:string"/&gt;
  &lt;/s:sequence&gt;
  &lt;/s:complexType&gt;
  &lt;/s:element&gt;
  </code></pre>
  
  <p>Is the following an accurate XML specification?</p>
  
  <pre><code>&lt;?xml version="1.0"&gt;
  &lt;str&gt;1&lt;/str&gt;
  &lt;str2&gt;123456789&lt;/str2&gt;
  </code></pre>