Webservice Lotus Script STRINGARRAY_HOLDER

Hi All, :slight_smile:

Im having really big trouble regarding the use of a class with STRINGARRAY_HOLDER as a variable type.

Im sending an array to to my Lotus Notes webservice. Everything works fine.

But Im not able to access it when nessceary.

The story is:

  1. LotusNotes webservice is called from C#.

  2. LotusNotes webservice accepts all data from the sender.

  3. I want to save a document with the data - And now I can’t access the data.

Thanks in advance

Lars Bernstorff Hansen

Code below:

'****************************

Public Class Webservice

Public Sub new()

End Sub	

Public Function setAgencies(IA_TS As STRINGARRAY_HOLDER, IA_ID_Agency As STRINGARRAY_HOLDER, IA_Code As STRINGARRAY_HOLDER, IA_Name As STRINGARRAY_HOLDER, IA_Adress As STRINGARRAY_HOLDER, IA_City As STRINGARRAY_HOLDER, IA_ZipCode As STRINGARRAY_HOLDER)  As Boolean

	

	Set TS				= IA_TS

	Set ID_Agency	= IA_ID_Agency

	Set Code			= IA_Code

	Set NameAgent	= IA_Name

	Set Adress			= IA_Adress

	Set City				= IA_City

	Set ZipCode		= IA_ZipCode

	cnt = 0

	

	

	Dim Agencies As New Agencies(IA_TS, IA_ID_Agency, IA_Code, IA_Name, IA_Adress, IA_City, IA_ZipCode)

	If createAgencies(Agencies) = True Then setAgencies = True	

	

	setAgencies = True

End Function	





Private Function createAgencies(Agencies As Agencies)

	

	Dim s 				As Variant

	Dim session 			As New NotesSession

	Dim db 				As NotesDatabase

	Dim NotesDocumentCollection  	As NotesDocumentCollection 

	Dim view 			As NotesView

	Dim dok 			As NotesDocument

	Dim cnt 			As Integer

	'** Notes assignments:

	Set db = session.CurrentDatabase	

	Set dok = New NotesDocument(db)

	IV_UID = dok.UniversalID

	

	'** Assignments:

	createAgencies = False

	

	

	

	Forall item In TS

		cnt= cnt+1			

	End Forall

	

	Call dok.RemoveItem( "Form" )

	dok.Form = "(WS)"

	dok.ID	 = Cstr(cnt) 

	

	Call dok.Save(True,True)

	createAgencies = True

	

End Function

End Class

Public Class Agencies

	Public TS		As STRINGARRAY_HOLDER

	Public ID_Agency 	As STRINGARRAY_HOLDER

	Public Code 		As STRINGARRAY_HOLDER

	Public Name 		As STRINGARRAY_HOLDER

	Public Adress 		As STRINGARRAY_HOLDER

	Public City 		As STRINGARRAY_HOLDER

	Public ZipCode 		As STRINGARRAY_HOLDER

	Public cnt		As Integer



	Public Sub new(IA_TS As STRINGARRAY_HOLDER, IA_ID_Agency As STRINGARRAY_HOLDER, IA_Code As STRINGARRAY_HOLDER, IA_Name As STRINGARRAY_HOLDER, IA_Adress As STRINGARRAY_HOLDER, IA_City As STRINGARRAY_HOLDER, IA_ZipCode As STRINGARRAY_HOLDER)

	

		Set TS 		= IA_TS

		Set ID_Agency 	= IA_ID_Agency

		Set Code	= IA_Code

		Set NameAgent	= IA_Name

		Set Adress	= IA_Adress

		Set City	= IA_City

		Set ZipCode	= IA_ZipCode

’ Forall item In IA_TS

’ cnt = cnt + 1

’ End Forall

End Sub

End Class

Subject: SOLVED Webservice Lotus Script STRINGARRAY_HOLDER

Problem Solved

Search and you will find…

Apparently the STRINGARRAY_HOLDER has a public attribute name Value.

Hence Agencies.ID_Agency.Value works.

Therefore

dok.ID_Agency = Agencies.ID_Agency.Value

does the trick.

Best regards

Lars Bernstorff Hansen

Subject: Can’t access the data means what?

Is the Notes doc created?Can you view it in Notes?

When you say you can’t access the data, what are you doing, what do you expect, and what is happening?

Have you done any debugging and what were the results?

Subject: RE: Can’t access the data means what?

I get a return code setAgencies = true in C# (The calling program)The notes document is createde.

Im not able to refer to the data e.g. via Agencies.TS or Agencies.City

I would like to do this (in function createAgencies):

dok.TS = Agencies.TS

dok.City = Agencies.City

But this doesn’t work

I really need some help here :frowning:

Thanks in advance

Lars