Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Web Serviec and Punch Out Catalogues  (Read 6765 times)
Gary C.
Posts: 109


« on: February 23, 2023, 03:42:25 pm »

Hi

We are trying to ingest the shopping basket of a punchout session to a third party supplier initiated from our application.

This will be sent to the URL we specify and is an HTML form, with a specific hidden field called cXML-urlencoded. This contains the cXML representation of the shopping basket.

For example, the html below is a representation of what the supplier's system will do:

Code
  1. <!DOCTYPE html>
  2.   <FORM NAME="upload" method="post" action="https://mywebserver/gas/ws/r/basket/getbasket/2323232">
  3.        <input id="cXML-urlencoded" name="cXML-urlencoded" value="<cXML payloadID......../cXML>" >
  4.        <input type="submit" name="submit" value="Submit"/>
  5.    </FORM>
  6. </html>

I have created a web service which is defined below:

Code
  1. public function getBasket(
  2.            sid integer attribute(WSParam),
  3.            basket record attribute(WSMedia="application/x-www-form-urlencoded")
  4.                cXML-urlencoded string
  5.            end record)
  6.  
  7.    attributes (WSPost,
  8.              WSPath="/getbasket/{sid}")
  9.  
  10.    returns (string attribute(WSMedia="text/plain"))
  11.  

The issue I am having is with the form field name having a hyphen in it. The above snippet has a compile error, yet I cannot rename the form field (as I don't control it and it is standard for all punch out systems). If I call it something else in my function definition, then it gives error: UrlFormEncoded Rest parameter is missing

Can anyone suggest a work around for this?

Thanks

Gary


Reuben B.
Four Js
Posts: 1116


« Reply #1 on: February 27, 2023, 11:34:13 pm »

Gary,

I am not 100% sure on what you are trying to do but in general attributes such as ...

WSName http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_gws_high_level_rest_api_attributes_WSName.html
XMLName http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_gws_XML_attribute_XMLName.html
json_name http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_json_utils_names.html

... are used to aid in mapping processes where the identifier used by the 3rd party is not a legal Genero identifier  http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_language_features_identifiers.html

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines