Using pub.client.http to post to a hidden from

I am trying to post a cXML message(PunchOutOrderMessage) to Coupa. The documentation states that I have to post the cXML to a hidden form. I don’t know exactly what setting I should use in pub.client.http to make this work. Here is the cXML documentation:

Thanks in advance for any help,

Hi, to post form data follow below steps when using pub.client:http:

  1. Set method to POST
  2. Set data/string to below (Replace the sample cXML I used with your cXML. Notice the boundery string before and after cXML while replacing):

Content-Disposition: form-data; name="cxml-urlencoded"

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE cXML SYSTEM ""> <cXML xml:lang="en-US" timestamp="2008-05-19T19:51:57+00:00" payloadID="1211226717.22017@ip-10-251-122-83" version="1.2.014">   ;   <Header>     <From>       <Credential domain="duns">         <!-- Coupa Supplier option, typically DUNS -->         <Identity>dell</Identity>         <!-- Coupa Supplier option, string -->       </Credential>     </From>     <To>       <Credential domain="Duns">         <!-- Coupa Supplier option, typically DUNS -->         <Identity>128293714</Identity>         <!-- Coupa Supplier option, string -->       </Credential>     </To>     <Sender>       <Credential domain="duns">         <Identity>dell</Identity>         <!-- Coupa Supplier option, string -->         <SharedSecret>dell</SharedSecret>         <!-- Coupa Supplier option, string -->       </Credential>       <UserAgent>Coupa Procurement 1.0</UserAgent>       <!-- does not change -->     </Sender>   </Header>   <Request deploymentMode="production">     <OrderRequest>       <OrderRequestHeader orderID="6112" orderDate="2008-05-19T19:51:55Z" type="new" orderType="regular">         <Total>           <Money currency="USD">1505.0</Money>           <!-- Currency code configured in Coupa -->         </Total>         <ShipTo>           <Address isoCountryCode="US" addressID="3119">             <Name xml:lang="en">jmadden</Name>             <PostalAddress name="default">               <DeliverTo>j maddedn</DeliverTo>               <Street>333 East Hill Dr</Street>               <City>san leandro</City>               <State>ca</State>               <PostalCode>22222</PostalCode>               <Country isoCountryCode="US">United States</Country>             </PostalAddress>             <Email name="default"></Email>           </Address>         </ShipTo>         <BillTo>           <Address isoCountryCode="US" addressID="142">             <Name xml:lang="en">SOB1</Name>             <PostalAddress name="default">               <DeliverTo>Noah Sanity Attn: Noah Noah</DeliverTo>               <Street>3420 Flatiron Way</Street>               <City>West Index</City>               <State>NJ</State>               <PostalCode>43023</PostalCode>               <Country isoCountryCode="US">United States</Country>             </PostalAddress>           </Address>         </BillTo>         <Contact role="endUser">           <Name xml:lang="en">j maddedn</Name>           <Email name="default"></Email>         </Contact>       </OrderRequestHeader>       <ItemOut quantity="1" lineNumber="1">         <ItemID>           <SupplierPartID>223-4511</SupplierPartID>           <!-- Coupa Item Part Number -->           <SupplierPartAuxiliaryID>1005379527029\1</SupplierPartAuxiliaryID>           <!-- Auxiliary Part Number, typically not used -->         </ItemID>         <ItemDetail>           <UnitPrice>             <Money currency="USD">1505.0</Money>             <!-- Currency code configured in Coupa -->           </UnitPrice>           <Description xml:lang="en">OptiPlex 755 Energy Smart Minitower;IntelREG CoreTM 2                         Quad Processor Q6600 (2.40GHz, 2X4M, 1066MHz FSB)</Description>           <UnitOfMeasure>EA</UnitOfMeasure>           <Classification domain="UNSPSC">unknown</Classification>           <!-- Future expansion -->         </ItemDetail>         <Distribution>           <Accounting name="bbbb">             <!-- Coupa Account name -->             <Segment id="bbb" description="ORG" type="Organization" />             <Segment id="b" description="DEPT" type="Department" />             <Segment id="bb" description="PROJ" type="Project" />           </Accounting>           <Charge>             <Money currency="USD">1505.0</Money>           </Charge>         </Distribution>       </ItemOut>     </OrderRequest>   </Request> </cXML>

  1. Set any auth details that are required
  2. Add Content-Type under headers and Set it to multipart/form-data; boundary=------MyBoundarySomeRandomString

These steps should do.