WebSphere Commerce Enterprise

ContractImportDraftVersion URL

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

URL structure

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

Before issuing This URL, 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, and the file must be validated with the B2BTrading DTD or Package.xsd

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 section:


<Trading
DTDFileName="B2BTrading.dtd"
DTDPath="/trading/dtd"
XMLPath="/trading/xml"
XSDPath="/trading/xsd" />

The contract XML file to be imported using This URL must be in WC_eardir/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=StoreCatalogDisplay?storeId=512&catalogId=512

Behavior

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

Exception conditions

The following exceptions may be thrown by This URL:

  • _ERR_ACCOUNT_DOES_NOT_EXIST will be thrown if cannot find the account based on the accountName and accountOwnerId.
  • _ERR_COLUMN_ACCESSBEANNAME_IN_PATTRIBUTE_NOT_POPULATED will be thrown if in the OrderTCOrderItemPAttribute or PaymentTC, the attribute specified in XML file does not have column accessbeanname pre-populated in the PATTRPROD database table.
  • _ERR_CONTRACT_REFERENCE_NUMBER_NOT_REQUIRED will be thrown if referenceNumber attribute is provided in the XML file.
  • _ERR_DUPLICATED_CONTRACT_NAME will be thrown if there are other contracts having the same contract name.
  • _ERR_DUPLICATE_KEY_IN_PROCESSING_TC will be thrown if while trying to create a entry in TERMCOND table and its associated table the unique index of the new entry is the same of an existing entry.
  • _ERR_MISSING_ACCOUNT_NAME will be thrown if the AccountOwner element is provided, but the accountName attribute is missing from the Contract element attribute list.
  • _ERR_MISSING_ACCOUNT_OWNER_ELEMENT will be thrown if the accountName is specified in the Contract element attribute list, but the AccountOwner element is missing.
  • _ERR_MISSING_CONTRACT_NAME will be thrown if the Name attribute in Contract element is an empty string or a space.
  • _ERR_PATTRIBUTE_NOT_REGISTERED_IN_TABLE_PATTRPROD_FOR_CATENTRY will be thrown if in the OrderTCOrderItemPAttribute, the catentry and pattribute pair are not registered in the PATTRPROD database table.
  • _ERR_RETRIEVE_CATENTRY_ID will be thrown if a CATENTRY ID cannot be retrieved based on the information provided in OrderTCOrderItemPAttribute element.
  • _ERR_RETRIEVE_FFMCENTER_ID will be thrown if a FFMCENTER ID cannot be retrieved based on the information provided in FulfillmentCenter element.
  • _ERR_RETRIEVE_MEMBER_ID will be thrown if a MEMBER ID cannot be retrieved
  • based on the information provided in Member element.
  • _ERR_RETRIEVE_OPERATOR_ID will be thrown if a OPERATOR ID cannot be retrieved based on the information provided in Operator attribute of AttributeValue element.
  • _ERR_RETRIEVE_PATTRIBUTE_ID will be thrown if a PATTRIBUTE ID cannot be retrieved based on the information provided in AttributeDetail element.
  • _ERR_RETRIEVE_POLICY_ID will be thrown if a POLICY ID cannot be retrieved based on the information provided in PolicyReference element.
  • _ERR_TOO_MANY_FULFILLMENT_TC will be thrown if there are more than 3 fulfillment center terms in the XML file.
  • _ERR_VERSION_NUMBER_FORMAT will be thrown if the majorVersionNumber or minorVersionNumber attributes of the Contract element of the contract XML file are not numeric
  • _ERR_WRONG_ACCOUNT_OWNER_INFO will be thrown if the account owner ID cannot be retrieved based on the information provided in AccountOwner element.
  • _ERR_WRONG_CONTRACT_OWNER_MEMBER_INFO will be thrown if the contract owner ID cannot be retrieved from the database based on the information provided in the ContractOwner element.
  • _ERR_WRONG_CONTRACT_STATE will be thrown if the contract is not in the draft state.