YOUR FEEDBACK
Working at Google vs. Working at Microsoft
Ray the Barbarian wrote: I worked at Microsoft Research, and I had an in p...
SOA World Conference
Virtualization Conference
$50 Savings Expire June 24, 2008... – Register Today!

SYS-CON.TV

2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
TOP THREE LINKS YOU MUST CLICK ON


Using Web Services in a PocketBuilder Application
How I finally overcame a nagging irritation

Digg This!

Page 2 of 4   « previous page   next page »

Here I'll be building a pair of stored procedures that call a Web Service out on the Internet for multiple rows of data that I'll present in a DataWindow.

I'm using SQL Anywhere 10.0.1.3619, but it should be possible using version 9.0.2 with only a couple of changes.

My Toolbox:

  • PocketBuilder 2.5
  • SQL Anywhere 10.0.1
  • Internet access
  • My trusty HP-5550 PocketPC
  • A "Just Do It" attitude
Procedure Overview:
a.  Find a Web Service to exploit
b.  Write a pair of stored procedures
c.  Create a DataWindow to call the stored procedure
d)  Create an application using that DataWindow

The Web Service to Exploit
Poking around on the Internet, I found a set of Web Services at www.ecocoma.com/shipping_webservice.aspx that calculate shipping rates for all the major carriers. These Web Services had an API that was understandable and a "trial user" capability necessary to my experiment.

From quick look at the eCoComa examples and their documentation it was easy to recognize the important items:

  • Namespace: http://service.ecocoma.com/shipping/ups
  • Endpoint: http://service.ecocoma.com/shipping/ups.asmx
  • SOAP Operation (or 'action'): GetUPSRate
  • The argument list used for the SOAP call
    - Subscription information (we are using the trial)
    - Originating postal code (zipcode in the US)
    - Originating country
    - Destination postal code
    - Destination country
    - Package weight
    - Package value
  • and the "look" of the SOAP response
I am a big proponent of the "let's just try it" school, so the first thing I tried was a simple stored procedure that made the SOAP call then looked at what ended up in the log file. (I wasn't ready to parse the payload into a result set - first things first). I piggybacked on an existing database file, but I could have even used a blank (yes, blank!) database file. This technique doesn't add or use any user tables in the database, so it's safe.

I added the HTTP logging switch (-zoc) to the start line so I could examine the traffic back and forth. I could turn off logging once I was satisfied with the operation.

Using ODBC Administrator - set the "Start line:" to:

dbeng10.exe -zoc d:\sa10_ws.log

The Two Stored Procedures
Opening up iSQL and using Chance's article as inspiration, I made some guesses and created the first stored procedure GetUPSRate:

call sa_make_object( 'function', 'GetUPSRate');

alter function GetUPSRate(
      KeyID char(20),
      DomainID char(20),
      origPostal char(20), origCountry char(20),
      destPostal char(20), destCountry char(20),
      Weight char(10),
      Value char(10) )
      RETURNS LONG VARCHAR
      url 'http://service.ecocoma.com/shipping/ups.asmx'
      namespace 'http://service.ecocoma.com/shipping/ups'
      type 'SOAP:DOC'
      set 'SOAP(operation=GetUPSRate)'
;



Page 2 of 4   « previous page   next page »

About Reed Shilts
In addition to being one of the "old timer" PowerBuilder kernel programmers, Reed is the development lead for PocketBuilder and currently drafted in PowerBuilder 11 & 12 work. Reed is also a regular (and vocal) member of the Boston PocketPC user's group. He often bring his latest hardware and sometimes offer PocketBuilder as a door prize - even though this is hosted by Microsoft! If you live in the Boston area, stop on by: http://www.bostonpocketpc.com

LATEST iPHONE STORIES
Android Won't Be Home for Xmas: WSJ
Sprint may drop out to do a 4G phone and China Mobile is having trouble translating Android into Chinese. And handset makers' efforts to customize the widgetry for carriers is taking longer than expected; there seems to be some difficulty integrating carrier-branded service into
iPhone 3G Only Looks Cheaper
Apple has a history of carriage trade pricing, and, although such practices cost it the PC market - while imbuing it with a certain cachet - the policy was enshrined in the original iPhone. For the first time Monday Apple sorta kinda changed its tune, so to speak, and started cha
Virtualization, Firefox and Vista
John Gage, Sun employee number 5 and its chief researcher, head of its science office - the guy who coined the Sun tag line 'The Network is the Computer' - a seemingly nonsense slogan Sun used to wish it could shake - has finally left the building after 25 years. He's going to Kl
iPhone 3G and the Things I will Need From My New iPhone
I stood in line at an AT&T store last summer the day the iPhone first became publicly available. I thought the local Apple store would be mobbed. Four hours later the AT&T store was out of phones. With not much hope, I drove to the Apple store. Within 15 minutes I was inside buyi
iPhone 3G: Few Surprises, But Now It Gets Really Interesting
Fundamentally, the '3G iPhone' is little different from its forebear it offers nothing that many other devices can not offer, but, boy, is it better at selling itself! However, now that it is to be available at lower cost in so many more countries, the iPhone is playing on a far
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING IPHONE NEWS
Lextech Launches iPhone Focused Sister Company
Chicago area systems engineering company Lextech Global Services (Lextech) announces the lau