title: Dynamically changing attributes for properties
body: <p>I am accessing a web service which provides a single method <code>ProcessMessage</code> this method looks like:</p>
  
  <pre><code>&lt;System.Web.Services.Protocols.SoapHeaderAttribute("payloadManifest", Direction:=System.Web.Services.Protocols.SoapHeaderDirection.InOut), _
       System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://exampleurl/operations/ProcessMessage/v1_01/GetTest1" &amp; _
          "", RequestNamespace:="http://exampleurl", ResponseNamespace:="http://exampleurl", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)&gt; _
  Public Sub ProcessMessage(ByRef payload As Payload)
      Try
          Dim results() As Object = Me.Invoke("ProcessMessage", New Object() {payload})
          payload = CType(results(0), Payload)
          Dim i As Integer = 0
      Catch ex As Exception
  
      End Try
  End Sub
  </code></pre>
  
  <p>This works fine, however, this method is to be used for various different functions. If the <code>SoapDocumentMethodAttribute</code> <code>Action</code> is changed <code>ProcessMessage</code> returns different values.</p>
  
  <p>Example:</p>
  
  <p>Change</p>
  
  <pre><code>System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://exampleurl/operations/ProcessMessage/v1_01/GetTest1"
  </code></pre>
  
  <p>To</p>
  
  <pre><code>System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://exampleurl/operations/ProcessMessage/v1_01/GetTest2"
  </code></pre>
  
  <p>Now the problem is, as far as I can see, this <code>Action</code> needs to be hard-coded into the file and therefore I can only run 1 method with each compiled program. Is there any way of dynamically changing the <code>Action</code> or should I be approaching this differently?</p>