Title: Arial 28pt.

Download Report

Transcript Title: Arial 28pt.

PowerBuilder 10 WebServices
Berndt Hamboeck
[email protected]
Pocket PowerBuilder + Easerver + WebServices
Pocket PowerBuilder
SOAP / HTTP(S)
EAServer + WebServices
+ PB Component
Mp3s
Agenda






Why WebServices and what is and is not SOAP?
Web Services architecture
EAServer Jakarta Axis
PocketSoap + Pocket PowerBuilder
Summary
Example using




Sybase EAServer + Axis
PowerBuilder 10
PocketSoap
Pocket PowerBuilder
Objectives



Understanding fundamental concepts of SOAP
Being able to interpret and construct SOAP messages
Deploy and use a WebService on EAServer



Use PowerBuilder 10 component as a WebService
Use a PowerBuilder client to call the WebService
Use a Pocket PowerBuilder to call the WebService
Information Technology The Trend








Rush to become Internet enabled is (more or less) over
Led to applications that now need to be integrated
Numerous, incompatible, proprietary point solutions
Budgets are (still) tight
Smaller, incremental projects being started
Standards based, Extensible
Integrate with Larger Enterprise
Service oriented architecture is key to achieve ROI goals
The killer application - Integration






Set of industry standards for distributed computing
Service-oriented architectures enables integration
Web services is the driving technology
Unanimous industry support
Effective
Simple
What is SOAP?



Simple Object Access Protocol
Wire protocol similar to IIOP for CORBA
XML is used for data encoding


text based protocol vs. binary protocol
Supports XML-based RPC (Remote Procedure Call)
What SOAP is NOT?

Not a component model


Not a programming language


So it will not replace objects and components, i.e. EJB, COM, CORBA,
PowerBuilder
So it will not replace Java, PowerBuilder
Not a solution for all

So it will not replace other distributed computing technologies such as RMI
What are the Benefits?



SOAP can easily traverse firewalls
SOAP data is structured using XML
SOAP can use different transport protocols



HTTP, SMTP, JMS
SOAP is lightweight as a protocol
Many vendors support it
Industry support
Over 30 implementations out there and strong
companies supporting SOAP
 Sybase
 IBM/Lotus
 Intel
 HP
 Microsoft
 SUN
 And many more………
Basic Web Service Architecture
WSDL
WSDL
WSDL
Industry Repository
description
UDDI
Web Services Client
execution
SOAP / HTTP(S)
EAServer - SOAP enabled
firewall
Back-end Systems
discovery
What does SOAP look like?
XML document that consists of
 Envelope


Header


Mandatory,
Namespaces, Encoding information
Optional
Can be handled by intermediaries
Body

Mandatory
Handled only by ultimate receiver
SOAP message types

Request


Response


Usually send to port 80
Response from SOAP server
Fault

‘Something’ is wrong…..
Message type - Request

Request from a client

PowerBuilder to an EAServer WebService
Parameter passing - General
Type mapping pattern

serialization and deserialization
Done through type mappings

The datatype must belong to a supported component type
for it to be available as a Web service.


Predefined type mappings
Define own type mappings
Datatype mappings
JAX-RPC defined data types.
See the JAX-RPC download site at
http://java.sun.com/xml/downloads/jaxrpc.html
• Java with IDL datatypes –uses the datatype mappings that are
specified by the CORBA document,
IDL to Java Language Mapping Specification
• CORBA C++ with IDL datatypes –use the OMG standard for
translating CORBA IDL to C++, more specifically, refer to
C++ Language Mapping Specification

You can download this document from the OMG Web site at
http://www.omg.org.
Datatype mappings
Message type - Response

Response generated by Easerver Webservice
View Request/Response - TCP Tunnel GUI
See the SOAP messages which are travelling back and forth
between the client and the server

java org.apache.soap.util.net.TcpTunnelGui
listenport tunnelhost tunnelport
View Request/Response - TCP Tunnel GUI
Download from http://www.pocketsoap.com
Standalone application, Executable
If something is wrong
SOAP Fault
 Used to carry error and/or status information
 Four sub-elements




faultcode
faultstring
failtactor
detail
Security concerns?
One great thing about SOAP is that by using HTTP you can send
requests right through the firewall!”
However one bad thing about SOAP is that by using HTTP you can
send requests right through the firewall!
Security concerns? Bring some security in!

HTTP Authentication




Header filtering (on SOAPAction)
Application Level Restriction
SOAP Security extensions


Basic, SSL
Digital signature, XML signature, XML encryption
Only allow access to Web Service registered components
Disadvantages of SOAP
XML document that consists of

Different toolkits out there

Security mechanisms are immature

No guaranteed message delivery

No publish and subscribe
Summary

SOAP = XML + HTTP (eventually other protocols)

Cross platform

Language independent

Works with firewalls

Apache Axis is one toolkit (more than 30 out there)

By using EAServer:
PB, EJB, Corba, COM components as Web Services
SOAP Demo
We want to listen to German music!!




Develop Webservice (PowerBuilder or Java)
Deploy to EAServer and publish as WebService
by using the new stuff in PowerBuilder 10
Create a PowerBuilder client
Create a Pocket PowerBuilder client
Code will be posted to PBUGG.DE shortly after PBUG
Step 1 The WebService

Create a new EAServer component
Expose as Webservice

New feature in PowerBuilder 10

Implement WebService and deploy

Declare local external functions

Implement functions

String of_getlist() or int of_getlist(ref String [])
String of_play(String as_title)
of_stop()

String of_status()


Deploy WebService

Deploy WebService


Eclipse still works!
Look if it is there
Build WebService client

Look at WSDL (and save it local)
Build WebService client


New Target
Get WebService proxy


User WSDL URL, or
Local WSDL-file
Build WebService client

Add Soap objects to your
Library Search Path
%Sybase%\Shared\PowerBuilder
 pbsoapclient100.pbd;
-> must be deployed with your Application


Implement client



Use SoapConnection object
Use proxy to call WebService
Catch SoapException
Run your WebService client

Simply run it and





Get the MP3 file list
Choose a file
Play it
Get the Status
Stop it
String of_getFileList(ref String [])
does not work in beta2 !!
Pocket PowerBuilder

Cool!






PowerBuilder for Windows CE devices
Includes DataWindow/DataStores
Connects to ASA
Application runs on Desktop and on device
No Easerver support
No WebServices support
-> PocketSoap
PocketSoap

Is an Open Source SOAP client COM component for the
Windows family, originally targeted at PocketPC.
Also a Win32 version that works on Windows
95/98/Me/NT4/2000/XP
Desgined for interop, and is regularly tested with over 30 of
the leading SOAP tools
Works fine with EAServer
Free download on http://www.pocketsoap.com

Interface for Pocket PowerBuilder on Codexchange






external DLL, which provides a simple access to the PocketSoap package
Deploy dll to \Windows directory on your PocketPC !!
PocketSoap

n_pocketsoap
PPB + PocketSoap and Play
PPB + PocketSoap and Play
PowerBuilder 10 WebServices
Berndt Hamboeck
[email protected]