Lotus domino 8.5 WebService 一 (使用SoapToolkit3.0消费WebService)

开发工具:

MyEclipse 8

Lotus Domino 8.5

SoapToolkit3.0

平台:

Windows

XFire1.2 (WebService)

 

1. 新建web工程

2. 用MyEclipse自动导入XFire包

3. 创建测试类

接口:IUserInfo.java

实现类:UserInfoImpl.java

4.代码:

 

-------------------------------

IUserInfo.java:

 

public interface IUserInfo {
 
 public String example(String message);
 
}

 

-------------------------------

UserInfoImpl.java:

 

public class UserInfoImpl implements IUserInfo {
 
 public String example(String message) {
  message = "hello "+message;
  System.out.println(message);
  return message;
 }
 
}

 

5. 让MyEclipse自动创建WebService Client

生成后类如图:

6. 测试WebService服务http://localhost:8080/XFireDemo91/services/UserInfo?wsdl,并另存为UserInfo.wsdl文件以备用。

7. domino中新建代理agtDemo:

Sub Initialize
 On Error Goto errshanle
 
 
 Dim s As New NotesSession
 Dim doc As NotesDocument
 Set doc = s.DocumentContext
 
 Dim client As Variant
 
 Set Client =CreateObject("MSSOAP.SoapClient30")
 Call Client.mssoapinit ("http://localhost:8080/XFireDemo91/services/UserInfo?wsdl")
 
 Dim result As String
 If Not Client Is Nothing Then
  result = Client.example("Saliner")  
 Else
  result="no web"
 End If
 Print result
 Exit Sub
errshanle:
 Print "agtDemo Error " & Error$ " in Line " & Cstr(Erl)
End Sub

8. 安装SoapToolkit3.0

9. 执行此代理,输出hello Saliner成功!

 

 

 

你可能感兴趣的:(Lotus,Domino)