OnRamp for Commerce One MarketSite 3.5 SP1 | webMethods OnRamp for Commerce One MarketSite Adapter Documentation | webMethods OnRamp for CommerceOne MarketSite Adapter Installation and User’s Documentation | Receiving and Sending Envelopes | Build a Send Service
 
Build a Send Service
The WmMarketConnectExample package contains sample send services.
*To build a send service
1. Open Designer.
2. Create a service that represents the send service in either of two locations, depending on the purpose of the send service:
*If the send service is to create and send envelopes containing xCBL response documents to MarketSite in reply to asynchronous requests, create the service in the package containing the envelope handler that processes the asynchronous requests.
*If the send service is to create and send envelopes containing xCBL request documents to MarketSite, create a new package, declare that the package is dependent on the Integration Server package WmMarketConnect, and create the send service in that package.
3. In the send service, call services that create and send envelopes, as follows:
a. In your C1 OnRamp configuration, you specified whether to validate all outgoing xCBL documents. If you want to override that default setting, call the parseString service.
b. If your back-end system cannot handle DDIDs, call the getDDID service to get the DDIDs that correspond to the sender ID and recipient IDs provided by your back-end system. You must call the service twice, once to get the DDID for the sender ID and once to get the DDID for the recipient ID.
c. Call a service such as the createEnvelopeFromRecord service to create an envelope that contains the xCBL document.
d. If you want to specify non-standard fields in the envelope header, insert the name/value pairs in the customProperties envelope header record.
e. If you are creating a reply envelope, use the correlationId from the header of the incoming envelope in the header of the reply envelope.
f. Call a service such as the createBinaryAttachment service to create any necessary attachments. If you want to create an attachment from a string, use the Integration Server service pub.string:bytesToString.
g. Call the addAttachmentToEnvelope service to add the attachments to the envelope.
h. If necessary, call the pub.security:clearKeyAndChain service or the pub.security:setKeyAndChain service (see Communicate as a Client for more information).
i. Call the sendEnvelope service to send the envelope to MarketSite.
You can also have the send service call custom services to create envelopes. (For instructions on writing custom services, see the webMethods Service Development Help for your release.)