internal:proship:velocity:ils-event

This is an old revision of the document!


Velocity PSS function to send request to ILS:

Sub Ils_RunEvent(IlsEvent)
	Dim IlsRq
	Dim IlsEvXPath
	
	Select Case IlsEvent
		Case "StartClient"
			Set IlsRq = Sys
			IlsEvXPath = "/SYSTEM/ILS"
		Case Else
			Set IlsRq = Shipment
			IlsEvXPath = "/SHIPMENT/ILS"
	End Select

	IlsRq.DeleteElement IlsEvXPath
	IlsRq.E(IlsEvXPath & "/EVENT") = IlsEvent
	
	DMsgBox "Request" & vbLF & IlsRq.Xml
	Dim ilsRsTxt 
	ilsRsTxt = TcpSend(Machine.ServerName, 3298, IlsRq.Xml & Chr(3), 30)
	If Right(ilsRsTxt, 1) = Chr(3) Then
		ilsRsTxt = Left(ilsRsTxt, Len(ilsRsTxt) - 1)
	End If

	DMsgBox "Response" & vbLF & ilsRsTxt
	Dim IlsRs
	Set IlsRs = CreateProcReq()
	IlsRs.Xml = ilsRsTxt
	'Debug_XML IlsRs.xml
	
	DMsgBox IlsRs.E(IlsEvXPath & "/STATUS")
	If (CInt("0" & IlsRs.E(IlsEvXPath & "/STATUS")) > 0) Then
		IlsRs.DeleteElement IlsEvXPath
		Select Case IlsEvent
			Case "StartClient"
				'Sys.Xml = IlsRs.Xml
			Case Else
				Shipment.Xml = IlsRs.Xml
		End Select
	End If
End Sub

Call the function like this within Velocity events:

Sub LoadShipment()
	Ils_RunEvent "LoadShipment"
End Sub

Function PreShipShipment()
	Ils_RunEvent "PRESHIP"
End Function

Function PostShipShipment()
	Ils_RunEvent "POSTSHIP"
End Function

ILS code (PreProcessRequestXML) should look for the /SHIPMENT/ILS/EVENT node, and run the appropriate function. Once handled, ILS should set /SHIPMENT/ILS/STATUS = 1 (or greater than 0). The Ils_RunEvent function only loads the xml when STATUS > 0.

  • internal/proship/velocity/ils-event.1784036981.txt.gz
  • Last modified: 2026/07/14 09:49
  • by lseadmin