Lotus notes Lotus Notes Web服务使用者填充数组XSD_字符串
关于Lotus Notes Web服务消费者(用Lotus脚本编写),我遇到了一些实际问题。Lotus notes Lotus Notes Web服务使用者填充数组XSD_字符串,lotus-notes,lotusscript,Lotus Notes,Lotusscript,关于Lotus Notes Web服务消费者(用Lotus脚本编写),我遇到了一些实际问题。 问题是我正在发送一个数组(作为一个类)到typeXSD_Anytype,请参见下文 *************************************** **** Snippet from WebService ********** %INCLUDE "lsxsd.lss" Class ArrayOfString_n1 As XSD_ANYTYPE Public string() As
问题是我正在发送一个数组(作为一个类)到type
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 **********
***************************************
在我的程序中,我试图填充上述类的数组。当我给数组赋值时,我就能够从被调用的URI返回正确的答案 我的问题是为数组分配不同的值。
似乎
mmm
是一个引用,因此它改变了整个数组(LA_String
)
是的,
mmm
是引用,因此您需要在周期中每次创建新的XSD_字符串
对象。下面是一个例子:
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
Dim mmm作为XSD_字符串
将LA_字符串变暗为新的ArrayOfString_n1()
ReDim Preserve LA_string.string(CInt(view.Entrycount)-1)
作为整数的Dim i
i=0
做而不做(dok什么都不是)
设置mmm=newxsd_STRING()'非常感谢:-)。事实上,我尝试了这种方法——不知何故——但我肯定做了一些稍微不同/错误的事情,因为你的解决方案100%有效。如果我应该给你的答案评分,我不知道怎么做,所以请原谅我在这种情况下。再次感谢您的快速回答。@LarsHansen您应该有足够的声誉来赢得一些选票、标记等。@LarsHansen如果将评论标记为有用的评论,您就会声称该评论是有用的。这次行动没有什么名声。是您可以获得/失去声誉的行动列表。
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