Development of Rest API webservice access to your data.

Xbase++ 2.0 Build 554 or later
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Development of Rest API webservice access to your data.

#1 Post by Cliff Wiernik »

I am looking at this methodology to use with xb2net and/or Xbase++2.0 to provide access to data made available by our software. Does anyone have any experience developing a restful API approach to access to your data. I have been reviewing information and tutorials available for this topic.

Any thoughts, ideas or recommendations would be greatly appreciated.

Cliff

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Development of Rest API webservice access to your data.

#2 Post by rdonnay »

Why does it have to be restFul?

What is wrong with HTML and JavaScript for the user interface?
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Development of Rest API webservice access to your data.

#3 Post by Cliff Wiernik »

Roger, maybe I don't understand your HTML/javascript question. I think we are looking for something differently.

It is not going to be a user interface. Javascript I don't think is applicable. We just need to provide a methodology to provide data to the outside, be it to someone who may display it in web pages, or who would be submitting information for a loan application to us, which we would score and provide results. Or we may provide statistics to a dealer who is getting information from us. It would be like when we contact or credit card provider to submit credit card information and they provide back the approval or decline of the credit card charge. However, in this case, we are providing the service instead of contacting a service.

Or the developer of the site for one of our customers, wants to get information from us to use to populate the site or process transactions. He have looked at providing a soap service to provide that information, which would work, but it appears that as opposed to use SOAP, alot of web services providers are using REST instead of SOAP. So I am determining which way to go.

The equivalent internally would be calling a function with the required parameters and providing an array of result variables.

Equivalent sites providing services like this would be the PDF services from BCL Technologies, or the SmartyStreets GET/POST interface described at https://smartystreets.com/features. The results are presented via JSON. Another example would be OpenACH OFAC API, http://ofac.openach.com/site/docs, which s a REST/JSON type webservice, and is defined by a set of endpoints, each one serving a specific function.

This is what we are looking to do. The users of our software want to be able to access the data we have in our software, and incorporate into their end products the way they may want.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Development of Rest API webservice access to your data.

#4 Post by rdonnay »

Ok, now I understand.

Still, which ever way you go, the server can be written in Xbase++.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Development of Rest API webservice access to your data.

#5 Post by skiman »

Hi Cliff,

I don't think there is a lot of difference in programming. Or you can use SOAP or REST. If you see that Google is using REST for connecting to their products, as for example synchronizing with Google Calendar, it seems as this will be the way to go for the future.

When using REST you need a Json parser. I'm using REST to synchronize with Google, I'm using SOAP to provide an API for my software. With xb2net the SOAP is rather easy. With rest you will need to determine the type of POST: GET, PUT, DELETE.
Best regards,

Chris.
www.aboservice.be

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: Development of Rest API webservice access to your data.

#6 Post by PedroAlex »

At this point I also need a solution of this kind.
I have customers who have joined an online store and need to communicate with the Backoffice developed in Alaska xBase ..
I have done some testing with WAA but it seems an obsolete product.
At this time many of my competitors already have API of this kind.
Any solution or example of this, would be very welcome.

Regards
Pedro
Pedro Alexandre

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Development of Rest API webservice access to your data.

#7 Post by Cliff Wiernik »

Chris,

We currently use SOAP to provide customer data to our phone system, providing automated information to customers like when you call into a credit card site. We have a new programmer on staff that previously did web development for a major US insurance company and knows alot more about this than I do, but not in the Xbase++ world. He is into Java and other non-XBase++ tools.

Related to SOAP, and development of your API, how did you provide the documentation to the outside users of your API to allow them to develop their services using your SOAP API. Our programmer is concerned about the WISDL, xml description documentation and other documentation items of the SOAP interface that you should provide to the outside users so they can just load it into their tools, be it open source java or similar tools or .net tools that would automatically build their interfaces our your API.

I have never had much of that information when connection to other outside APIs and obviously using XBase++/xb2net, there is not automatic tools available to consume these documentation files and automatically generate the interface.

So I am wondering how you accomplish your SOAP API development and make it available to the outside. I was looking at REST as just a different approach, compared to SOAP, but could do whatever is best. One of the things we would provide is the use would connect and upload a customer consumer finance loan application to us, we would score it and provide the results indicating approval/denial, conditions. It also would provide the capability to make available processing status of the loan and followup status on items no approved/denied at the initial determination. Different soap calls would be available for these items. We currently use XML to move data in/out, but have not done it directly via a web interface. We use a watch folder style methodology on a secure FTP site, but need to move to web services for this and other types of API's.

Any suggestions/information/direction would be helpful.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Development of Rest API webservice access to your data.

#8 Post by skiman »

Hi Cliff,

Creating the WSDL is a problem. It is difficult to create, there should exist some tools, but I never used it. You will not encounter this problem with a REST API. My webservices are created when the system of rest wasn't common. If I would start now, I would follow Google, and would create the services based on Rest.

I created a documentation based on the SOAPTEST from Roger, where I have the description, and a sample request:

Code: Select all

<?xml version="1.0" ?>
<env:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" >
<env:Header></env:Header>
<env:Body>
<NewDocRequest xmlns="test">
          <Nummer>999999</Nummer>
          <Soort>B</Soort>
<Weborder>1234</Weborder>
<Ref>reference from the webshop</ref>
</NewDocRequest>
</env:Body>
</env:Envelope>
I also use SOAPUI to test the services. With SOAPUI you can create an XML, which the developer can get to test on his site.
Best regards,

Chris.
www.aboservice.be

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Development of Rest API webservice access to your data.

#9 Post by Cliff Wiernik »

Thanks for the info and insight.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Development of Rest API webservice access to your data.

#10 Post by rdonnay »

I have used web services based on the restful model.

The State of New York employs a restful model for it's web services.
It provides for delivery of data as XML, CSV or JSON.

This is not hard to do in Xbase++.

eXpress++ has DC_Array2CSV(), DC_XmlNode:writeXml(), and soon will have functions for support of JSON().

After writing functions like DC_Array2JS(), DC_Object2JS() and DC_Value2JS(), I now realize that I should write the same for XML.

This means that an Xbase++ program could be written using objects and arrays and output can be simply converted to that requested by the client.

I can see why JSON is becoming more popular, especially for programmers who like to write in JavaScript.
I recently finished an online course in JavaScript and Jquery and I see many ways that I can employ new features in eXpress++ for web development.

I thought about doing this years ago, but it was not practical until CXP came along. Now I am enthused about this.
The eXpress train is coming - and it has more cars.

Post Reply