ContractImportDraftVersion command (Business Edition)

This command imports a contract in XML format into WebSphere Commerce. The contract is imported in the "draft" state.

Command structure

https://host_name/path/
The fully qualified name of your WebSphere Commerce Server and the configuration path.

Diagram of the command structure: the command starts with the fully qualified name of your WebSphere Commerce Server and the configuration path, followed by the command name, ContractImportDraftVersion  and the ? character. End the command with a list of parameters in the form of name value pairs. Separate each name value pair with the & character. For a detailed description of the parameters and their values, refer to the list entitled Parameter values.

Before issuing this command, you must be logged into WebSphere Commerce. You can log in to WebSphere Commerce using the Logon command.

Parameter values

fileName
(Required) The name of the XML file that you want to import as a contract. The XML file must be validated with the B2BTrading DTD.

The XML file being imported must exist in the location specified in the WebSphere Commerce configuration file (instance_name.xml), and the file must be validated with the B2BTrading DTD or Package.xsd

The configuration file is in the following locations:

WC_installdir/instances/instance_name/xml/ instance_name.xml
where instance_name is name of your WebSphere Commerce instance.

The location for the contract XML file to be imported is specified in the XMLPath attribute of the Trading tag in the WebSphere Commerce configuration file. For example, if the WebSphere Commerce configuration file contains the following:

<DTDPath="D:/WebSphere/CommerceServer55/xml/trading/dtd"
XMLPath="D:/WebSphere/CommerceServer55/xml/trading/xml"
XSDPath="D:/WebSphere/CommerceServer55/xml/trading/xsd" />

The contract XML file to be imported using this command must be in D:/WebSphere/CommerceServer55/xml/trading/xml.

xsd
(Required) Specifies whether the contract XML is DTD- or XSD-based. Valid values for this parameter are true and false. Use true when the contract is XSD-based. Use false when the contract is DTD-based.

If this parameter is not specified, a value of false is assumed.

validate
Specifies whether the contract XML should be validated by the XML parser. Valid values for this parameter are true and false. Use true to have the contract validated. Use false to prevent the contract from being validated by the XML parser.

If this parameter is not specified, a value of true is assumed.

URL
(Required) The URL to be called when the command completes successfully.

Example

The following example imports a contract into the draft state:

https://myhostname/webapp/wcs/stores/servlet/
ContractImportDraftVersion?fileName=mydraftcontract.xml&xsd=true
&URL=ContractDisplay

Behavior

This command imports a draft contract into the WebSphere Commerce database from an XML file.

Exception conditions

The following exceptions may be thrown by this command: