Title: Web Services and 'Net
1(No Transcript)
2Web Services and .Net
- Creating and Consuming Web Services with
PowerBuilder 9.0
3What is a web service?
- Use of Internet technologies to allow distributed
software components to talk to each other - Available over Internet or private intranet
networks - Uses a standardized XML messaging system
- Self-describing via common XML grammar
- Discoverable via a simple find mechanism
- Not tied to any OS and languages
- Separate Web service description from
implementation
.NET
MQSeries
J2EE
Web Services
Packaged Applications
CORBA
Mainframe
Custom Applications
4Web Services
- Web Services are
- Platform independent
- Language independent
- Based on XML
5Web Services Description Language (WSDL)
- Defines the rules of describing the underneath
components in XML format - Must include
- Service name and ports(endpoints)
- Binding information -- transport protocol (soap,
http get, http post, or others) - PortType -- define all operations in this service
- Messages -- data exchanged between client and
server side such as parameters of functions,
return value - Namespaces and Schema -- refer to well known data
types or define new data types such as structure,
array
6Definitions -- XML Schema
- XML Schema
- The rule of defining new data types and complex
types such as array, structure, enumeration, and
composed data types - There are several standard schemas, which have
already defined the well known data types such as
string, integer, etc. - W3C schema 1999
- W3C schema 2000/10
- W3C schema 2001
- SOAP schema
7Simple Object Access Protocol (SOAP)
- A lightweight XML-based protocol
- All messages exchanged between SOAP client and
server are in XML format - SOAP can use HTTP, FTP, SMTP, and other transport
protocols - SOAP is platform and language independent
- Uses Envelop/Header/Body to represent the
messages
8Web Service Proxy
- Web Service Proxy In PowerBuilder 9
- A PB object to represent the remote Web Service,
it includes - All functions exposed by Web Services and their
signature - Complex data types used by the Web Services
- Namespaces and schemas used by the Web Services
- Default Endpoint
9Introduction to Web Service Client
Client Side
Server Side
1. Create Server Side components 2. Wrap to
WS 3. Generate WSDL 4. Publish
5. Create WS proxy from WSDL 6. Use proxy to
invoke Web Services
3
WSDL Files
PowerScript
NVO or Other components
5
2
1
6
Invoke
Web service Proxy
Web service Stub
Data
10PB Web Service Client Internals
- Web Service Wizard
- Collect information such as the location of WSDL,
service, ports, etc. - Proxy Generator
- Create WS proxy based on the information above
- Universal SOAP Client
- Instantiate WS proxy, communicate to WS server
- Error Handling
- Capture exception/error
Info
Web Service Wizard
Generator Data Store
WSDL file
Proxy Generator
PB Proxy
PowerScript
Universal Soap Client
Proxy Instance
Exception Processor
PowerBuilder 9
11Web Services Support
- PowerBuilder 9.0 supports access to web services
using SOAP through HTTP - Allows developers to integrate web services into
PowerBuilder applications quickly - Hides much of the complexity of
- WSDL
- XML grammar
- SOAP development
12Standards Used In PB Web Service Client
- Standards supported in PB 9
- XML Schema 1.1
- WSDL 1.1
- SOAP 1.1 over HTTP
13Web Services Support
- High level process
- Create web service proxy
- Import SOAP connection class
- Use SOAP connection and proxy in PowerScript
14Using Web Service Proxy Wizard
- Purpose of Web Service Proxy Wizard
- Collects information such as location of WSDL
file, service, port(s), proxy name, and target
library - Create a proxy generator object in PowerBuilder
library
15Using Web Service Proxy Wizard
- Information collected includes
- The location of the WSDL file, it could be a
local file or URL - Service -- Only one service can be selected in
this wizard - Port(s) -- One service may be exposed to several
ports Only SOAP ports can be used in PB
16Using Web Service Proxy Wizard
- Information collected includes (continued)
- Proxy name You can provide a prefix which will
be added to the default proxy name to avoid
naming conflicts - Default proxy name is the port name
- Library name -- Where to deploy the proxy
- Project name -- A project to store all these
information
17Universal SOAP Client
- Soap Client
- Packaged into PBSoapClient90.pbd
PBSoapClient90.DLL -
- PBSoapClient90.DLL MUST be deployed with PB
application - New Classes in PB 9 to support SOAP Messaging
- SoapConnection class
- Used to instantiated the proxy object and
populated SOAP options - SoapException class
- Used to capture runtime errors/exceptions when
calling Web Services
18SoapConnection Class
- Functions in SoapConnection class
- CreateInstance --Instantiate WS proxy
- SetOptions -- Set options such as log file,
userID, password
19SoapConnection Class
- CreateInstance
- CreateInstance(proxyObj, ProxyType)
- Create a proxy object using default endpoint
- CreateInstance(proxyObj, ProxyType, endpoint)
- Create a proxy object using specified endpoint
- SetOptions
- SetOptions(optionString)
- Format of optionString is Name/value pairs
- For example
- SoapLogC\kt.log, userIDsa,
Passwordsybase - SoapLogC\kt.log, userIDsa,
Passwordsybase
20SoapException Class
- SoapException Class
- SoapException inherited from PowerBuilder
RuntimeError object - Errors that occur in the execution of a method of
Web service are converted to SoapException
objects and thrown to the calling script - In PowerScript
- Use try-catch block to capture the exceptions
- Unhandled exception will be propagate to PB and
cause SystemError event to be executed
21Troubleshooting
- Use SetOptions to set log file, which will
capture the raw SOAP data exchange between client
and server
22Web Services and .Net
- Seeing the Technology in Action
23Web Services and .Net
- Creating Web Services with PowerBuilder and
EAServer
24Deploying a PowerBuilder NVO as a Web Service
- High level process
- Deploy NVO to EAServer
- Generate Java Stubs using Jaguar Manager
- Create Web Service Using the Web Services Toolkit
25Web Services and .Net
- Seeing the Technology in Action
26(No Transcript)