NetTalk Central

Author Topic: Getting started with a web API  (Read 19911 times)

frosty

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Getting started with a web API
« on: February 19, 2009, 04:48:38 PM »
I need to begin using a web app's API (see http://www.magentocommerce.com/wiki/doc/webservices-api/api#magento_core_api_per_module) to synchronize data between it and a Clarion app.

Other than referring to NetTalk's SOAP examples, I'm admittedly clueless about how to get underway.  How would I go about implementing, say, something like this http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product_attribute_tier_price using NetTalk?

Any nudges would be appreciated.

[L]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Getting started with a web API
« Reply #1 on: February 19, 2009, 10:03:17 PM »
Hi Leroy,

With most web services, the devil is in the details, and not unlike any programming it's the stuff that's _not_ documented that really causes the problem. The fastest way to get going is to get a working client as an example. From this example, using Fiddler, you can inspect the packets being sent, and returned, and that'll make the job a LOT easier.

The next step is to take the NetTalk example SOAP client, with xFiles, and send a simple request to the server. And inspect the reply.

Now this may seem daunting, but actually it's remarkably easy. It's the "unknown" that is scary - but the process itself is really simple.

All you're really doing is
a) form an appropriate clarion structure (almost always a GROUP) which contains the fields for the request.

b) use xFiles to turn the structure into Xml. (The xFiles doc section on Saving,
http://www.capesoft.com/docs/xFiles/xfiles.htm#CreatingXML, is especially useful here.
And the instructions on setting properties is particularly important
http://www.capesoft.com/docs/xFiles/xfiles.htm#PropertiesInSave)

c) POST the xml to the remote service using the WebClient class.

d) then handle the reply.

Cheers
Bruce

frosty

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Getting started with a web API
« Reply #2 on: February 20, 2009, 11:18:29 AM »
Thanks Bruce.  I'll be working on this over the next few days.

[L]