PB 9 Web Service Client 66 - 2 ©2003 Sybase, Inc. and its subsidiaries. All rights reserved. n John Strano n PowerBuilder Evangelist n

Slides:



Advertisements
Similar presentations
1 WSDL: Web Service Description Language Gary Sharp Mike Breakiron.
Advertisements

Siebel Web Services Siebel Web Services March, From
Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell.
Web Services Bruce Armstrong TeamSybase
Intesar G Ali IT DepartmentPalestinian Land Authority Web services Prepared by: Intesar Ali IT Department PLA August 2010.
31242/32549 Advanced Internet Programming Advanced Java Programming
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
General introduction to Web services and an implementation example
SOAP.
SOAP : Simple Object Access Protocol
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
RPC Robert Grimm New York University Remote Procedure Calls.
XML in the real world (2) SOAP. What is SOAP? ► SOAP stands for Simple Object Access Protocol ► SOAP is a communication protocol ► SOAP is for communication.
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
Snejina Lazarova Senior QA Engineer, Team Lead CRMTeam Dimo Mitev Senior QA Engineer, Team Lead SystemIntegrationTeam Telerik QA Academy SOAP-based Web.
Scale Up Access to your 4GL Application using Web Services
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 42 Web Services.
Slide 1 EE557: Server-Side Development Lecturer: David Molloy Room: XG19 Mondays 10am-1pm Notes:
Peoplesoft: Building and Consuming Web Services
WSDL Web Services Description Language Neet Wadhwani University of Colorado 3 rd October, 2001.
TP2653 Adv Web Programming SOAP and WSDL. SOAP Simple Object Access Protocol – Lightweight XML-based messaging protocol – A protocol for accessing a Web.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
C Copyright © 2009, Oracle. All rights reserved. Appendix C: Service-Oriented Architectures.
SSC2: Web Services. Web Services Web Services offer interoperability using the web Web Services provide information on the operations they can perform.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II.
I hereby declare that this document is based on my project experience. To the best of my knowledge, this document does not contain any material that infringes.
1 Core Web Services Standards. 2 (Simplified) Web Service Architecture Registry 1. Service Registers PUBLISH 3. Client calls Service BIND 2. Client Request.
Module 14: WCF Send Adapters. Overview Lesson 1: Introduction to WCF Send Adapters Lesson 2: Consuming a Web Service Lesson 3: Consuming Services from.
1 HKU CSIS DB Seminar: HKU CSIS DB Seminar: Web Services Oriented Data Processing and Integration Speaker: Eric Lo.
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Web Services Description Language (WSDL) Jason Glenn CDA 5937 Process Coordination in Service and Computational Grids September 30, 2002.
WEB SERVICE DESCRIPTION LANGUAGE ( WSDL) -SIVA SAGAR TELLA.
Web Server Administration Web Services XML SOAP. Overview What are web services and what do they do? What is XML? What is SOAP? How are they all connected?
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Web Services based e-Commerce System Sandy Liu Jodrey School of Computer Science Acadia University July, 2002.
1 Web Service Description Language (WSDL) 大葉大學資工系.
Introduction to Web Services Instructor: Dr. M. Anwar Hossain.
XML and Web Services (II/2546)
1 Engineering Web Based Legacy Systems By Kanchana Eramudugoda Distributed Computing – CS843.
S imple O bject A ccess P rotocol Karthikeyan Chandrasekaran & Nandakumar Padmanabhan.
Kemal Baykal Rasim Ismayilov
S O A P ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie, Brandon, George, Hojun.
Week Six : Writing Web Services Aims: Creating and Consuming student’s first Web Services Learning Outcomes: Familiarity with VS.NET for creating and consuming.
Chapter 7: Creating and Consuming XML Web Services Understanding XML Web Services Creating XML Web Services Deploying and Discovering XML Web Services.
ODS – Introduction to Web Services and BPEL Vakgroep Informatietechnologie Web Services & BPEL Design of Distributed Software.
Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services.
Web services. Introduction to WSDL. February 23, 2006.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Lecture VI: SOAP-based Web Service CS 4593 Cloud-Oriented Big Data and Software Engineering.
DEVELOPING WEB SERVICES WITH JAVA DESIGN WEB SERVICE ENDPOINT.
SOAP, Web Service, WSDL Week 14 Web site:
SE 548 Process Modelling WEB SERVICE ORCHESTRATION AND COMPOSITION ÖZLEM BİLGİÇ.
Beginning 자바 웹 서비스 웹 서비스 호출 Meilan JIANG Cyber infrastructure Research Laboratory Department of Advanced Technology.
The Java API for XML-Based Web Services. A Web Service example in Java SOAP-awareServlet (e.g. Apache Axis2) SOAP-awareServlet Any class processing the.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
Sabri Kızanlık Ural Emekçi
Chapter 5 Remote Procedure Call
WEB SERVICES.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Writing simple Java Web Services using Eclipse
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
WebServices Using JAX-RPC
Introduction to Web Services
Distributed System using Web Services
Distributed System using Web Services
Presentation transcript:

PB 9 Web Service Client

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. n John Strano n PowerBuilder Evangelist n

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Module Objectives n Give an overview on how Web Services client works in PowerBuilder 9.0 n Provide the information on how to generate proxies for the Web Services n Provide the information on how to use Web Services in PowerScript n Cover installation/configuration/troubleshooting information

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Skills Prerequisites n Experience with PowerBuilder 8.0 n Basic knowledge of the standards of Web Services l WSDL(Web Service Description Language) l XML and XML schema l SOAP (Simple Object Access Protocol) n If you want to produce Web Service from PB component on EAServer, you need to get familiar to EAServer 4.2 Web Service Package, please refer to EAServer documents.

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Definitions -- WSDL n WSDL -- Web Services Description Language l Defined the rule of describing the underneath components in XML format. l Must include: s Service name and ports(endpoints) s Binding information -- transport protocol (soap, http get, http post, or others) s PortType -- define all operations in this service s Messages -- data exchanged between client and server side such as parameters of functions, return value. s Namespaces and Schema -- refer to well known data types or define new data types such as structure, array.

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Definitions -- XML Schema n XML Schema l The rule of defining new data types and complex types such as array, structure, enumeration, and composed data types. l There are several standard schemas, which have already defined the well known data types such as string, integer, etc. s W3C schema 1999 s W3C schema 2000/10 s W3C schema 2001 s SOAP schema

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Definitions -- SOAP n SOAP -- Simple Object Access Protocol l A lightweight XML-based protocol l All messages exchanged between SOAP client and server are in XML format. And SOAP can use HTTP, FTP, SMTP, and other transport protocols. l It is platform and language independent l Use Envelop/Header/Body to represent the messages.

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Definitions -- Web Service Proxy n Web Service Proxy In PowerBuilder 9 l A PB object to represent the remote Web Service l It includes: s All functions exposed by Web Services and their signature s Complex data types used by the Web Services s Namespaces and schemas used by the Web Services s Default Endpoint

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Module Map n Introduction to PB Web Service Client l How Web Services work l PB Web Service client internals l Standards used in PB Web Service Client l Strong/Weak Points of PB Web Service Client n Create Web Services proxy in PowerBuilder 9 n Using Web Services in PowerScript n Where to get help

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Introduction to Web Service Client n How Web Services work 5. Create WS proxy from WSDL 6. Use proxy to invoke Web Services Web service Proxy 1. Create Server Side components 2. Wrap to WS 3. Generate WSDL 4. Publish Web service Stub Invoke Data PowerScript NVO or Other components WSDL Files Client Side Server Side 5 6

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. PB Web Service Client Internals n Web Service Wizard l Collect information such as the location of WSDL, service, ports, etc. n Proxy Generator l Create WS proxy based on the information above n Universal SOAP Client l Instantiate WS proxy, communicate to WS server n Error Handling l Capture exception/error Web Service Wizard Proxy Generator Universal Soap Client Exception Processor Generator Data Store PB Proxy Info Proxy Instance WSDL file PowerScript PB 9

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Sample -- How to invoke WS SoapConnection conn // Define SoapConnection (Universal Soap Client) demo_ieuroport proxy_obj // Define proxy long rVal real amount conn = create SoapConnection//Instantiated soap client rVal = Conn.CreateInstance(proxy_obj, " demo_ieuroport") // // Create proxy object try amount = proxy_obj.toeuro(100, “DEM”) // Invoke service // use the amount …. catch ( SoapException e ) messagebox (“Error”, “Cannot invoke WS”)// error handling end try destroy conn

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Standards Used In PB Web Service Client n Standards supported in PB 9 l XML Schema 1.1 l WSDL 1.1 l SOAP 1.1 over HTTP n Standards not supported in PB9 l UDDI

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Good/Weak points of PB WS Client n Strong Points l Generic s Conform to W3C standards s Can make use of any Web services no matter the services are created in PowerBuilder,.Net, Java, or other third party tools l Easy to use s There is a Wizard to help user generate proxy s Good error handling system n Weak Points l Only support SOAP messaging; don’t support HTTP Get/Post l Don’t support UDDI l Not support for all XML data types

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Module Map n Introduction to PB Web Service Client n Create Web Services proxy in PowerBuilder 9 l Using Web Service Proxy Wizard to collect information s Using Web Service Proxy Wizard s Data types supported s Data types not supported s Schemas supported s Troubleshooting l Using Proxy Generator to create Web Service proxy n Using Web Services in PowerScript n Where to get help

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Using Web Service Proxy Wizard n Purpose of Web Service Proxy Wizard l Collects information such as location of WSDL file, service, port(s), proxy name, and target library l Create a proxy generator object in PowerBuilder library n To Start The Wizard l Select the Web Service Proxy Wizard icon from Project page of the New dialog box n Information collected includes: l The location of the WSDL file, it could be a local file or an URL. l Service -- Only one service can be selected in this wizard. l Port(s) -- One service may be exposed to several ports. Only SOAP ports can be used in PB. l Proxy name -- Give a prefix, which will be added to the default proxy name to avoid the name conflict. Default proxy name is the port name. l Library name -- Where to deploy the proxy. l Project name -- A project to store all these information.

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Using Web Service Proxy Wizard n Demo

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Primitive Data Types Supported n XML Primitive Data Types Supported and PB Types Mapping XML TypePB Type boolean byte unsignedByte short unsignedShort int unsignedInt long unsignedLong integer boolean int (-128~127) uint (0~255) int uint long ulong longlong longlong (*) longlong XML TypePB Type double string date time datetime duration base64Binary hexBinary base64 double string date time datetime double blob decimal floatreal * 1~

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. l Enumeration String Composed Data Types Supported n XML Composed Data Types Supported and Mapping XML TypePB Type Its base type1. enumeration n Examples

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. l XML Complex Type(structure) $PBExportHeader$ s__soapstruct.srs $PBExportComments$Proxy imported from Web Service via Web Service Proxy generator. global type s__SOAPStruct from structure string varString long varInt real varFloat end type Composed Data Types Supported (con’t) n XML Composed Data Types Supported and Mapping XML TypePB Type 2. complex type (structure))structure n Examples

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. l 1-dimension array “int []” Composed Data Types Supported (con’t) n XML Composed Data Types Supported and Mapping XML TypePB Type array3. 1-dim unbounded array n Examples

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Data Types Not Supported n PB 9 doesn’t support: l Any other primitive data types except for those included in previous pages l Multi-dimension array

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Schemes Supported n PB 9 supports following schemas: l W3C XML schema 1999 l W3C XML schema 2000/10 l W3C XML schema 2001 l SOAP schema n PB9 doesn’t support: l Private schemas l Messages use different schema from the complex data type definition

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Troubleshooting & Output n Error Messages l The Wizards will give error message when fail to parse the WSDL file n Output l If everything went well, the proxy generator project will be create by Wizard

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Module Map n Introduction to PB Web Service Client n Create Web Services proxy in PowerBuilder 9 l Using Web Service Proxy Wizard to collect information l Using Proxy Generator to create Web Service proxy s Using Proxy Generator s Change properties s Change Service/Ports s Generate proxy n Using Web Services in PowerScript n Where to get help

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Using Proxy Generator n Purpose of Web Service Proxy Generator l Advanced user can modify any information in Generator project, which was collected by Wizard l Advanced user can create a Generator project form scratch. l Create Web Service proxy and structure if needed n Proxy Generator Mini-Toolbar Save the Project Close project Display & change service/ports 2 Change properties 1 Generate proxy 3

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Change Properties n Change properties -- General n Deployment PBL -- Where to put your proxy in when generate n If the same proxy exists, do you want to clear the old one? n Need to be confirmed explicit?

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Change Properties (con’t) n Change properties -- Web Service n WSDL Location -- Where is the WSDL file. Could be a local file or URL.

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Change Service/Ports n Display & change service/ports

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Generate Proxy n Generate proxy

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Module Map n Introduction to PB Web Service Client n Create Web Services proxy in PowerBuilder 9 n Using Web Services in PowerScript l Universal SOAP Client in PB 9 s SoapConnection Class s SoapException Class l Using SOAP Client & WS Proxy s Sample code l Troubleshooting n Where to get help

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Universal SOAP Client n Soap Client l Packaged into PBSoapClient90.pbd & PBSoapClient90.Dll l PBSoapClient90.Dll MUST be deployed with PB application n New Classes in PB 9 to support SOAP Messaging l SoapConnection class s Used to instantiated the proxy object and populated SOAP options l SoapException class s Used to capture runtime errors/exceptions when calling Web Services

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. SoapConnection Class n Functions in SoapConnection class l CreateInstance --Instantiate WS proxy l SetOptions -- Set options such as log file, userID, password n CreateInstance l CreateInstance(proxyObj, ProxyType) s Create a proxy object using default endpoint l CreateInstance(proxyObj, ProxyType, endpoint) s Create a proxy object using specified endpoint n SetOptions l SetOptions(optionString) l Format of optionString is Name/value pairs. For example: s “SoapLog=~”C:\kt.log~”, userID=~”sa”, Password=~”sybase~”” s “SoapLog=‘C:\kt.log’, userID=‘sa’, Password=‘sybase’”

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. SoapException Class n SoapException Class l SoapException inherited from PowerBuilder RuntimeError object l Errors that occur in the execution of a method of Web service are converted to SoapException objects and thrown to the calling script n In PowerScript l Use try-catch block to capture the exceptions l Unhandled exception will be propagate to PB and cause SystemError event to be executed

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Module Map n Introduction to PB Web Service Client n Create Web Services proxy in PowerBuilder 9 n Using Web Services in PowerScript l Universal SOAP Client in PB 9 s SoapConnection Class s SoapException Class l Using SOAP Client & WS Proxy s Sample code l Troubleshooting n Where to get help

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Using SOAP Client & WS Proxy n Procedure l Include PBSoapClient90.pbd to your PB target l Create an instance of SoapConnection l Set options for the Connection l Create an instance of WS proxy using SoapConnection l Call the function of the proxy to invoke Web Service

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Sample SoapConnection conn // Define SoapConnection demo_ieuroport proxy_obj // Define proxy long rVal real amount conn = create SoapConnection//Instantiated soap connection conn.SetOptions(“SoapLog=‘c:\kt.log’, userID=‘sa’,Password=‘sybase’”) // Set options rVal = Conn.CreateInstance(proxy_obj, " demo_ieuroport") // // Create proxy object try amount = proxy_obj.toeuro(100, “DEM”) // Invoke service // use the amount …. catch ( SoapException e ) messagebox (“Error”, “Cannot invoke WS”)// error handling end try destroy conn

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Module Map n Introduction to PB Web Service Client n Create Web Services proxy in PowerBuilder 9 n Using Web Services in PowerScript l Universal SOAP Client in PB 9 s SoapConnection Class s SoapException Class l Using SOAP Client & WS Proxy s Sample code l Troubleshooting n Where to get help

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Troubleshooting n Use SetOptions to set log file, which will capture the raw SOAP data exchange between client and server

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Module Map n Introduction to PB Web Service Client n Create Web Services proxy in PowerBuilder 9 n Using Web Services in PowerScript n Where to get help

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Where to go for help n For Wizard, Generator, Universal Soap Client l PB 9 manual and online help l PB 9 Functional Specification n For Standards l XML Schema 1.1 s l WSDL 1.1 s WSDL s Binding l SOAP 1.1 s

©2003 Sybase, Inc. and its subsidiaries. All rights reserved. Q & A n John Strano n PowerBuilder Evangelist n