The wm.b2b.cxml Folder in the WmcXML12 Package

Overview

This appendix describes the wm.b2b.cxml folder in the WmcXML12 package. The services defined in this package are specific to the cXML standard.

wm.b2b.cxml.admin

The wm.b2b.cxml folder is used for administrative purposes only. This folder contains the startup folder.

wm.b2b.cxml.admin.startup:startResources

WmcXML12. Initializes the WmcXML12 package and is invoked when Integration Server loads the WmcXML12 package.

This service is used for administrative purposes only and should not be invoked directly.

wm.b2b.cxml.rec

The wm.b2b.cxml.rec folder contains all the record structures for cXML 1.2 documents.

wm.b2b.cxml.rec.profile:createProfileRequest

WmcXML12. Creates a ProfileRequest record.

Input Parameters

@version cXML version.
@payloadID cXML payloadID.
@timestamp cXML timestamp.
@xml:lang cXML language.
Header Record representing the cXML Header.
@deploymentMode cXML deployment mode.

Output Parameters

ProfileRequest Record representing cXML ProfileRequest.

Usage Notes

This is a convenience service to create a ProfileRequest record. A ProfileRequest must have the ProfileRequest empty element set in the message. This convenience service performs this.

wm.b2b.cxml.shared

The wm.b2b.cxml.shared folder contains services that are useful in creating cXML data fields and transforming cXML documents between different formats.

wm.b2b.cxml.shared:base64ToRecord

WmcXML12. Converts a base64-encoded cXML message to a cXML record structure.

Input Parameters

cXML-base64 The base64-encoded cXML message.
encoding Optional. The character encoding used for cXML document string.

Output Parameters

Document_cXML The cXML message in record form.

wm.b2b.cxml.shared:createPayloadID

WmcXML12. Creates a unique payloadID.

Input Parameters

None.

Output Parameters

payloadID Newly created payloadID.

The format of the payloadID is:

<timestamp>.<sessionID>.<randomNumber>@<hostname>

where <timestamp> is:

<YYYY year><MM month><dd day><hh hour><mm minutes><ss seconds><SSS milliseconds>

wm.b2b.cxml.shared:createRandomID

WmcXML12. Generates a unique ID.

Input Parameters

None.

Output Parameters

randomID Randomly created ID string.

wm.b2b.cxml.shared:cXMLDocumentToRecord

WmcXML12. Converts a cXML document to a cXML record structure.

Input Parameters

node webMethods node representation of an XML document.

Output Parameters

Document_cXML The cXML message in record form.

wm.b2b.cxml.shared:datetimeISO8601

WmcXML12. Returns the current time in a timestamp in ISO8601 format.

Input Parameters

None.

Output Parameters

timestamp The data/time stamp in ISO8601 format.

wm.b2b.cxml.shared:getServerAddress

WmcXML12. Returns the Integration Server name, address, and the port on which the server is running.

Input Parameters

None.

Output Parameters

serverAddress Integration Server address.
serverHostname Integration Server hostname.
serverPort Integration Server port.

wm.b2b.cxml.shared:recordlistAppend

WmcXML12. Appends a record to a record reference list.

Input Parameters

recordlist The record list to append to.
newrecord The new record.

Output Parameters

recordlist The final record list.

wm.b2b.cxml.shared:recordToHTML

WmcXML12. Converts a cXML record to an HTML document; returned as a string.

Input Parameters

Document_cXML The cXML document record.

Output Parameters

htmldata The cXML document as an HTML-encoded string.
xmldata The cXML document as a string.

wm.b2b.cxml.shared:recordToXML

WmcXML12. Converts a cXML record to an XML document; returned as a string.

Input Parameters

Document_cXML The cXML document record.

Output Parameters

xmldata The cXML document as a string.

wm.b2b.cxml.shared:recordToXMLForInvoice

WmcXML12.

Input Parameters

Document_cXML The cXML document record.

Output Parameters

xmldata The cXML document as a string.

wm.b2b.cxml.shared:recordToXMLForInvoiceORIG

WmcXML12.

Input Parameters

Document_cXML The cXML document record.

Output Parameters

xmldata The cXML document as a string.

wm.b2b.cxml.shared:urlencodedToRecord

WmcXML12. Converts a URL encoded cXML message to a cXML record structure.

Input Parameters

cXML-urlencoded The URL encoded cXML message.
encoding Optional. The character encoding of the cXML string.

Output Parameters

Document_cXML The cXML message in record form.

wm.b2b.cxml.shared.data

This wm.b2b.cxml.shared.data folder contains services that are useful in converting a list of records to HTTP name/value pair string and vice versa.

wm.b2b.cxml.shared.data:computeTotal

WmcXML12. Computes the total of a list of items.

Each item is represented by a record containing a field for the price and quantity of the item. The total is computed by multiplying price and quantity of each item and then summed together.

Input Parameters

lineItemList List of records, each representing an item.
priceFieldName The field name for price in the item record. If the field name is nested inside one or more sub-records, specify a relative path to that field, using a / (a slash) to separate each sub-record name.
quantityFieldName The field name for quantity in the item record. If the field name is nested inside one or more sub-records, specify a relative path to that field, using a / (a slash) to separate each sub-record name.
previousTotal Optional. If set, the amount that should be added to the computed total for the item list.

Output Parameters

total Total amount of items.
allItemsComputed If true, all items were used to compute the total.
itemsNotComputed If allItemsComputed is false, itemsNotComputed will be the list of items that were not computed as part of the total.

Usage Notes

priceFieldName and quantityFieldName can refer to a string field in any sub-record inside the item record. The string field and the sub-record(s) must be scalar (they cannot be lists).

For a string field nested in a sub-record, you specify a relative path from the item record to the string field.

For example, assume each item is represented by a record that:

  • Contains a string field quantity.
  • Contains a record field price. The price sub-record contains a string field amount.

Then, the total can be computed by setting:

  • quantityFieldName to quantity
  • priceFieldName to price/amount

wm.b2b.cxml.shared.data:httpNameValuePairsToRecordList

WmcXML12. Converts a string containing name/value pairs into a record list.

This utility can only create a list of records that contain string-only fields.

Input Parameters

string Name/value pairs to be converted into record lists. This field can be URL encoded (urlDecode should be set to true).
urlDecode If true, the name/value pair string is URL-decoded before it is converted to a record list. If false,

Output Parameters

recordList List of records. The record will only contain string fields.

Usage Notes

The name-value pairs string must be in the format as:

<field_a>=<field_a_value1>&<field_b>=<field_b_value1>&<field_a>=<field_a_value2> 
&<field_b>=<field_b_value2>

where:

  • <field_a_value1> represents the value of field_a in the first record.·
  • <field_b_value1> represents the value of field_b in the first record.·
  • <field_a_value2> represents the value of field_a in the second record.·
  • <field_b_value2> represents the value of field_b in the second record.

If urlDecode is true, the input string is first URL-decoded.

wm.b2b.cxml.shared.data:recordListToHTTPNameValuePairs

WmcXML12. Converts a list of records into a name/value pair string for use as parameters in an HTTP GET or an HTTP FORM POST request.

The record in the list must contain only string elements; it cannot contain subrecords. Record fields that are not mapped will not appear in the name/value pair string.

Input Parameters

recordList List of records to make into a name/value pair string. Each record must contain only string fields.
urlEncode If set to true, the name/value pair string is returned URL encoded.
stringToPrepend If set, this string is pre-pended to the name/value pair string.

Output Parameters

string Name/value pair string. The string is URL encoded if urlEncode was set to true.

Usage Notes

If recordList contains records with the fields field_a and field_b, the record list will be encoded as:

<field_a>=<field_a_value1>&<field_b>=<field_b_value1>&<field_a>=<field_a_value2> 
&<field_b>=<field_b_value2>

where:

  • <field_a_value1>represents the value of field_a in the first record.
  • <field_b_value1>represents the value of field_b in the first record.
  • <field_a_value2>represents the value of field_a in the second record.
  • <field_b_value2>represents the value of field_b in the second record.

If urlEncode is set to true, the name/value pair string will be returned URL encoded. If stringToPrepend is set, its value will be prepended to the name/value pair string. A common use of urlEncode and stringToPrepend is for creating an HTTP GET request.

You would set urlEncode to true and stringToPrepend as the BASE URL for the GET request. For example, if stringToPrepend is set to http://aGetRequest.html?, the resulting string would be http://aGetRequest.html?<name-value pair string >.

wm.b2b.cxml.utils

The wm.b2b.cxml.utils folder contains miscellaneous helper services.

wm.b2b.cxml.utils:areEqualStrings

WmcXML12. Returns true if the string list has one of more elements.

Input Parameters

string1 First string in the comparison.
string2 Second string in the comparison.

Output Parameters

stringsEqual Returns true if the strings are identical.

wm.b2b.cxml.utils:getCXMLDocType

WmcXML12. Determines if a record is a cXML document record. Returns the cXML document type and subtype (if any).

Input Parameters

Document_cXML Record representation of cXML document.

Output Parameters

isCXMLDoc Returns true if Document_cXML is a cXML record.
documentType CXML DocumentType (that is, PunchOutSetupRequest, OrderRequest, or ProfileRequest).
subType Sub-type of document (create, inspect, or edit).

wm.b2b.cxml.utils:getStringListLength

WmcXML12. Returns the number of items in the string list.

Input Parameters

stringList The string list.

Output Parameters

length Length of stringList.

wm.b2b.cxml.utils:hasElements

WmcXML12. Returns true if the string list has one of more elements.

Input Parameters

stringList The string list.

Output Parameters

stringList The string list.
hasElements Returns true if the string list is not empty. Returns false otherwise.

wm.b2b.cxml.utils:isCXMLDoc

Deprecated - Use wm.b2b.cxml.utils:getCXMLDocType instead.

WmcXML12. Returns true if the Document_cXML record contains the element cXML.

Input Parameters

Document_cXML The record to check if it is a cXML record.

Output Parameters

isCXMLDoc Returns true if the element cXML is found inside the record. Returns false otherwise.

wm.b2b.cxml.utils:isValidURL

WmcXML12. Returns true if the URL is valid.

Input Parameters

URL The URL string.

Output Parameters

isValidURL Returns true if the URL is valid. Returns false otherwise.

wm.b2b.cxml.utils.properties

The wm.b2b.cxml.utils.properties folder contains services/records describing the cXML version supported by this package.

wm.b2b.cxml.utils.properties:getCXMLProperties

WmcXML12. Retrieves the cXML properties.

Input Parameters

None.

Output Parameters

version The cXML version supported.
DTDReference The cXML DTD supported.

wm.b2b.cxml.utils.properties:getInvoiceCXMLProperties

WmcXML12. Retrieves the InvoicecXML properties.

Input Parameters

None.

Output Parameters

version The cXML version supported.
DTDReference The cXML DTD supported.

wm.b2b.cxml.utils.properties:CXMLProperties

WmcXML12. A record containing cXML properties.

Input Parameters

None.

Output Parameters

version The cXML version supported.
DTDReference The cXML DTD supported.

wm.b2b.cxml.utils.status

The wm.b2b.cxml.utils.status folder contains services to return error status messages.

wm.b2b.cxml.utils.status:getDefaultResponseMessage

WmcXML12. Returns the default response string, given the statusCode.

Input Parameters

statusCode CXML status code.

Output Parameters

statusMessage CXML status messages.

wm.b2b.cxml.utils.status:isValidStatusCode

WmcXML12. Returns true if the statusCode is valid.

Input Parameters

statusCode CXML status code.

Output Parameters

isValidCode Returns true if statusCode is valid.

wm.b2b.cxml.utils.protocol

The wm.b2b.cxml.utils.protocol folder contains services to extract cXML field data from cXML documents.

wm.b2b.cxml.utils.protocol:credentialToRecordList

WmcXML12. Converts a single credential record to a credential record list (as required in the cXML header).

Input Parameters

Credential Credential record.

Output Parameters

CredentialList List of credential records.

wm.b2b.cxml.utils.protocol:descriptionToRecordList

WmcXML12. Creates a description record list needed in an ItemDetail from a single description string.

Input Parameters

description ItemDetail description.
language Language.
ShortName List of short names.

Output Parameters

DescriptionList List of description records.

wm.b2b.cxml.utils.protocol:getBuyerCookie

WmcXML12. Returns the default response string, given the statusCode.

Input Parameters

Document_cXML Record representing cXML document.

Output Parameters

cookie cXML BuyerCookie.

Usage Notes

This services works if the BuyerCookie is represented as a string field or a *body string element.

wm.b2b.cxml.utils.protocol:getCredential

WmcXML12. Returns the credential with the specified affiliation type.

If Credentials contains only one credential, that credential is returned. If type is not set, it returns the un-affiliated credential.

Input Parameters

Credentials List of credential records.
Type Credential Type to look for.

Output Parameters

Credential cXML credential found.

wm.b2b.cxml.utils.protocol:getCredentialIdentity

WmcXML12. Retrieves the identity of a credential.

Input Parameters

Credential Credential record containing identity information.

Output Parameters

identity cXML credential record identity.

wm.b2b.cxml.utils.protocol:getExtrinsic

WmcXML12. Returns an extrinsic record item from a list with name as the value of the nameinput.

Input Parameters

Extrinsics Record representing cXML message.
name Name of extrinsic record to return.

Output Parameters

Extrinsic Extrinsic content with the specified name.

wm.b2b.cxml.utils.protocol:getFrom

WmcXML12. Returns the From and Sender records from a cXML header.

Input Parameters

Document_cXML Record representing cXML message.

Output Parameters

sender Sender credential.
from From credential.

wm.b2b.cxml.utils.protocol:getPunchOutURL

WmcXML12. Returns the punchout URL from the cXML PunchOutSetupRequest.

Input Parameters

Document_cXML Record representing cXML PunchOutSetupRequest.

Output Parameters

punchoutURL The buyer's to punchout URL.

Usage Notes

This services works if the punchout URL is represented as a string field or a *body string element.

wm.b2b.cxml.utils.protocol:getStartPageURL

WmcXML12. Returns the supplier's catalog startPageURL.

Input Parameters

PunchOutSetupResponse Record representing cXML PunchOutSetupResponse.

Output Parameters

startPageURL URL to the supplier's catalog.

Usage Notes

This services works if the startPageURL is represented as a string field or a *body string element.

wm.b2b.cxml.utils.protocol:IsAffiliatedWith

WmcXML12. Returns true if there is a credential in the Credential record list has an identity equal to type.

Input Parameters

Credential List of credential records.
type Credential Type to look for.

Output Parameters

isAffiliatedWith If true, the list contains a credential with the type set to type.

wm.b2b.cxml.utils.protocol:setPunchOrderMessageToCancel

WmcXML12. Converts a PunchOutOrderMessage containing a Message body into a PunchOutOrderMessage Cancellation (no Message Body).

Input Parameters

PunchOutOrderMessage Record representing cXML PunchOutOrderMessage.

Output Parameters

PunchOutOrderMessage Record representing cXML PunchOutOrderMessage Cancellation.