| By Reed Shilts | Article Rating: |
|
| April 16, 2008 08:45 AM EDT | Reads: |
7,546 |
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
a. Find a Web Service to exploit
b. Write a pair of stored procedures
c. Create a DataWindow to call the stored procedure
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 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)'
;
Published April 16, 2008 Reads 7,546
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By 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
- Why SOA Needs Cloud Computing - Part 1
- Cloud Expo and The End of Tech Recession
- The Transition to Cloud Computing: What Does It Mean For You?
- A Rules Engine Built in PowerBuilder
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- How PowerBuilder Got Its Groove Back
- The Cloud Has Cross-Border Ambitions
- Ulitzer Names The World's 30 Most Influential Virtualization Bloggers
- Ulitzer Named "New Media" Partner of Greatly Anticipated iStrategy Event in Berlin
- Risks and Enterprise Mobility?
- Steps for Success in Enterprise Mobility?
- Are Mobile Luddites Resisting Mobility?
- The Difference Between Web Hosting and Cloud Computing
- Sybase CTO to Speak at 4th International Cloud Computing Expo
- Why SOA Needs Cloud Computing - Part 1
- Cloud Expo and The End of Tech Recession
- The Transition to Cloud Computing: What Does It Mean For You?
- Five Reasons to Choose a Private Cloud
- Seeding The Cloud: The Future of Data Management
- The Threat Behind the Firewall
- Economy Drives Adoption of Virtual Lab Technology
- Tips for Efficient PaaS Application Design
- A Rules Engine Built in PowerBuilder
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- Where Are RIA Technologies Headed in 2008?
- PowerBuilder History - How Did It Evolve?
- The Top 250 Players in the Cloud Computing Ecosystem
- Custom Common Dialogs Using SetWindowsHookEx
- DDDW Tips and Tricks
- OLE - Extending the Capabilities of PowerBuilder
- DataWindow.NET How To: Data Entry Form
- Book Excerpt: Sybase Adaptive Server Anywhere
- Sybase ASE 12.5 Performance and Tuning
- Working with SOA & Web Services in PowerBuilder
- Office 2003 Toolbar: A New Look For Your Old PowerBuilder App
- Dynamically Creating DataWindow Objects































