Web Service Consumer

Hi all,I need help with a web service consumer in Domino 8.5.1.

I have a WSDL imported correctly and need to call a function called “doSearch”.

This function is for a SOAP-Request.

Function doSearch(wsUserInfo As WSUserInfo_n2, searchNo As XSD_STRING, noRadio As XSD_STRING) As SntInfo_n1_Array_Holder

	Set doSearch = Service.Invoke("doSearch", wsUserInfo, searchNo, noRadio)

End Function

I have to pass trough 3 variables:

wsUserInfo as WSuserInfo_n2,

searchNo as XSD_String and

noRadio as XSD_String

Here is the code for WSuserInfo_n2:

Class WSUserInfo_n2 As XSD_ANYTYPE

Public authType As XSD_STRING

Public loginGroupID As XSD_STRING

Public password As XSD_STRING

Public userID As XSD_STRING



Sub NEW

End Sub

End Class

Can anybody give me a solution/tip how to call the function?

Call doSearch(wsUserInfo, “Test1234”, “1”)

I don´t get it work because I dont know how to pass trough the “wsUserInfo”-Class.

In that Class there are 4 other variables declared.

Thanks in advance for your tip/solution.

Subject: Webservice consumer clarification.

Hello

Greetings!!

I am using lotus notes 8.5 client and writing the lotus script agent that refers to below Webservice consumer program. The output function is of type “UploadProjectResponse_n9” as in below code snippet. Please clarify how to get the values of ‘EnumMessageItemType_n10’ and ‘SuccessStatus_n10’ in my agent code.

Thanks in advance,

Sundar.

Class UploadResponse_n9 As XSD_ANYTYPE

Public MessageList As ArrayOfResponseMessageItem_n9

Public Successful As SuccessStatus_n10

Sub NEW

End Sub

End Class

Const SuccessStatus_n10_Failure$ = “Failure”

Const SuccessStatus_n10_Success$ = “Success”

Dim Failure_SuccessStatus_n10 As SuccessStatus_n10

Dim Success_SuccessStatus_n10 As SuccessStatus_n10

Dim Enum_SuccessStatus_n10 List As SuccessStatus_n10

Class SuccessStatus_n10 As XSD_ANYTYPE

Public Value As String

Sub NEW

End Sub

Sub Initialize (elem As String)

Let Value = elem

Set Enum_SuccessStatus_n10(Cstr(Value)) = Me

End Sub

Function Equals (you As SuccessStatus_n10) As Boolean

If (Strcompare(Cstr(Me.Value), you.ToString, 5) = 0) Then

Let Equals = True

Else

Let Equals = False

End If

End Function

Function ToString As String

Let ToString = Cstr(Value)

End Function

End Class

Const EnumMessageItemType_n10_Information$ = “Information”

Const EnumMessageItemType_n10_Error$ = “Error”

Const EnumMessageItemType_n10_Warning$ = “Warning”

Dim Information_EnumMessageItemType_n10 As EnumMessageItemType_n10

Dim Error_EnumMessageItemType_n10 As EnumMessageItemType_n10

Dim Warning_EnumMessageItemType_n10 As EnumMessageItemType_n10

Dim Enum_EnumMessageItemType_n10 List As EnumMessageItemType_n10

Class EnumMessageItemType_n10 As XSD_ANYTYPE

Public Value As String

Sub NEW

End Sub

Sub Initialize (elem As String)

Let Value = elem

Set Enum_EnumMessageItemType_n10(Cstr(Value)) = Me

End Sub

Function Equals (you As EnumMessageItemType_n10) As Boolean

If (Strcompare(Cstr(Me.Value), you.ToString, 5) = 0) Then

Let Equals = True

Else

Let Equals = False

End If

End Function

Function ToString As String

Let ToString = Cstr(Value)

End Function

End Class

Class ResponseMessageItem_n9 As XSD_ANYTYPE

Public Message As XSD_STRING

Public MessageType As EnumMessageItemType_n10

Sub NEW

End Sub

End Class

Class UploadProjectResponse_n9 As XSD_ANYTYPE

Public UploadProjectResult As UploadResponse_n9

Sub NEW

End Sub

End Class

Class ArrayOfResponseMessageItem_n9 As XSD_ANYTYPE

Public ResponseMessageItem() As ResponseMessageItem_n9

Sub NEW

End Sub

End Class

Thanks,

Sundar

Subject: Did you create an instance of the class and pass in that instance

Dim myclass as new WSUserInfo_n2myclass.userid = “whatever”

'and so forth

then pass in myclass in your web service call

Subject: thats what i tried

Hi, thank you for your post.

I tried your tip before.

Following is my test script in an action.

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim CurrentDoc As NotesUIDocument



Set CurrentDoc = WorkSpace.CurrentDocument

Dim  WSUserInfo As New  WSUserInfo_n2





WSUserInfo.authType = "test"

WSUserInfo.loginGroupID = "testdefault"

WSUserInfo.password = "TestUserPW"

WSUserInfo.userID = "TestUser"



searchNo = currentdoc.FieldGetText("serialno")

noRadio = "1"

Call doSearch(WSUserInfo, searchNo, noRadio)

End Sub

When I try to save it gives me following errors:

“Type Mismatch on: SEARCHNO”

“Type Mismatch on: noRadio”

“Set required on class Instance:WSUserInfo.userID = “TestUser””

How must I declare the variables in my action?

searchno and Noradio is “XSD_String” in Wsdl,

wsuserinfo.values are also “XSD_String” in Class WSuserinfo_n2.

Maybe you have another tip for me?

Thanks in Advance.

Subject: XSD_STRING

Hi,

Dim searchNo As New XSD_STRING

searchNo.setValueFromString(currentdoc.FieldGetText(“serialno”))

  • Panu

Subject: ok it works, but one last issue

Thank you for solution, Declaration works fine.

Now that is my current script.

Dim workspace As New NotesUIWorkspace

Dim CurrentDoc As NotesUIDocument



Set CurrentDoc = WorkSpace.CurrentDocument

Dim  WSUserInfo As New  WSUserInfo_n2

Dim searchNo As New XSD_String

Dim noRadio As New XSD_String

Dim authType As New XSD_String

Dim loginGroupID As New XSD_String

Dim password As New XSD_String

Dim userID As New XSD_String



searchNo.setValueFromString(currentdoc.FieldGetText("serialNo"))

noRadio.setValueFromString("1")	



WSUserInfo.authType.setValueFromString("test")

WSUserInfo.loginGroupID.setValueFromString("testdefault")	

WSUserInfo.password.setValueFromString("testpw")	

WSUserInfo.userID.setValueFromString("testuser")	





Call doSearch(WSUserInfo, searchNo, noRadio)

Now i get error in setting the 4 variables whicht are declared as “XSD_String” in Class WSUserinfo_n2.

Here is excerpt of WSDL:

Class WSUserInfo_n2 As XSD_ANYTYPE

Public authType As XSD_STRING

Public loginGroupID As XSD_STRING

Public password As XSD_STRING

Public userID As XSD_STRING



Sub NEW

End Sub

End Class

How is now the correct way to set these 4 variables?

I think the way i did it above is not correct when the variable is declared in on class.

Thanks in advacne.

You saved me to not banging my head again and again against a wall.

Subject: last question solved, another error

Ok i solved my last question, saving my script works fine.

Now, when i call my following script, I receive error “Object variable not set” in WSDL-Function.

Script to Call:

Dim workspace As New NotesUIWorkspace

Dim CurrentDoc As NotesUIDocument



Set CurrentDoc = WorkSpace.CurrentDocument

Dim  WSUserInfo As New  WSUserInfo_n2

Dim searchNo As New XSD_String

Dim noRadio As New XSD_String

Dim authType As New XSD_String

Dim loginGroupID As New XSD_String

Dim password As New XSD_String

Dim userID As New XSD_String



searchNo.setValueFromString(currentdoc.FieldGetText("seriennummer"))

noRadio.setValueFromString("1")	



authType.setValueFromString("test")

loginGroupID.setValueFromString("testdefault")	

password.setValueFromString("testpw")	

userID.setValueFromString("testuser")	



Set Wsuserinfo.authtype = authtype

Set Wsuserinfo.loginGroupID = loginGroupID

Set Wsuserinfo.password = password

Set Wsuserinfo.userID = userID



Call doSearch(WSUserInfo, searchNo, noRadio)

In this Line of Script it raises up the error.

Function doSearch(wsUserInfo As WSUserInfo_n2, searchNo As XSD_STRING, noRadio As XSD_STRING) As SntInfo_n1_Array_Holder

	Set doSearch = Service.Invoke("doSearch", wsUserInfo, searchNo, noRadio)

End Function

Debugger tells me that all variables having a value, but variable “WSuserinfo” is empty, when i expand it all 4 variables have a value.

What do I wrong?

Subject: Web Service Class

I assume “Function doSearch” is in Web Service Consumer and the other code somewhere else.

Looks like you are missing the web service class from your call which should look like this:

Dim MyWebServiceClass As New MyWebServiceClass

MyWebServiceClass.doSearch(WSUserInfo, searchNo, noRadio)

  • Panu

Subject: ok understand, but…

Thank you Panu for your help.

You are correct, “Function doSearch” is in Webconsumer, other code is in an action on a form.

You are saying that i might miss the web service class in my action.

Dim MyWebServiceClass As New MyWebServiceClass

MyWebServiceClass.doSearch(WSUserInfo, searchNo, noRadio)

What is my “MyWebserviceClass” in following code of complete WSDL?

%INCLUDE “lsxsd.lss”

Class SntInfo_n1 As XSD_ANYTYPE

Public cust_Grp_Name As XSD_STRING

Public cust_SN As XSD_STRING

Public de_No As XSD_STRING

Public exp_Date As XSD_STRING

Public model_No As XSD_STRING

Public partBelongsTo As XSD_STRING

Public prod_Sts As XSD_STRING

Public result_msg As XSD_STRING

Public sales_Cust_Name As XSD_STRING

Public sn As XSD_STRING

Public soldByOSC As XSD_STRING

Public trx_Date As XSD_STRING

Public tsb_Part_No As XSD_STRING

Public wrt_Period As XSD_STRING

Public wrt_Source As XSD_STRING

End Class

Class SntInfo_n1_Array_Holder As INOUT_HOLDER

Public Value() As SntInfo_n1

End Class

Class WSUserInfo_n2 As XSD_ANYTYPE

Public authType As XSD_STRING

Public loginGroupID As XSD_STRING

Public password As XSD_STRING

Public userID As XSD_STRING



Sub NEW

End Sub

End Class

Const n1 = “http://provider.test.com/xsd

Const n0 = “http://provider.test.com

Const n2 = “http://auth.web_service.test.com/xsd”

Class SntServicePortType_n0 As PortTypeBase

Sub NEW

	Call Service.Initialize ("HttpProviderWeb_serviceImsntToshiba_solCoJpSntService", _

	"SntService.SntServiceHttpSoap11Endpoint", "http://1.1.1.1:80/SntService.SntServiceHttpSoap11Endpoint/", _

	"SntServicePortType_n0")

	

End Sub



Function doSearch(wsUserInfo As WSUserInfo_n2, searchNo As XSD_STRING, noRadio As XSD_STRING) As SntInfo_n1_Array_Holder

	Set doSearch = Service.Invoke("doSearch", wsUserInfo, searchNo, noRadio)

End Function

End Class

Thanks again for your help, I really appreciate it.

That is my first web consumer service i have to implement.

Subject: SntServicePortType_n0

Subject: SOLVED, thank you for your support

Finally “you” got it work. :-)Thanks again for your help.

Subject: Handling a XSD Variable

'For Initializing a XSD VariblesDim xsdBranchName As XSD_STRING

Set xsdBranchName = New XSD_STRING

’ Setting set Value From a String

Call xsdBranchName.setValueFromString(“Branch Name”)

'Reading a value into a string

Dim branchName as String

branchName = xsdBranchName.Getvalueasstring()

Narasimha Reddy, Lomadi

Subject: Webservice consumer coding help.

Hello

Greetings!!

I am using lotus notes 8.5 client and writing the lotus script agent that refers to below Webservice consumer program. The output function is of type “UploadProjectResponse_n9” as in below code snippet. Please clarify how to get the values of ‘EnumMessageItemType_n10’ and ‘SuccessStatus_n10’ in my agent code.

Thanks in advance,

Sundar.

Class UploadResponse_n9 As XSD_ANYTYPE

Public MessageList As ArrayOfResponseMessageItem_n9

Public Successful As SuccessStatus_n10

Sub NEW

End Sub

End Class

Const SuccessStatus_n10_Failure$ = “Failure”

Const SuccessStatus_n10_Success$ = “Success”

Dim Failure_SuccessStatus_n10 As SuccessStatus_n10

Dim Success_SuccessStatus_n10 As SuccessStatus_n10

Dim Enum_SuccessStatus_n10 List As SuccessStatus_n10

Class SuccessStatus_n10 As XSD_ANYTYPE

Public Value As String

Sub NEW

End Sub

Sub Initialize (elem As String)

Let Value = elem

Set Enum_SuccessStatus_n10(Cstr(Value)) = Me

End Sub

Function Equals (you As SuccessStatus_n10) As Boolean

If (Strcompare(Cstr(Me.Value), you.ToString, 5) = 0) Then

Let Equals = True

Else

Let Equals = False

End If

End Function

Function ToString As String

Let ToString = Cstr(Value)

End Function

End Class

Const EnumMessageItemType_n10_Information$ = “Information”

Const EnumMessageItemType_n10_Error$ = “Error”

Const EnumMessageItemType_n10_Warning$ = “Warning”

Dim Information_EnumMessageItemType_n10 As EnumMessageItemType_n10

Dim Error_EnumMessageItemType_n10 As EnumMessageItemType_n10

Dim Warning_EnumMessageItemType_n10 As EnumMessageItemType_n10

Dim Enum_EnumMessageItemType_n10 List As EnumMessageItemType_n10

Class EnumMessageItemType_n10 As XSD_ANYTYPE

Public Value As String

Sub NEW

End Sub

Sub Initialize (elem As String)

Let Value = elem

Set Enum_EnumMessageItemType_n10(Cstr(Value)) = Me

End Sub

Function Equals (you As EnumMessageItemType_n10) As Boolean

If (Strcompare(Cstr(Me.Value), you.ToString, 5) = 0) Then

Let Equals = True

Else

Let Equals = False

End If

End Function

Function ToString As String

Let ToString = Cstr(Value)

End Function

End Class

Class ResponseMessageItem_n9 As XSD_ANYTYPE

Public Message As XSD_STRING

Public MessageType As EnumMessageItemType_n10

Sub NEW

End Sub

End Class

Class UploadProjectResponse_n9 As XSD_ANYTYPE

Public UploadProjectResult As UploadResponse_n9

Sub NEW

End Sub

End Class

Class ArrayOfResponseMessageItem_n9 As XSD_ANYTYPE

Public ResponseMessageItem() As ResponseMessageItem_n9

Sub NEW

End Sub

End Class

Subject: Webservice consumer importing help.

Hello

Greetings!!

When I try to import the .wsdl file from SAP in LN 8.5, it shows 14 error(s) found, but no details available. Where can I trace out the error and how can I import it. The wsdl file opens without any error in browser and in Soap client.

Thanks in advance,

Sundar.

Subject: Solution found

http://www-01.ibm.com/support/docview.wss?uid=swg21391332

A WSDL fails to import successfully into script library

…Technote (troubleshooting)

ProblemYou are importing a WSDL into a LotusScript or Java library in order to consume a web service, but you receive an error. Depending on the type of library, you will receive either of the following two errors:

  1. The requested operation failed: genDigestsLS failed to obtain serviceObj

  2. The requested operation failed

SymptomFor example, when importing a WSDL into a LotusScript library, you receive the following error and cannot save the library after the import:

The requested operation failed: genDigestsLS failed to obtain serviceObj

When importing into a Java library, you get the error:

The requested operation failed

You can then successfully recompile the library, but get the same error when attempting to save.

Resolving the problemThe WSDL importer is working as designed. In one case the WSDL porttype element defined only a “one-way” operation, which is not supported by Domino Web service providers or consumers. Specifically, the operation “si_logo_mats_order_to_sap” had a child element, but no child element.

While this example relates to an SAP WSDL, other WSDLs with “one-way” operations would fail in a similar manner.

Below is a snippet of the original code and a workaround version that includes the missing semantics and does successfully import.

Original:

<wsdl:operation name=“si_logo_mats_order_to_sap”>

<soap:operation soapAction=“loading... | SAP Help Portal” xmlns:soap=“http://schemas.xmlsoap.org/wsdl/soap/” />

wsdl:input

<soap:body use=“literal” xmlns:soap=“http://schemas.xmlsoap.org/wsdl/soap/” />

</wsdl:input>

</wsdl:operation>

Workaround:

<wsdl:operation name=“si_logo_mats_order_to_sap”>

<soap:operation soapAction=“loading... | SAP Help Portal” xmlns:soap=“http://schemas.xmlsoap.org/wsdl/soap/” />

wsdl:input

<soap:body use=“literal” xmlns:soap=“http://schemas.xmlsoap.org/wsdl/soap/” />

</wsdl:input>

wsdl:output

<soap:body use=“literal” xmlns:soap=“http://schemas.xmlsoap.org/wsdl/soap/” />

</wsdl:output>

</wsdl:operation>