PunchOut testing with Chrome add-in

  • Updated

While reading this article, any content in brackets [LIKE THIS] will be replaced with actual values..

In the project source code, browse to the web.config file and look for the following:

<handlers>       <remove name="WebDAV" />       <remove name="UrlRoutingHandler"/>       <add name="elmah" path="InsiteElmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" />       <add name="PunchOutSetupRequestHandler" verb="POST" path="/Punchout/punchoutsetuprequest.isch" preCondition="integratedMode" type="InSite.PunchOut.Http.PunchOutSetupRequestHandler, InSite.PunchOut, Version=1.0.0.0, Culture=neutral"/>       <add name="PunchOutSessionRequestHandler" verb="GET" path="/Punchout/punchoutsessionrequest.isch" preCondition="integratedMode" type="InSite.PunchOut.Http.PunchOutSessionRequestHandler, InSite.PunchOut, Version=1.0.0.0, Culture=neutral"/> 

The reason for checking the web.config file is to confirm that the PunchOut URL's exist and therefore are ready for use. The following is a list of possible PunchOut URLs:

  • /Punchout/punchoutsetuprequest.isch
  • /Punchout/punchoutsessionrequest.isch
  • /Punchout/punchoutsubmitporequisition.isch
  • /Punchout/punchoutorderrequest.isch
  • /Punchout/punchoutprofiletransactionrequest.isch
  • /Punchout/punchoutsessionstatus.isch

Use the list above to define the URLs. For example:

  • 4.4: https://[WEBSITE NAME].com/punchout/punchoutsetuprequest.isch
  • 4.5: https://<DOMAIN>/api/v1/punchout/setuprequest

To test the PunchOut User Setup Request, first get a copy of a PunchOut request. This can be obtained from Supplier Solutions if this is the first time punching out, or from the Optimizely Configured Commerce database if you have used PunchOut before. Then open the Postman Rest Client and prepare to post:

  1. Change the contents of the URL field to contain POST.
  2. Select the Body finger tab .
  3. Choose the radio button raw.
  4. Paste the PunchOut request into the Body.

The following is what a sample PunchOut request would look like:

<?xml version="1.0"?> <!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.008/cXML.dtd"> <cXML payloadID="2016-10-28T16:29:56-05:00@###.##.###.###.[CLIENT]" timestamp="2016-10-28T16:29:56-05:00" xml:lang="en-US"> <Header>   <From>    <Credential domain="NetworkId">     <Identity>[PUNCHOUT USERNAME</Identity>    </Credential>   </From>   <To>    <Credential domain="DUNS">     <Identity>[CLIENT NAME]</Identity>    </Credential>   </To>   <Sender>    <Credential domain="UserSiteNetworkUserId">     <Identity>[INTEGRATION PARTNER USER]</Identity>     <SharedSecret>[INTEGRATION PARTNER PASS]</SharedSecret>    </Credential>    <UserAgent>Enterprise-Connect 2.1</UserAgent>   </Sender> </Header> <Request deploymentMode="test">   <PunchOutSetupRequest operation="create">    <BuyerCookie>{[COOKIE GUID}]</BuyerCookie>    <Extrinsic name="User"></Extrinsic>    <BrowserFormPost>     <URL>https://staging.[INTEGRATION PARTNER].com/[CLIENT]/suppliers/[CLIENT]/receivepunchoutquote.asp</URL>    </BrowserFormPost>    <Contact role="endUser">     <Name xml:lang="en"></Name>     <Email></Email>    </Contact>    <SupplierSetup>     <URL>https://staging.[INTEGRATION PARTNER].com/[CLIENT]/suppliers/[CLIENT]/punchoutsetup.asp</URL>    </SupplierSetup>    <SelectedItem>     <ItemID>      <SupplierPartID>AAA</SupplierPartID>      <SupplierPartAuxiliaryID/>     </ItemID>    </SelectedItem>   </PunchOutSetupRequest> </Request> </cXML> 				

Here is a sample of a valid response from the punchoutsetuprequest posting of cXML above:

<?xml version="1.0" encoding="utf-16"?> <!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd"> <cXML xml:lang="en-US" payloadID="635678058890586247@[CLIENT].insitesoftpilot.com" timestamp="2015-05-21T16:51:29-05:00">   <Response>     <Status code="200" text="Successful" />    <PunchOutSetupResponse>      <StartPage>        <URL>https://[CLIENT URL].insitesoftpiolot.com/Punchout/punchoutsessionrequest.isch?ps=[GUID]</URL>      </StartPage>	    </PunchOutSetupResponse>	  </Response> </cXML> 				

Go to the db and get the most recent order with Status = "PunchOut", then fill in the cXML below. Use this URL in Postman for testing the submission of an order:

  • 4.4: http://[CLIENT URL].insitesoftpilot.com/punchout/punchoutorderrequest.isch
  • 4.5: https://<DOMAIN>/api/v1/punchout/orderrequest
<?xml version="1.0"?><!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd"><cXML payloadID="[123456@integrationpartner.com]" timestamp="2016-08-10T16:29:56-05:00" xml:lang="en-US"><Header>  <From>   <Credential domain="NetworkId">    <Identity>[PUNCHOUTUSERNAME]</Identity>   </Credential>  </From>  <To>   <Credential domain="DUNS">    <Identity>[CLIENTNAME]</Identity>   </Credential>  </To>  <Sender>   <Credential domain="UserSiteNetworkUserId">    <Identity>[INTEGRATION�PARTNER�USER</Identity>    <SharedSecret>[INTEGRATION�PARTNER�PASS]</SharedSecret>   </Credential>   <UserAgent>[CLIENTNAME]</UserAgent>  </Sender></Header><Request deploymentMode="prod">  <OrderRequest>   <OrderRequestHeader type="new" orderID="555666" orderDate="2016-08-10T16:13:48-05:00">   <Total>    <Money currency="USD">[ORDER�TOTAL]</Money>   </Total>   <ShipTo>    <Address addressID="101" isoCountryCode="US">     <Name xml:lang="en">All Ship TO</Name>     <PostalAddress name="default">      <DeliverTo></DeliverTo>      <Street></Street>      <City></City>      <State></State>      <PostalCode></PostalCode>      <Country isoCountryCode="US"></Country>     </PostalAddress>     <Email name="default"></Email>     <Phone name="work">      <TelephoneNumber>       <CountryCode isoCountryCode="US"></CountryCode>       <AreaOrCityCode></AreaOrCityCode>       <Number></Number>      </TelephoneNumber>     </Phone>     <Fax name="work">      <TelephoneNumber>       <CountryCode isoCountryCode="US">1</CountryCode>       <AreaOrCityCode></AreaOrCityCode>       <Number></Number>      </TelephoneNumber>     </Fax>    </Address>   </ShipTo>   <BillTo>    <Address addressID="" isoCountryCode="US">     <Name xml:lang="en">Customer 100</Name>     <PostalAddress name="default">      <Street></Street>      <City></City>      <State></State>      <PostalCode></PostalCode>      <Country isoCountryCode="US">United States</Country>     </PostalAddress>    </Address>   </BillTo>   <Comments></Comments>   <Extrinsic name="CustomerPO">[PO�NUMBER]</Extrinsic>  </OrderRequestHeader>        <ItemOut lineNumber="1" quantity="10" requestedDeliveryDate="">            <ItemID>                <SupplierPartID>[PRODUCT�NAME 2]</SupplierPartID>                <SupplierPartAuxiliaryID></SupplierPartAuxiliaryID>            </ItemID>            <ItemDetail>                <UnitPrice>                    <Money currency="USD">[PRODUCT COST]</Money>                </UnitPrice>                <Description xml:lang="en">[PRODUCT�DESCRIPTION]</Description>                <UnitOfMeasure>EA</UnitOfMeasure>                <Classification domain="UNSPSC"></Classification>                <ManufacturerPartID></ManufacturerPartID>            </ItemDetail>        </ItemOut>  </OrderRequest> </Request></cXML>