Repository.XFRACAS.SerializeXMLObjectToByteArray: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
m (Protected "Repository.SerializeXMLObjectToByteArray" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) [cascading])
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:APIClass|Repository Class|Repository}}
An helper function to serialize XMLs for import into XFRACAS through a byte array
An helper function to serialize XMLs for import into XFRACAS through a byte array
== Method Syntax ==
{{APIName|'''SerializeXMLObjectToByteArray'''(}}
{{APIPrefix|ByRef}}
{{APIName|pData() }}
{{APIPrefix|As Byte}}
{{APIName|,}}
{{APIPrefix|ByRef}}
{{APIName|pObject }}
{{APIPrefix|As Object}}
{{APIName|)}}
{{APIPrefix|As Integer}}<br>
{{APIComment|Uploads an import file for processing and returns the system ID of the uploaded}}


== Parameters ==
== Syntax ==
'''pData'''
*SerializeXMLObjectToByteArray( pData() {{APIPrefix|As Byte}}, pObject {{APIPrefix|As Object}}) {{APIPrefix|As Integer}}
{{APIComment|A defined byte array to return the }}


'''pObject'''
Parameters
{{APIComment|An serializable XML object.}}
:''pData'': A defined byte array to return the
 
:''pObject'': A serializable XML object.


== Usage Example ==
== Usage Example ==

Revision as of 20:44, 27 February 2014


An helper function to serialize XMLs for import into XFRACAS through a byte array

Syntax

  • SerializeXMLObjectToByteArray( pData() As Byte, pObject As Object) As Integer

Parameters

pData: A defined byte array to return the
pObject: A serializable XML object.

Usage Example

' Declare a new repository connection class. 
Private WithEvents MyRepository As New Repository
' Connect to the desired Synthesis repository. 
Dim Success As Boolean = False
Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
' Define an serializable XML Object. 
Dim xmlObject As Object=Nothing
 'populate the xmlObject with values to import 
' Define the byte array. 
Dim byteArray As Byte()=Nothing
' Serialize the xmlObject into the byteArray. 
Dim SerializeSuccess As Boolean
SerializeSuccess = MyRepository.SerializeXMLObjectToByteArray(byteArray, xmlObject)

Reformatted Usage Example

Declare a new repository connection class.

       Private WithEvents MyRepository As New Repository

Connect to the desired Synthesis repository.

       Dim Success As Boolean = False
       Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")

Define an serializable XML Object.

       Dim xmlObject As Object = Nothing
       'populate the xmlObject with values to import

Define the byte array.

       Dim byteArray As Byte() = Nothing

Serialize the xmlObject into the byteArray.

       Dim SerializeSuccess As Boolean
       SerializeSuccess = MyRepository.SerializeXMLObjectToByteArray(byteArray, xmlObject)