Доброго дня.
Подтолкните куда смотреть.
Есть доминошный веб сервис, надо с ним "пообщатся", MSSOAP - отваливается т.к. не работает на win server 2008.
Идеальная схема через LS агент.
может подойдет, посмотрите этот вариант через бридж -Ссылка скрыта от гостей
'Declare global variables accessible from all parts of this Web service.
Dim session As NotesSession
Dim nabdb As NotesDatabase
Dim nabdoc As NotesDocument
Dim nabview As NotesView
Dim item As NotesItem
'Create a LotusScript class.
Class GetPersonInfo
'Sub New can be used to assign values to global
'variables. Here we can set our session object.
Sub New
Set session = New NotesSession
End Sub
'GetPhoneNumber accepts name of a person as function argument.
'We set output type to data type String.
Public Function GetPhoneNumber(personname As String) As String
' If person's document is not already found in previous actions, find it now
If nabdoc Is Nothing Then
'Locate a document using our search function
result=GetPersonDocument(personname)
End If
If result<>"OK" Then
'If no person document is found, return the error message
'we got from the GetPersonDocument function
GetPhoneNumber="ERROR: "+result
Exit Function
Else
'If person document is found, return content of OfficePhoneNumber field
'We use our GetPersonField reusable function for getting field’s content
GetPhoneNumber=GetPersonField("OfficePhoneNumber")
End If
End Function
Public Function GetEmailAddress(personname As String) As String
If nabdoc Is Nothing Then
' If person's document is not already found in previous actions, find it now
result=GetPersonDocument(personname)
End If
If result<>"OK" Then
'If no person document is found, return the error message
'we got from the GetPersonDocument function
GetEmailAddress="ERROR: "+result
Exit Function
Else
'If person document is found, return content of MailAddress field
'We use our reusable function for getting field’s content
GetEmailAddress=GetPersonField("MailAddress")
End If
End Function
End Class
Private Function GetPersonDocument(personname As String) As String
Set nabdb=session.CurrentDatabase
'Set nabdb=New NotesDatabase("","names.nsf")
' Check that database exists and was opened
If Not (nabdb.IsOpen) Then
GetPersonDocument= "Error opening database"
Exit Function
End If
Set nabview = nabdb.GetView("($Users)")
'Check that view exists in the database
If nabview Is Nothing Then
GetPersonDocument = "Error opening view"
Exit Function
End If
'Get a document by search key
Set nabdoc = nabview.GetDocumentByKey(personname, True)
If nabdoc Is Nothing Then
GetPersonDocument = "Cannot find person"
Exit Function
End If
' global nabdoc object was set correctly and we can return OK
GetPersonDocument="OK"
End Function
Private Function GetPersonField(FieldName As String)
'Get item object. Global object nabdoc was set earlier in GetPersonDocument function.
Set item=nabdoc.GetFirstItem(FieldName)
'Sometimes item does not exist in the document, it’s not an error so we return an empty string.
If item Is Nothing Then
GetPersonField=""
Exit Function
Else
'Return first value of the item
GetPersonField=Cstr(item.Values(0))
End If
End Function
Set Client =CreateObject("MSSOAP.SoapClient30")
Call Client.mssoapinit ("http://сервак/база/SimpleLSServiceNAB?wsdl")
result = Client.GetPhoneNumber(personname)
так же и в бридже - см. в конце кодаПо SOAP все просто, вызываем через него функции веб-сервиса, получаем данные.
Set Client =CreateObject("MSSOAP.SoapClient30")
Call Client.mssoapinit ("http://сервак/база/SimpleLSServiceNAB?wsdl")
result = Client.GetPhoneNumber(personname)
'** everything we'll need to access our Java classes
Dim jSession As New JavaSession
Dim jClass As JavaClass
Dim jObject As JavaObject
'** get the IGWebservice class and instantiate an instance of it
Set jClass = jSession.GetClass("ECWebservice")
'** version of CreateObject and init with path to WSDL)
Set jObject = jClass.CreateObject("(Ljava/lang/String;)V", connection)
jObject.SetContentType(contentType)
'** send message and get result: true/false, if true then we got result
If jObject.send(xmldata) Then
me.responce = jObject.GetResponce()
%INCLUDE "lsxsd.lss"
Class GetPersonInfo
Sub NEW
End Sub
Function GETPHONENUMBER(PERSONNAME As String) As String
End Function
Function GETEMAILADDRESS(PERSONNAME As String) As String
End Function
End Class
8.0.2
я правильно понимаю что нужно:
1. Создаем веб-сервис. Пример выше "SimpleLSServiceNAB".
2. Сохраняем его как SimpleLSServiceNAB.wsdl
3. Создаем еще 1 веб-сервис (SimpleLSServiceNAB_NEW), импортим в него wsdl, получаем такой код:
4. Теперь подключаем его как библиотеку?Код:%INCLUDE "lsxsd.lss" Class GetPersonInfo Sub NEW End Sub Function GETPHONENUMBER(PERSONNAME As String) As String End Function Function GETEMAILADDRESS(PERSONNAME As String) As String End Function End Class
Use "SimpleLSServiceNAB_NEW"
Sub Initialize
Dim PersonInfo As New GetPersonInfo
Print PersonInfo.GETEMAILADDRESS("James Bond")
End Sub
4746-Web Service GetPersonInfo method GETEMAILADDRESS error org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages
Обучение наступательной кибербезопасности в игровой форме. Начать игру!