RNIFReceiver Component
Properties Methods Events Configuration Settings Errors
The RNIFReceiver component implements a RosettaNet server.
Syntax
nsoftware.IPWorksEDI.Rnifreceiver
Remarks
The RNIFReceiver implements server-side receiving of RosettaNet messages, as specified by the RosettaNet community. It can be used to decrypt and verify incoming messages and to generate synchronous receipts and replies if needed. The component is designed to be easily incorporated into an HTTP server. RosettaNet is used in a variety of industries including Semiconductor Manufacturing, Electronic Components, Telecommunications, Logistics, the Chemical Industry (through CIDX), and more.
BASIC OPERATION
When a RosettaNet request comes in, you should first call the ReadRequest method to read in the request. Once this is done, you must parse the headers and the request. You first parse the headers of the HTTP request using the ParseHeaders method. You may then set the appropriate certificates by setting the Certificate to your private key certificate and SignerCert to your trading partner's (signing) certificate.
The next step is to parse the RosettaNet message using ParseRequest. This method decrypts the message if needed. The component then parses all parts of the message. The preamble, delivery, and service headers are all parsed into the PreambleHeaderXML, DeliveryHeaderXML, and the ServiceHeaderXML, respectively. It also parses the actual body of the RosettaNet message, or the PIP, into the ServiceContent. Any attachments that may be in the message are parsed into the attachment array, and may be accessed via the Attachments property.
The component can also be used to handle synchronous responses. In order to complete this task, the receiver must first reset all header properties to values appropriate for a response. This may include changing values such as the MessageSenderId, MessageReceiverId, ActionCode, etc. The ServiceContent should then be set to a response indicating the state of the transaction. A typical response is a simple receipt acknowledgement, which has all qualities of a valid RosettaNet action, but is simply a receipt. Once these properties have been set, the message is ready to be sent using the SendResponse method.
NOTE: the RNIFReceiver Component can only handle sending synchronous responses. If an asynchronous response is desired, or required by a particular Partner Interface Process (PIP), you should use the RNIFSender component.
The following example illustrates how to use the component within a web page.
EXAMPLE
RNIFReceiver.ReadRequest(); RNIFReceiver.Certificate = new Certificate(CertStoreTypes.cstPFXFile, // Store type "\my_server_directory\encrypt.pfx", // File name "my password", // Password "CN=Encrypt"); // Subject RNIFReceiver.SignerCert = new Certificate("\my_server_directory\partnercert.cer"); RNIFReceiver.ParseHeaders(); RNIFReceiver.ParseRequest();
The server can then get the data from the preamble header, delivery header, service header, and the PIP content from their properties: PreambleHeaderXML, DeliveryHeaderXML, ServiceHeaderXML<;, and the ServiceContent, respectively. The message may then be easily processed, as all details of the transaction will be populated into their respective properties.
NOTE: Any attachments are saved by the name in the corresponding Attachments entry, and in the directory specified by the receiver. The directory is specified using the AttachmentOutputPath config property, and must be specified before you read and process the request. For example:
RNIFReceiver.Config("AttachmentOutputPath='\my_server_directory\Attachments'")
NOTE: In the above example, a receipt acknowledgement was not sent.
Additional functionality allows the user to examine details of the client's request, to permit certain types of errors, or to customize the RosettaNet response message. See the property and method list for details.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
ActionCode | The code for this action. |
ActionMessage | Whether or not this message is an action message. |
ActionMessageStandardName | The name of the standard used to create this action. |
ActionMessageStandardVersion | The version of the standard used to create this action. |
Attachments | A collection of files attached to the current RNIF message. |
BusinessActivity | This property denotes the type of business activity. |
Certificate | The encryption certificate. |
DeliveryHeaderXML | The complete XML data from the Delivery Header. |
EncryptionAlgorithm | The algorithm used to encrypt the EDI data. |
EncryptionType | The encryption type for RNIF 2.0. |
FromRole | The business role of the entity that originated this message. |
FromService | The service that originated this message. |
GlobalUsageCode | A universal code describing basic usage for this message. |
MessageDateTime | The time at which this message was sent. |
MessageReceiverId | Identity of the entity receiving this message. |
MessageReceiverLocation | Location of the entity receiving this message. |
MessageSenderId | Identity of the entity that sent this message. |
MessageSenderLocation | Location of the entity that sent this message. |
MessageTrackingId | Unique value that identifies this message. |
OriginalActionCode | The action code of the original message. |
OriginalMessageStandardName | The name of the standard used to create the original message. |
OriginalMessageStandardVersion | The version of the standard used to create the original message. |
OriginalMessageTrackingId | Tracking identifier for the original message. |
PartnerId | Identity of the partner. |
PartnerKnown | Whether or not the partner is known. |
PartnerLocation | Location of the partner. |
PartnerPIPBindingId | The partner-defined PIP payload binding ID. |
PartnerURL | A URL to which replies must be sent if the partner is unknown. |
PIPCode | RosettaNet PIP code of this message. |
PIPInstanceId | The Id of this PIP instance. |
PIPVersion | RosettaNet PIP version of this message. |
PreambleHeaderXML | The complete XML data from the Preamble Header. |
QOSSpecifications | Specifies quality of service constraints for this message. |
RecipientCert | The encryption certificate of the recipient. |
ReplyMessage | Whether or not this message is a reply to another message. |
Request | The HTTP request to be processed. |
RequestHeaders | The HTTP headers in the RNIF request. |
RequestHeadersString | The HTTP headers in the RNIF request. |
ResponseType | Requested response type. Available only in RNIF 2.0. |
RNIFVersion | The RNIF Standard Version used to generate this message. |
SecureTransportRequired | Indicates that security is required when forwarding this message. |
ServiceContent | The PIP message data. |
ServiceHeaderXML | The complete XML data from the Service Header. |
SignalCode | The code for this signal. |
SignalMessage | Whether or not this message is a signal. |
SignalVersion | The version of this signal. |
SignerCert | Your trading partner's signing certificate. |
StandardName | The name of the standard used to create this message. |
StandardVersion | The version of the standard used to create this message. |
ToRole | The role of the entity receiving this message. |
ToService | The service for which this message is bound. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
ParseHeaders | Processes the headers, and populates the appropriate properties. |
ParseRequest | Parses the MIME message and determines the Message . |
ReadRequest | Reads the RNIF request from the given HTTP servlet request. |
RequestHeader | Gets the specified header from the HTTP request. |
Reset | This property is used to reset all attributes of the Rnifreceiver instance. |
SendResponse | Optional. Acknowledges the incoming request. |
SetRequestStream | Sets the stream from which the component will read the RNIF request. |
Event List
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
Error | Information about errors during data delivery. |
Configuration Settings
The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.
AttachmentOutputPath | Specifies a path on disk to which attachments will be saved. |
ExpectedVersion | The RNIF document version that the RNIFReceiver is expecting to receive. |
FromPartnerClassificationCode | Code identifying the sending partner's function in the supply chain. |
GlobalProcessCode | Business process identifier e.g. 'Manage Product Subscriptions'. This code is the name of a PIP specification document. |
HTTPStatusCode | The HTTP status code to send in the response. |
MessageDigest | The base-64 encoded hash of the received data. |
RequireEncryption | Whether encryption is required when processing received messages. |
RequireSignature | Whether a signature is required when processing received messages. |
SignatureAlgorithm | Signature algorithm to be used in outgoing messages. |
ToPartnerClassificationCode | Code identifying the receiving partner's function in the supply chain. |
TransactionCode | Service transaction dialog. The code is the name of the business activity and the transaction dialog in the PIP specification document. |
TransactionId | A unique alpha-numeric identifier that represents a specific instance of an business process, business transaction, business action or business signal. The instance identifier must be unique for a particular instance of a business process, business transaction, business action and business signal. |
TransferredData | The full body of the incoming request. |
TransferredHeaders | The HTTP headers of the incoming request. |
BuildInfo | Information about the product's build. |
GUIAvailable | Tells the component whether or not a message loop is available for processing events. |
LicenseInfo | Information about the current license. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |