Lotus Notes WebService 消费者填充数组 XSD_STRING
Lotus Notes WebService Consumer populate Array XSD_STRING
关于 Lotus Notes 网络服务消费者(用 Lotus 脚本编写),我遇到了一些真正的麻烦。
问题是我正在发送一个数组(作为 Class)来键入 XSD_Anytype
,见下文。
***************************************
**** Snippet from WebService **********
%INCLUDE "lsxsd.lss"
Class ArrayOfString_n1 As XSD_ANYTYPE
Public string() As XSD_STRING
Sub NEW
End Sub
End Class
Const n1 = "http://xx.xx.x.xx/XXX/Statistic/Account/"
Class UserIDSoap_n1 As PortTypeBase
Sub NEW
Call Service.Initialize ("HttpxxxxxxxXXXStatisticAccountUserID", _
"UserID.UserIDSoap", "http://xx.xx.x.xx/XXX/Statistic/Account/Account.asmx", _
"UserIDSoap_n1")
End Sub
Function setAccount(IV_list As ArrayOfString_n1) As ArrayOfString_n1
Set setAccount = Service.Invoke("setAccount", IV_list)
End Function
End Class
Class XXXsetAccount As UserIDSoap_n1
Sub NEW
Call Service.Initialize ("HttpxxxxxxxXXXStatisticAccountUserID", _
"UserID.UserIDSoap", "http://xx.xx.x.xx/XXX/Statistic/Account/Account.asmx", _
"UserIDSoap_n1")
End Sub
Function setAccount(IV_list As ArrayOfString_n1) As ArrayOfString_n1
Set setAccount = Service.Invoke("setAccount", IV_list)
End Function
End Class
**** Snippet from WebService **********
***************************************
在我的程序中,我试图填充上面 class 的数组。
当我为数组赋值时,我能够发送并从被调用的 URI 返回正确的答案。
我的问题是为数组分配不同的值。
mmm
似乎是一个引用,因此它改变了整个数组 (LA_String
)。
***************************************
**** Snippet from program *************
Dim mmm As XSD_STRING
Dim LA_string As New ArrayOfString_n1()
ReDim Preserve LA_string.String( CInt( view.Entrycount ) - 1 )
Dim i As Integer
i = 0
Do While Not ( dok Is Nothing )
mmm.setValueFromString( dok.FieldWithValue( 0 ) )
set LA_string.string(i) = mmm
i = i + 1
Set dok = View.GetNextDocument( dok )
Loop
**** Snippet from program *************
***************************************
是的,mmm
是引用,因此您需要在循环中每次创建新的 XSD_String
对象。
这是示例:
Dim mmm As XSD_STRING
Dim LA_string As New ArrayOfString_n1()
ReDim Preserve LA_string.String( CInt( view.Entrycount ) - 1 )
Dim i As Integer
i = 0
Do While Not ( dok Is Nothing )
Set mmm = New XSD_STRING() ' <= Create new object here.
mmm.setValueFromString( dok.FieldWithValue( 0 ) )
set LA_string.string(i) = mmm
i = i + 1
Set dok = View.GetNextDocument( dok )
Loop
关于 Lotus Notes 网络服务消费者(用 Lotus 脚本编写),我遇到了一些真正的麻烦。
问题是我正在发送一个数组(作为 Class)来键入 XSD_Anytype
,见下文。
***************************************
**** Snippet from WebService **********
%INCLUDE "lsxsd.lss"
Class ArrayOfString_n1 As XSD_ANYTYPE
Public string() As XSD_STRING
Sub NEW
End Sub
End Class
Const n1 = "http://xx.xx.x.xx/XXX/Statistic/Account/"
Class UserIDSoap_n1 As PortTypeBase
Sub NEW
Call Service.Initialize ("HttpxxxxxxxXXXStatisticAccountUserID", _
"UserID.UserIDSoap", "http://xx.xx.x.xx/XXX/Statistic/Account/Account.asmx", _
"UserIDSoap_n1")
End Sub
Function setAccount(IV_list As ArrayOfString_n1) As ArrayOfString_n1
Set setAccount = Service.Invoke("setAccount", IV_list)
End Function
End Class
Class XXXsetAccount As UserIDSoap_n1
Sub NEW
Call Service.Initialize ("HttpxxxxxxxXXXStatisticAccountUserID", _
"UserID.UserIDSoap", "http://xx.xx.x.xx/XXX/Statistic/Account/Account.asmx", _
"UserIDSoap_n1")
End Sub
Function setAccount(IV_list As ArrayOfString_n1) As ArrayOfString_n1
Set setAccount = Service.Invoke("setAccount", IV_list)
End Function
End Class
**** Snippet from WebService **********
***************************************
在我的程序中,我试图填充上面 class 的数组。
当我为数组赋值时,我能够发送并从被调用的 URI 返回正确的答案。
我的问题是为数组分配不同的值。
mmm
似乎是一个引用,因此它改变了整个数组 (LA_String
)。
***************************************
**** Snippet from program *************
Dim mmm As XSD_STRING
Dim LA_string As New ArrayOfString_n1()
ReDim Preserve LA_string.String( CInt( view.Entrycount ) - 1 )
Dim i As Integer
i = 0
Do While Not ( dok Is Nothing )
mmm.setValueFromString( dok.FieldWithValue( 0 ) )
set LA_string.string(i) = mmm
i = i + 1
Set dok = View.GetNextDocument( dok )
Loop
**** Snippet from program *************
***************************************
是的,mmm
是引用,因此您需要在循环中每次创建新的 XSD_String
对象。
这是示例:
Dim mmm As XSD_STRING
Dim LA_string As New ArrayOfString_n1()
ReDim Preserve LA_string.String( CInt( view.Entrycount ) - 1 )
Dim i As Integer
i = 0
Do While Not ( dok Is Nothing )
Set mmm = New XSD_STRING() ' <= Create new object here.
mmm.setValueFromString( dok.FieldWithValue( 0 ) )
set LA_string.string(i) = mmm
i = i + 1
Set dok = View.GetNextDocument( dok )
Loop