一般来讲,主要通过两个途径:
1)用FileNet Provided DLL or COM :
FileNet.Api.DLL or JGuil Brdige
2) 用Web Service, 需要WSE2.0移植到WSE3.0
以下两个web service是PE 和CE。
http://host:port/wsi/FNCEWS35SOAP/
http://host:port/wsi/ProcessEngineWS
主要介绍CE web service调用:
1) 可能需要测试一下web service在运行中,可以
http://host:port/wsi/FNCEWS35SOAP/WSDL,注意区分大小
2) 可以自定义一个Provider DP,比如:
<FileNetConfigation>
<User name="test" password="test" isneedencrypt="false" />
<ObjectStore name="test" tolfolder="/test" tempfolder="/Temp" />
<FileNet contentengineurl="http://host:port/wsi/FNCEWS35SOAP/" processengineurl="http://host:port/wsi/ProcessEngineWS" />
<MAX maxrow="100" maxsize="5242880" />
<DownLoad path="C:\\Temp\\" />
</FileNetConfigation>
<microsoft.web.services3>
<diagnostics>
<trace enabled="true" input="InputTrace.webinfo" output="OutputTrace.webinfo" />
<detailedErrors enabled="true" />
</diagnostics>
<policy fileName="wse3policyCache.config" />
</microsoft.web.services3>
![]()
wse3policy
<policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">
<extensions>
<extension name="usernameOverTransportSecurity" type="Microsoft.Web.Services3.Design.UsernameOverTransportAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="requireActionHeader" type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="kerberosSecurity" type="Microsoft.Web.Services3.Design.KerberosAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</extensions>
<policy name="FNETP8">
<usernameOverTransportSecurity />
<requireActionHeader />
</policy>
</policies>
3) 自定义一个Policy (For PE): The codesnip is the following:
![]()
PEPolicy
1
using System;
2
using System.Collections.Generic;
3
using System.Xml;
4
using System.Xml.Schema;
5
using Microsoft.Web.Services3;
6
using Microsoft.Web.Services3.Design;
7![]()
8
namespace FileNet
9![]()
![]()
{
10
public class PEHeaderAssertion : PolicyAssertion
11![]()
{
12![]()
13![]()
public PEHeaderAssertion()
{ }
14![]()
15
public override Microsoft.Web.Services3.SoapFilter CreateClientInputFilter(FilterCreationContext context)
16![]()
{
17
return null;
18
}
19![]()
20
public override Microsoft.Web.Services3.SoapFilter CreateClientOutputFilter(FilterCreationContext context)
21![]()
{
22
return new PEHeaderFilter();
23
}
24![]()
25
public override Microsoft.Web.Services3.SoapFilter CreateServiceInputFilter(FilterCreationContext context)
26![]()
{
27
return null;
28
}
29![]()
30
public override Microsoft.Web.Services3.SoapFilter CreateServiceOutputFilter(FilterCreationContext context)
31![]()
{
32
return null;
33
}
34![]()
35
public override void ReadXml(System.Xml.XmlReader reader, IDictionary<string, Type> extensions)
36![]()
{
37
if (reader == null)
38
throw new ArgumentNullException("reader");
39
if (extensions == null)
40
throw new ArgumentNullException("extensions");
41![]()
42
bool isEmpty = reader.IsEmptyElement;
43
reader.ReadStartElement("PEHeaderAssertion");
44
if (!isEmpty)
45![]()
{
46
reader.ReadEndElement();
47
}
48![]()
49
}
50
}
51![]()
52
public class PEHeaderFilter : SoapFilter
53![]()
{
54
public PEHeaderFilter()
55![]()
{
56
57
}
58![]()
59
public override SoapFilterResult ProcessMessage(SoapEnvelope envelope)
60![]()
{
61
if (envelope == null) throw new ArgumentNullException("envelope");
62
string router = (string)envelope.Context["router"];
63
if (router!=null)
64![]()
{
65
XmlElement soapHeader = envelope.CreateHeader();
66
XmlElement routerHeader = envelope.CreateElement("Router", "http://www.filenet.com/ns/fnpe/2004/06/ws/schema");
67
routerHeader.InnerText =router;
68
soapHeader.AppendChild(routerHeader);
69
}
70
return SoapFilterResult.Continue;
71
}
72![]()
73
}
74![]()
75
}
4) 创建一个Wrapped Web Service Object:
![]()
WrapWS
using System;
using System.IO;
using System.Web;
using System.Collections.Generic;
![]()
using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Security.Tokens;
using Microsoft.Web.Services3.Mime;
![]()
![]()
![]()
/**//// <summary>
/// Content Engine Web Services provide to create document,
/// create folder, delete document,check out document, check in document
/// and search documents.
/// </summary>
internal class FileNetCEWSHelper : FileNetBase
![]()
{
![]()
"Declared variants"#region "Declared variants"
![]()
/**//// <summary>
/// The filenet content enginer web service.
/// </summary>
private FNCEWS35ServiceWse _wseService = new FNCEWS35ServiceWse();
![]()
![]()
![]()
![]()
"Upload Docuemnt to FileNet Server"#region "Upload Docuemnt to FileNet Server"
public string AddDocument(CEContentData contenData, string documentTitle, string folderPath)
![]()
{
return this.AddDocument(contenData, string.Empty,documentTitle, folderPath);
}
![]()
![]()
#endregion "Upload Docuemnt to FileNet Server"
![]()
![]()
"Move the document to the specified folder path"#region "Move the document to the specified folder path"
public void MoveDocumentByID(string documentID, string documentTitle, string folderPath)
![]()
{
this.MoveDocument(documentID, documentTitle, folderPath);
}
#endregion
![]()
![]()
"Download the docuemnt from FileNet Server"#region "Download the docuemnt from FileNet Server"
public CEContentData DownloadDocumentByID(string docuemntID)
![]()
{
return DownloadDocument(true, docuemntID);
}
![]()
#endregion "Download the docuemnt from FileNet Server"
![]()
![]()
"Retrieve the document by ID or title"#region "Retrieve the document by ID or title"
public FileNetDocumentDataSet GetDocumentByID(string documentID)
![]()
{
return ExcuteRepositorySearch(this.GetSearchSQLByID(documentID));
}
![]()
#endregion
![]()
}