Get DocumentObject from DocId or ContainerId

This commit is contained in:
Jonathan Jenne
2019-03-05 12:16:16 +01:00
parent bbd761c0ad
commit ec616ac9b8
14 changed files with 323 additions and 38 deletions

View File

@@ -1,3 +1,22 @@
Public Class Channel
Imports System.ServiceModel
Public Class Channel
Public Shared Function GetBinding() As NetTcpBinding
Return New NetTcpBinding() With {
.MaxReceivedMessageSize = Constants.MAX_RECEIVED_MESSAGE_SIZE,
.MaxBufferSize = Constants.MAX_BUFFER_SIZE,
.MaxBufferPoolSize = Constants.MAX_BUFFER_POOL_SIZE,
.MaxConnections = Constants.MAX_CONNECTIONS,
.Security = New NetTcpSecurity() With {
.Mode = SecurityMode.Transport,
.Transport = New TcpTransportSecurity() With {
.ClientCredentialType = TcpClientCredentialType.Windows
}
},
.ReaderQuotas = New Xml.XmlDictionaryReaderQuotas() With {
.MaxArrayLength = Constants.MAX_ARRAY_LENGTH,
.MaxStringContentLength = Constants.MAX_STRING_CONTENT_LENGTH
}
}
End Function
End Class

View File

@@ -70,6 +70,18 @@
<wsdl:message name="IEDMService_DeleteFile_OutputMessage">
<wsdl:part name="parameters" element="tns:DeleteFileResponse" />
</wsdl:message>
<wsdl:message name="IEDMService_GetDocumentByDocumentId_InputMessage">
<wsdl:part name="parameters" element="tns:GetDocumentByDocumentId" />
</wsdl:message>
<wsdl:message name="IEDMService_GetDocumentByDocumentId_OutputMessage">
<wsdl:part name="parameters" element="tns:GetDocumentByDocumentIdResponse" />
</wsdl:message>
<wsdl:message name="IEDMService_GetDocumentByContainerId_InputMessage">
<wsdl:part name="parameters" element="tns:GetDocumentByContainerId" />
</wsdl:message>
<wsdl:message name="IEDMService_GetDocumentByContainerId_OutputMessage">
<wsdl:part name="parameters" element="tns:GetDocumentByContainerIdResponse" />
</wsdl:message>
<wsdl:message name="IEDMService_NewFileIndex_InputMessage">
<wsdl:part name="parameters" element="tns:NewFileIndex" />
</wsdl:message>
@@ -117,6 +129,14 @@
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/DeleteFile" message="tns:IEDMService_DeleteFile_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/DeleteFileResponse" message="tns:IEDMService_DeleteFile_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="GetDocumentByDocumentId">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByDocumentId" message="tns:IEDMService_GetDocumentByDocumentId_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByDocumentIdResponse" message="tns:IEDMService_GetDocumentByDocumentId_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="GetDocumentByContainerId">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByContainerId" message="tns:IEDMService_GetDocumentByContainerId_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByContainerIdResponse" message="tns:IEDMService_GetDocumentByContainerId_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="NewFileIndex">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/NewFileIndex" message="tns:IEDMService_NewFileIndex_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/NewFileIndexResponse" message="tns:IEDMService_NewFileIndex_OutputMessage" />

View File

@@ -139,10 +139,38 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetDocumentByDocumentId">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="DocumentId" type="xs:long" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetDocumentByDocumentIdResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q10="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" minOccurs="0" name="GetDocumentByDocumentIdResult" nillable="true" type="q10:DocumentResult" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetDocumentByContainerId">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ContainerId" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetDocumentByContainerIdResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q11="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" minOccurs="0" name="GetDocumentByContainerIdResult" nillable="true" type="q11:DocumentResult" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NewFileIndex">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q10="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" minOccurs="0" name="DocObject" nillable="true" type="q10:DocumentObject" />
<xs:element xmlns:q12="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" minOccurs="0" name="DocObject" nillable="true" type="q12:DocumentObject" />
<xs:element minOccurs="0" name="Syskey" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="LanguageCode" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Value" nillable="true" type="xs:string" />
@@ -152,7 +180,7 @@
<xs:element name="NewFileIndexResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q11="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" minOccurs="0" name="NewFileIndexResult" nillable="true" type="q11:IndexResult" />
<xs:element xmlns:q13="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" minOccurs="0" name="NewFileIndexResult" nillable="true" type="q13:IndexResult" />
</xs:sequence>
</xs:complexType>
</xs:element>

View File

@@ -363,6 +363,22 @@ Namespace EDMIServiceReference
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/DeleteFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/DeleteFileResponse")> _
Function DeleteFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of Boolean)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByDocumentId", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByDocumentIdRespons"& _
"e")> _
Function GetDocumentByDocumentId(ByVal DocumentId As Long) As EDMIServiceReference.DocumentResult
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByDocumentId", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByDocumentIdRespons"& _
"e")> _
Function GetDocumentByDocumentIdAsync(ByVal DocumentId As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByContainerId", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByContainerIdRespon"& _
"se")> _
Function GetDocumentByContainerId(ByVal ContainerId As String) As EDMIServiceReference.DocumentResult
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByContainerId", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByContainerIdRespon"& _
"se")> _
Function GetDocumentByContainerIdAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/NewFileIndex", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/NewFileIndexResponse")> _
Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult
@@ -481,6 +497,22 @@ Namespace EDMIServiceReference
Return MyBase.Channel.DeleteFileAsync(DocObject)
End Function
Public Function GetDocumentByDocumentId(ByVal DocumentId As Long) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMService.GetDocumentByDocumentId
Return MyBase.Channel.GetDocumentByDocumentId(DocumentId)
End Function
Public Function GetDocumentByDocumentIdAsync(ByVal DocumentId As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMService.GetDocumentByDocumentIdAsync
Return MyBase.Channel.GetDocumentByDocumentIdAsync(DocumentId)
End Function
Public Function GetDocumentByContainerId(ByVal ContainerId As String) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMService.GetDocumentByContainerId
Return MyBase.Channel.GetDocumentByContainerId(ContainerId)
End Function
Public Function GetDocumentByContainerIdAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMService.GetDocumentByContainerIdAsync
Return MyBase.Channel.GetDocumentByContainerIdAsync(ContainerId)
End Function
Public Function NewFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal LanguageCode As String, ByVal Value As String) As EDMIServiceReference.IndexResult Implements EDMIServiceReference.IEDMService.NewFileIndex
Return MyBase.Channel.NewFileIndex(DocObject, Syskey, LanguageCode, Value)
End Function

View File

@@ -129,6 +129,24 @@
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetDocumentByDocumentId">
<soap12:operation soapAction="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByDocumentId" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetDocumentByContainerId">
<soap12:operation soapAction="http://DigitalData.Services.EDMService/IEDMService/GetDocumentByContainerId" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="NewFileIndex">
<soap12:operation soapAction="http://DigitalData.Services.EDMService/IEDMService/NewFileIndex" style="document" />
<wsdl:input>

View File

@@ -0,0 +1,8 @@
Public Class Constants
Public Const MAX_RECEIVED_MESSAGE_SIZE = 2147483647
Public Const MAX_BUFFER_SIZE = 2147483647
Public Const MAX_BUFFER_POOL_SIZE = 2147483647
Public Const MAX_CONNECTIONS = 10000
Public Const MAX_ARRAY_LENGTH = 2147483647
Public Const MAX_STRING_CONTENT_LENGTH = 2147483647
End Class

View File

@@ -8,22 +8,14 @@ Public Class Document
Private _logConfig As LogConfig
Private _channelFactory As ChannelFactory(Of IEDMServiceChannel)
Private _channel As IEDMServiceChannel
Public Sub New(LogConfig As LogConfig, EDMI_ServiceAdress As String)
Public Sub New(LogConfig As LogConfig, ServiceAdress As String)
_logger = LogConfig.GetLogger()
_logConfig = LogConfig
Try
Dim binding As New NetTcpBinding()
binding.Security.Mode = SecurityMode.Transport
binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows
binding.MaxReceivedMessageSize = 2147483647
binding.MaxBufferSize = 2147483647
binding.MaxBufferPoolSize = 2147483647
binding.MaxConnections = 10000
binding.ReaderQuotas.MaxArrayLength = 2147483647
binding.ReaderQuotas.MaxStringContentLength = 2147483647
Dim endpointAddress = New EndpointAddress(EDMI_ServiceAdress)
_channelFactory = New ChannelFactory(Of IEDMServiceChannel)(binding, endpointAddress)
Dim oBinding = Channel.GetBinding()
Dim oAddress = New EndpointAddress(ServiceAdress)
_channelFactory = New ChannelFactory(Of IEDMServiceChannel)(oBinding, oAddress)
Connect2NetService()
Catch ex As Exception
_logger.Error(ex)
@@ -110,6 +102,24 @@ Public Class Document
End Try
End Function
Public Function GetDocumentByDocumentId(DocumentId As Int64) As DocumentResult
Try
Return _channel.GetDocumentByDocumentId(DocumentId)
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResult
Try
Return _channel.GetDocumentByContainerId(ContainerId)
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
'Public Async Function New_EDMI_File(oFILENAME As String, oUserName As String) As Task(Of String)
' Try
' Dim oFileGUID As DocumentResult = Await CreateDocument(oFILENAME)

View File

@@ -78,6 +78,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
<Compile Include="Constants.vb" />
<Compile Include="Document.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">