Repository.XFRACAS.SerializeXMLObjectToByteArray: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|10|.[[Repository Class|Repository]]}}
{{DISPLAYTITLE:Repository.XFRACAS.SerializeXMLObjectToByteArray Method}}{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}




<onlyinclude>Serializes an XML file for import into XFRACAS. Returns a '''Boolean''' value; when true, indicates a successful import.</onlyinclude>
<onlyinclude>Serializes the XML file for import into XFRACAS. Returns a '''Boolean''' value; when true, indicates a successful serialization.</onlyinclude>


== Syntax ==
== Syntax ==
  '''XFRACAS.SerializeXMLObjectToByteArray( pData() {{APIPrefix|As Byte}}, pObject {{APIPrefix|As Object}}) {{APIPrefix|As Integer}}'''
  '''.XFRACAS.SerializeXMLObjectToByteArray'''(''pData()'', ''pObject'')


===Parameters===
===Parameters===


''pData'
''pData''


:Required. Byte.  
:Required. Byte. A defined byte array.


''pObject''
''pObject''
Line 22: Line 22:
  '''VB.NET'''
  '''VB.NET'''
   
   
  {{APIComment|'Add code to connect to the Synthesis repository.}}
  {{APIComment|'Connect to a Synthesis enterprise repository.}}
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...}}
  MyRepository.ConnectToSQLRepository({{APIString|"MyServer"}}, {{APIString|"MyDatabase"}})
   
   
  {{APIComment|'Define a serializable XML object and populate with values to import.}}
  {{APIComment|'Define a serializable XML object and populate with values to import.}}
Line 37: Line 37:
  {{APIComment|'Import the XML byte array into XFRACAS entity ID# 10.}}
  {{APIComment|'Import the XML byte array into XFRACAS entity ID# 10.}}
   {{APIPrefix|Dim}} ImportXMLSystemID {{APIPrefix|As Integer}}
   {{APIPrefix|Dim}} ImportXMLSystemID {{APIPrefix|As Integer}}
   ImportXMLSystemID = MyRepository.XFRACAS.ImportXFRACASXML(10, XFRACASImportType.Incident, byteArray, {{APIString|"XMLFileTitle"}}, {{APIString|"XMLFileDescription"}})
   ImportXMLSystemID = MyRepository.XFRACAS.ImportXfracasXml(10, XFRACASImportType.Incident, byteArray, {{APIString|"XMLFileTitle"}}, {{APIString|"XMLFileDescription"}})
   
   
  {{APIComment|'Process the imported file.}}
  {{APIComment|'Process the imported file.}}
   MyRepository.XFRACAS.ProcessXfracasImports()
   MyRepository.XFRACAS.ProcessXfracasImports()

Latest revision as of 16:44, 10 March 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Serializes the XML file for import into XFRACAS. Returns a Boolean value; when true, indicates a successful serialization.

Syntax

.XFRACAS.SerializeXMLObjectToByteArray(pData(), pObject)

Parameters

pData

Required. Byte. A defined byte array.

pObject

Required. A serializable XML object.

Example

VB.NET

 'Connect to a Synthesis enterprise repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToSQLRepository("MyServer", "MyDatabase")

 'Define a serializable XML object and populate with values to import. 
  Dim xmlObject As Object = Nothing
  ... 
  
 'Define the byte array and then serialize the object to the byte array. 
  Dim byteArray As Byte() = Nothing
  Dim SerializeSuccess As Boolean
  SerializeSuccess = MyRepository.XFRACAS.SerializeXMLObjectToByteArray(byteArray, xmlObject)

 'Import the XML byte array into XFRACAS entity ID# 10. 
  Dim ImportXMLSystemID As Integer
  ImportXMLSystemID = MyRepository.XFRACAS.ImportXfracasXml(10, XFRACASImportType.Incident, byteArray, "XMLFileTitle", "XMLFileDescription")

 'Process the imported file. 
  MyRepository.XFRACAS.ProcessXfracasImports()