title: WCF with ws-address: creating bare parameters
body: <p>I'm trying to create a WCF SOAP service that has a service method that accepts bare parameters in the body but I just cant make it happen. At the moment, the method name element is being created under the body. I'm trying to use ws-addressing so that the method name is part of the header and the parameters are the direct children of the body. </p>
  
  <p>Here's my service implementation:</p>
  
  <pre><code>[SoapDocumentService(Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Bare)]
  public class Service1 : IService1
  {        
      [SoapDocumentMethod(Use=SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Bare)]
      public void DoWork([XmlElement(Namespace = "http://www.contoso.com",
                  IsNullable = true)] MyClass wrapper)
      {
      }
  }
  
  [XmlRoot(Namespace = "http://www.contoso.com")]
  public class MyClass
  {
      public int Value { get; set; }
      public string MyProperty { get; set; }
  }
  
  [ServiceContract]
  public interface IService1
  {
      [OperationContract]
      void DoWork(MyClass wrapper);
  }
  </code></pre>
  
  <p>The above implementation generates the soap client below. But I'm trying to have the wrapper element as the direct child on body (trying to remove DoWork). From what I've read, decorating the svc method to use bare parameters should remove the service method name (DoWork) and use ws-addressing.</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/" xmlns:web="http://schemas.datacontract.org/2004/07/WebApplication2"&gt;
     &lt;soap:Header/&gt;
     &lt;soap:Body&gt;
        &lt;tem:DoWork&gt; &lt;!-- I want to remove this svc method name element  -- &gt;
           &lt;tem:wrapper&gt;  &lt;!-- I want this to be under the body --&gt;
              &lt;!--Optional:--&gt;
              &lt;web:MyProperty&gt;?&lt;/web:MyProperty&gt;
              &lt;!--Optional:--&gt;
              &lt;web:Value&gt;?&lt;/web:Value&gt;
           &lt;/tem:wrapper&gt;
        &lt;/tem:DoWork&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>I've followed the guide from msdn to decorate the service method. <a href="http://msdn.microsoft.com/en-us/library/dkwy2d72%28v=vs.71%29.aspx#cpconcustomizingsoapinaspnetwebserviceswebserviceclientsanchor2" rel="nofollow">MSDN Link</a></p>