前言
在一个Java项目中, 需要调用发送OCS及时通知的功能。而UCMA是C相关的技术。
实现方式: Java调用UCMA的WebService.
环境准备与要求
IIS 服务器端:
1. Window serves 2008 64 位
2. IIS 7
3. 需要安装.net 4.5 及以上, 因为UcmaSdkSetup4.exe 的需要
下载地址: https://www.microsoft.com/en-US/download/confirmation.aspx?id=30653
4. UCMA4 安装包 UcmaSdkSetup4.exe
本地开发端:
1. Visual Studio 2013
2. 需要安装.net 4.5 及以上, 因为UcmaSdkSetup4.exe 的需要
3. UCMA4 安装包 UcmaSdkSetup4.exe
需要安装.net 4.5 及以上, 因为UcmaSdkSetup4.exe 的需要
Windows Power Shell 3.0
说明 : https://technet.microsoft.com/zh-cn/library/dn362783.aspx
下载地址: https://www.microsoft.com/en-us/download/details.aspx?id=34595
windows 2008 Desktop Experience
安装说明: https://technet.microsoft.com/en-us/library/cc754314.aspx
本地开发与测试
1. 在Visual 新建Web工程
File --> New --> Project ...
2.选择Visual C# 下的Web , ASP.NET Empty Web Application, 命个名, 点击 OK
3. 默认只有一个Web.config,
4. 工程上按右键, 点击Add --> New Item..:
5. 选择Web Service, 文件名修改为message.asmx
6. 接下来就是编写代码了。
主要是三个代码文件
message.asmx.cs webservice 的类
OCSCall.cs OCS的方法
OCSHelper.cs OCS的子方法
右键Reference--> Add Reference
8. 选择 UCMA 的dll 的地址, 名字为Microsoft.Rtc.Collaboration.dll
9. [重要], 点击测试
测试之前, 一定要做如下动作
TOOLS -->Projects and Solution-->Web Projects --> 勾选 Use the 64 bit version of ....
如果不做的话, 会出现错误
出现以下错误:
An exception of type 'System.IO.FileNotFoundException' occurred in ocsnew.dll but was not handled in user code
Additional information: Could not load file or assembly 'SIPEPS, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified
10. 至此, 本地测试的OCS Webservice信息就可以发送了