350 likes | 700 Views
PowerBuilder 11: The Web Service Source DataWindow. John Strano Technology Evangelist Sybase, Inc. john.s.strano@sybase.com. PowerBuilder 11 Overview (presented Nov. 20, 2007) Jim O’Neil Systems Consultant. .NET Windows Forms And Interoperability Dec. 4, 2007 Jim O’Neil
E N D
PowerBuilder 11:The Web Service Source DataWindow John Strano Technology Evangelist Sybase, Inc. john.s.strano@sybase.com
PowerBuilder 11 Overview (presented Nov. 20, 2007) Jim O’Neil Systems Consultant .NET Windows Forms And Interoperability Dec. 4, 2007 Jim O’Neil Systems Consultant .NET Assemblies (presented Nov. 13, 2007) Jim O’NeilSystems Consultant Web ServiceDataWindow Feb. 5, 2008 John Strano Technology Evangelist PowerBuilder 11 .NET Deployment Web Casts .NET Web Forms Dec. 11, 2007 David Fish Engineering Evangelist .NET Web Services Jan. 29, 2008 David Fish Engineering Evangelist .NET Smart Client Jan. 15, 2008 John Strano Technology Evangelist
Agenda • PowerBuilder Roadmap • Web Service Source DataWindow Overview and Demo
PowerBuilder Roadmap • Version 11 released in June 2007 • 11.1 Maintenance Release in November 2007 • Delivers on third-phase of PowerBuilder’s .NET initiative
2008 PowerBuilder 11.2 2008 PowerBuilder 11.5 2009 PowerBuilder 12 • AJAX support for Web Forms Applications • EAServer .NET Client Support • Enhancement requests • Core .NET enhancements • DataWindow enhancements for Win32 and .NET • Updated database support • Enhancement requests • .NET in IDE • WPF support at design- and run-time • Fully managed code at deployment • PowerScript Language Enhancements Language Independence Application Connectivity Multiple Platform Support Power And Performance
The Web Services DataWindow • .NET Targets are not required! • The Web Service DataWindow is for Win32 deployments as well. • You don’t need to know Web Service implementation details • The DataWindow and PowerBuilder • Make it easy to use Web Services in a productive way • The DataWindow now supports consuming Web Services as a data source • Only using the .NET Web Services support. • Does not utilize EasySOAP
The Web Services DataWindow • What the Web Service DataWindow is intended for • Access to database data across a network without the need for DB client software on the client • Reduces the client footprint • Reduces client maintenance • Eliminates the need for a persistent database connection • Allows for the utilization of unstructured data from non-relational sources • Web Services can federate data from disparate sources and disparate types of sources…and can be presented by the DataWindow
PowerBuilder .NET Smart Client Support • Occasionally connected • PowerBuilder with MobiLink • Always up-to-date applications • PowerBuilder’s “Intelligent Updater” • Maximize performance using client resources • PowerBuilder applications deployed as Windows Form (Rich Client) • Communicate utilizing Web Services • PowerBuilder’s Web Service DataWindow • Utilize network resources • PowerBuilder’s Web Service DataWindow • PowerBuilder’s “Intelligent Update” • PowerBuilder with MobiLink
The Web Services DataWindow • Supported Web Service “results” • Simple data types • System.Int32, System.String, System.DateTime, System.Decimal • Single row, single column • An array of simple types • Multiple rows with a single column • A structure made up of simple types • Single row with multiple columns • An array of structures made of simple types • The familiar rows and columns of a DataWindow.
The Web Services DataWindow • The Web Service DataWindow is not intended for access to all Web Services • Some services return proprietary data types • .NET-implemented services can return a serialized ADO DataSet • Some services return data structures too complex for the DataWindow • e.g: Amazon returns multiple levels of nested structures • Cannot be readily represented as rows and columns • These may be supported in the future
The Web Services DataWindow • Let’s create a PowerBuilder Web Service • We need structure definitions to match the database results • For example, the employee table with a few columns selected.
The Web Services DataWindow • (cont’d) Let’s create a PowerBuilder NVO • Define a method to retrieve the data
The Web Services DataWindow • Let’s create a Web Service DataWindow
The Web Services DataWindow • What have we just created? • A DataWindow object, stored in the PBL as is normal • With some additional Web Service properties • WSDL • .NET Assembly designation • Namespace • Classname • Parameter specifications • *** Web Service input parameters are automatically defined as retrieval arguments • …cont’d…
The Web Services DataWindow • What have we just created? • A .NET assembly, custom generated for this Web Service. • The .NET assembly does the heavy lifting, communicating with the .NET Web Service support. • We use reflection to figure out the methods and types contained in the assembly
The Web Services DataWindow Runtime Web Service The DataWindow Engine PowerBuilder Web Service Support The Generated Assembly The .NET Framework
The Web Services DataWindow • Deployed files • In addition to PBDWE110.DLL (PBDWM110.DLL for .NET deployments) • Sybase.PowerBuilder.WebService.Runtime • Sybase.PowerBuilder.WebService.RuntimeRemoteLoader • These do the communicating between the unmanaged code and the managed assembly created when the DataWindow was built • The generated .NET Assembly • .NET 2.0 Framework …Cont’d…
The Web Services DataWindow • Deployed files …Cont’d… • The required PowerBuilder runtime DLLs for Web Service client applications. • See “Deploying Applications and Components” in Application Techniques. • http://infocenter.sybase.com/help/topic/com.sybase.dc37774_1100/html/apptech/CFHBBAEA.htm • Examine the documentation for the “Runtime Packager”
Run time Web Service Retrieval • Retrieve() works just like it does now • You can specify retrieval arguments as parameters as you always have • <DWC>.Retrieve ( param1, param2, …)
Run time Web Service Update • Of course it’s still just a single line of code. • <DWC>.Update ()
Transaction Management • What about updates? • It’s not like a database! • Arguably, there is no single transaction specification (WS-Transaction) for Web Services • Microsoft/BEA/IBM Alliance…and Everyone Else • Specification-contentious Vendors • If there are multiple standards…is there a standard? • How would you perform a Rollback for a Web Service from the client? • Remediation? • NOT the purview of the Web Service DataWindow, but bears thought from the service implementer • Remember, Web services are: STATELESS!
The Web Services DataWindow • Defining Web Service updates
The Web Services DataWindow • Overrides • The WSConnection object allows Web Service overrides (optional) • Endpoint • User ID • Password • Proxy server • Host name • User ID • Password • Port • Authentication mode • Timeout • Windows integrated authentication
Using the WSConnection Object • Some Web services support or require • User ID • Password • Other session-related properties like firewall settings • Example: Using an instance of the WSConnection object utilizing a Web Service using the SetWSObject method… int ii_return wsconnection ws_1 ws_1 = create wsconnection ws_1.username = "johndoe" ws_1.password = "mypassword" ws_1.endpoint = "myendpoint" ws_1.authenticationmode = "basic" ws_1.usewindowsintegratedauthentication = true ii_return = dw_1.setwsobject (ws_1)
WSError Event • Occurs when an error is returned for a DataWindow using a Web Service data source • Can occur during any of the following operations • Connect • Retrieve • Delete • Insert • Update • Disconnect
Further Resources • PowerBuilder Demonstration Recordings… • http://www.sybase.com/products/development/powerbuilder/videos • Recorded Webcasts from this series… • http://www.sybase.com/products/development/powerbuilder/webcasts
Getting Your Hands on PowerBuilder 11 • Do you have an Update Subscription Plan (USP)? • Access the Sybase Product Download Center (SPDC) at https://sybase.subscribenet.com • Download PowerBuilder 11 and companion products • Generate license keys • Need new or additional licenses? • Contact your Sybase sales office (US/Canada: 1-800-8-SYBASE) • Visit e-shop at http://eshop.sybase.com
The ISUG North American PowerBuilder 11 Tour Continues! • Feb 26th: San Jose, CA – Embassy Suites, Santa Clara • Feb 27th: Los Angeles, CA – Embassy Suites North, LAX • Feb 28th: San Diego, CA – Windmill Banquet & Catering, Carlsbad • http://www.isug.com/common/PowerBuilder11Tour.html
FAQs • Q: Can I use a Web Service that is not implemented using PowerBuilder/PowerScript? • A: Yes. As long as the public interface of the Web Service uses data types suited to this version of the Web Service DataWindow.
FAQs • Q: Can I use a PowerBuilder NVO deployed to an application server other than EAServer or IIS as the data source of a Web Service DataWindow? • A: Yes. You may use the PowerBuilder Application Server Plug-In to deploy your NVOs to WebLogic, WebSphere or JBoss, then expose them as Web Services.
FAQs • Q: Can I use Web Service data source DataWindows for DDDWs and for Composite DataWindows? • A: Yes, but you must explicitly call a GetChild() and a Retrieve() for them before the Retrieve() call for the parent DataWindow/DataStore…much as you would for a DDDW with retrieval arguments.
FAQs • Q: Can I change the Web Service data source for an existing DataWindow? • A: Normally, no. • You may try editing the DataWindow source …if not… • You need to recreate the DataWindow from scratch • This mirrors the Stored Procedure source DataWindow in this regard