Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Ektoras Giorgos
New Member.
1781 views

PrestaShop

Hello,

I need to communicate with prestashop. The XML i need to parse is in a remote server and the http address is http://minisys.gr/mstore/api/products but as you can see asks for credentials. So, how i can communitate with that and pass data (credentials) through http? Do i have to use Xcentrisity or RMNet or is there any other whay?

The XML is from PrestaShop eshop and in the development documentation says that i have to your REST. 

http://doc.prestashop.com/display/PS14/Using+the+REST+webservice

anyone can help pleas?

0 Likes
1 Reply
Knowledge Partner
Knowledge Partner

RE: PrestaShop

You can send Basic Authentication credentials using the Authenticate HTTP header.  In RMNet one would use the optional extraheaders parameter on the HTTPPost to inject the Authenticate header.  The extraheaders string is a set of name-value pair(s) where there is a binary zero (x00) byte after the name and the value, and two binary zero bytes (x0000) at the end.  The credentials are encoded in base64 - which can be done using COBOL (there may be such a module floating around on this forum or on RM/COBOL).

REST is an architecture for implementing web services by using the HTTP verbs, which are transport layer verbs, at the application layer.  RMNet (at least in the RM/COBOL version) implements only the POST and GET verbs.  That may be sufficient for your use of this web service.  You may find an explanation of REST in the Xcentrisity Business Information Server tutorial; the tutorial discusses creating web services, but you may find the explanation useful in the context of consuming web services as well.  If you find that you also need to use the HTTP PUT and DELETE verbs, you can use cURL from CALL "SYSTEM".

It appears, from the very limited documentation on the web service payloads, that Xcentrisity XML Extensions would be a good choice for creating and consuming the XML 'trees' that are mentioned in the documentation.  Use the ?synopsis capability to get the XML exemplar for a method, and use that to design XSLT transformations that will convert to/from COBOL data.

Tom Morrison
Hill Country Software


Tom Morrison
Consultant

Tags (1)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.