Ariba Supplier OnRamp 7.1 | webMethods Ariba Supplier OnRamp Documentation | webMethods Ariba Supplier OnRamp Installation and User’s Documentation | Running the Example Punchout Site | The Configuration of the Example Punchout Site | The PunchOutSetupRequest Handler
 
The PunchOutSetupRequest Handler
The service for this handler (wm.b2b.cxml.example.snowboardSupplier.messageHandlers:newShoppingSession) was created using the handler specification guidelines described in wm.b2b.cxml.guidelines:PunchOutSetupRqstHdlr. This service handles only the create operation of the PunchOutSetupRequest service.
The newShoppingSession service initializes storage for a buyer's session in the shopping cart system by calling wm.b2b.cxml.example.snowboardSupplier.buyerUtils:initBuyerPersistentStore, which sets up the shopping cart session on the shopping cart system. The shopping cart system returns a unique ID (sessionID) that identifies this shopping cart session.
The initBuyerPersistentStore service represents the code that you would write to initialize the shopping cart system for a new buying session. In our simulated shopping cart system, we are using the server's session object to persist shopping cart data.
Note:
The storage of the shopping cart items in the session object was done only to simplify the implementation of the simulated shopping cart system; it should not be considered part of a "real" PunchOut implementation. In a real implementation, the shopping cart system would manage storage of the selected cart items.
This service was created to illustrate that you need to write some code to setup a new buying session on the shopping cart system when you receive a PunchOutSetupRequest.
In the example, the BuyerSession data (the PunchOutSetupRequest fields that need to be saved) is stored on Integration Server using the services in wm.b2b.cxml.utils.persistence.session.
Note:
The use of the services in wm.b2b.cxml.utils.persistence.sessionto store the BuyerSessionData (the punchoutURL, BuyerCookie, and from credential fields) should be considered part of the punchout implementation. In a real punchout implementation, you could use the services in wm.b2b.cxml.utils.persistence.session to store the punchout-specific BuyerData, if the shopping cart system cannot be used.
It is important to distinguish between these two different uses of the session object in the demonstration package.
wm.b2b.cxml.example.snowboardSupplier.buyerUtils:saveBuyerInfo gets the punchout URL, the buyer cookie, and the From/Senderheader fields from the PunchOutSetupRequest. In addition, saveBuyerInfo creates a BuyerSession object. For more information, see wm.b2b.cxml.utils.persistence:BuyerSession.
The BuyerSession object is stored by the utility wm.b2b.cxml.utils.persistence.session:saveBuyerSessionData. The newShoppingSession service then generates a catalog URL to enable the buyer to start shopping, using the service wm.b2b.cxml.example.snowboardSupplier.buyerUtils:getStartpageURL. This service simply appends a sessionID to a fixed URL for the catalog. The URL is set in the catalogURL output field.
The catalogURL is of the following form:
http://serverhostname:port/invoke/wm.b2b.cxml.example.snowboardSupplier/startpag
e?sessionID=ID
where, ID is the unique identifier of the shopping session.