1
我访问一个Web服务,它提供了一个方法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
需要被硬编码到该文件,因此我只能对每个编译好的程序运行1个方法。是否有任何动态更改Action
的方法,还是应该以不同的方式处理这些问题?