Я доступ к веб-сервиса, который обеспечивает единый метод ProcessMessage
этот метод выглядит следующим образом:Динамически изменяющиеся атрибуты свойств
<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" & _
"", RequestNamespace:="http://exampleurl", ResponseNamespace:="http://exampleurl", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
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
Это прекрасно работает, однако, этот метод должен быть использован для выполнения различных функций. Если изменяется SoapDocumentMethodAttribute
Action
, то ProcessMessage
возвращает разные значения.
Пример:
Изменить
System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://exampleurl/operations/ProcessMessage/v1_01/GetTest1"
Для
System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://exampleurl/operations/ProcessMessage/v1_01/GetTest2"
Теперь проблема, насколько я могу судить, это Action
потребности быть жестко закодированы в файл и поэтому я могу запускать только один метод с каждой скомпилированной программой. Есть ли способ динамического изменения Action
или я должен приближаться к этому по-другому?