Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Services On Devices In Windows Vista Dave Roth Program Manager Windows Device Experience Group Microsoft Corporation.

Similar presentations


Presentation on theme: "Web Services On Devices In Windows Vista Dave Roth Program Manager Windows Device Experience Group Microsoft Corporation."— Presentation transcript:

1 Web Services On Devices In Windows Vista Dave Roth Program Manager Windows Device Experience Group Microsoft Corporation

2 Agenda Web Services on Devices (WSD) Devices Profile for Web Services (DPWS) DiscoveryDescription Control and eventing Demo Windows Vista’s support for WSD WSD on Windows Vista WSDAPI Architecture Client code Generating WSDAPI Code

3 Windows ® Rally™ Program Simple Unified License Access to Technologies Technical Guidance

4 Windows ® Rally™ Devices Reliable and simple to manage Effortless to configure and maintain More secure and provide rich digital experiences

5 Windows Rally Experiences Applications IP Network (IPv4, IPv6) Wireless Setup Ethernet/Wireless Quality of Service AV Devices Discovery Network Map Windows Rally Experiences Device Specific Drivers Management Interfaces Networked Devices LLTD: Quest ExtensionsLLTD: Topology MapWindows Connect Now UPnP Plug and Play Extensions Windows Rally Technologies Function Discovery Device Profile for Web Services

6 Web Services On Devices Devices profile for web services (DPWS) Defines how devices can use Web Services Supports resource constrained devices Ensures interoperability between devices and PCs Enables device and service discovery Supports rich eventing Endpoint provides device/host metadata Built on standards and WS specifications WS-AddressingWS-EventingWS-MetadataTransfer HTTP/1.1 WSDL 1.1 SOAP 1.2 WS-Discovery

7 Web Services On Devices Windows Vista support Windows Vista WSD support PrintingScanningProjectorsComputers WSD API Supports DPWS Function Discovery discovers WSD devices PnP-X detects WSD device presence

8 Web Services On Devices Discovery Uses the WS-Discovery specification Multicast announcements Multicast query requests (probe/resolve) Unicast responses Device announces presence Send out Hello and Bye messages Device responds to client requests Probe: Identify a device or service Resolve: Locate device or service endpoint Get information via metadata exchange

9 Web Services on Devices Discovery Hello! ResolveMatch: Sure do! Hello! Bye! Hello! Probe: Printer ProbeMatch: Hey, I’m a printer! Resolve: Got an Endpoint? Client Service Device Probe Resolve Metadata Exchange

10 Probe Request: Looking for printers Web Services On Devices Discovery urn:schemas-xmlsoap-org:ws:2005:04:discovery http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe urn:uuid:95854ad7-d7ef-4769-bcbb-0648a5fa39d6 wsdp:Device wprt:PrintDeviceType

11 Web Services On Devices Description Metadata Exchange: Response to get request <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa=http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsdp="http://schemas.xmlsoap.org/ws/2006/02/devprof" > ACME Manufacturing ColourBeam 9 ColorBeam 9 ACME ColourBeam Printer ACME ColorBeam Printer

12 Web Services On Devices Control and eventing Contract defined by WSDL and XML schema Ensures common baseline for interop Uses standard WSDL/1.1 Presents rich eventing model WSDL allows for detailed events Client subscribes to events Device pushes events to clients Supports a Secure Channel Based on SSL Provides encryption Supports host and client authentication

13 WSD Scanning And Printing Shang-Lin Chuang Program Manager Digital Documents Group

14 WSD On Windows Vista WSDAPI “Web Services on Devices API” Implements DPWS compliant SOAP stack Implements discovery networking stack Low level API Unmanaged code ‘C++’ Interfaces Discovery/PublicationClient/Hosting Works with Function Discovery, PnP-X

15 WSD On Windows Vista Device discovery and description Function Discovery discovers devices Query network for devices and services Notifies application when devices go on/offline Supports Directed Discovery Provides device description metadata Enables device activation PnP-X manages “associated” devices Detect networked device presence Load drivers for networked devices

16 WSDAPI Architecture Session Client API Host API Generated Code Client Application HTTP TransportUDP TransportListener Address Resolver Hosted Device Message Queuing Provided by: Microsoft ISV/IHV Code Gen

17 WSD On Windows Vista WSDAPI code generation tool Code Gen tool abstracts complexity Converts WSDL types into WSDAPI calls Complies WSDL into C++ code Proxy code – Used by clients Stub code – Used by hosts IDL – Describes interfaces Apps call into generated code

18 WSD On Windows Vista WSDAPI proxies Device proxy Obtained via FD Function Instance (FI) Used to obtain service proxy Service proxy Service proxy is the control channel Used to initialize COM based object “Activation Layer” for class ID

19 Void ActivationLayer( IFunctionInstance *pIFuncInst, REFIID riid, void **ppObject) { // Declaration/Initialization code left out for brevity... if ( NULL == pIFuncInst || __uuidof(IMyIf) != riid ) return( E_INVALIDARG ); hr = GetDeviceIdentity( pIFuncInst, &identity ); if ( S_OK == hr ) hr = WSDXMLCreateContext( &spWSDXMLContext ); if ( S_OK == hr ) hr = MyDeviceRegisterNamespaces( spWSDXMLContext ); if ( S_OK == hr ) hr = MyDeviceRegisterTypes( spWSDXMLContext ); if ( S_OK == hr ) hr = WSDCreateDeviceProxy( remoteUuid, sLocalAddress, spWSDXMLContext, &spWSDDeviceProxy ); if ( S_OK == hr ) hr = spWSDDeviceProxy->GetServiceProxyById( serviceId, &spWSDServiceProxy ); // Create COM object to host the WSD Proxy... if ( S_OK == hr ) pMyObjectProxy = new CMyObjectProxy(); if ( NULL == pMyObjectProxy ) hr = E_OUTOFMEMORY; if ( S_OK == hr ) hr = pMyObjectProxy->Init( spWSDServiceProxy ); if ( S_OK == hr ) hr = pMyObjectProxy->QueryInterface( __uuidof(IMyIf), ppObject ); if ( S_OK != hr && NULL != pMyObjectProxy ) pMyObjectProxy->Release(); } WSD On Windows Vista WSDAPI client code Query Function Discovery for FI Activate Service from FI Interact with service via proxy void PlayMusic( CMyObjectProxy *pServiceProxy ) { IWSDOutboundAttachment* pAudioStream = NULL; WCHAR* szTitle = L”My Audio Track”; CreateStream( &pAudioStream, L”c://song.mp3” ); pServiceProxy->MyIfDisplayString( L“Hello World”); pServiceProxy->MyIfPlaySong( szTitle, pAudioStream ); pAudioStream->Release(); } void QueryFD() { hr = spDiscovery->CreateInstanceCollectionQuery( FCTN_CATEGORY_WSDISCOVERY, NULL, TRUE, spNotify, &spFunQuery ); if ( SUCCEEDED( hr )) hr = spFunQuery->Execute( &spFunInsts ); } HRESULT OnUpdate( QueryUpdateAction eAction, IUnknown *pIUnknownForQuery, IFunctionInstance *pInstance) { IMyIF* pServiceProxy = NULL; if( NULL == pInstance) return( E_INVALIDARG ); pInstance->QueryService( pInstance, __uuidof(IMyIF), &pServiceProxy ); PlayMusic( pServiceProxy ); }

20 WSD On Windows Vista WSDAPI code generation process Takes in WSDL and XML Schema Code generation WSDL IDL..cpp Generate IDL and proxy/stub code Compile and link Application Run Code Generation tool Compile with App code Produce executable

21 Call To Action Implement WSD support on devices Implement PnP-X compliance Write FD activation code Use WSDAPI for WSD drivers and apps Use FD and PnP-X to discover devices and load drivers Check out the Rally web site Read whitepapers Toolkit available end of 2006

22 Related Sessions CON106 Web Services on Devices: Current and Future Directions CON254 Plug and Play for Network Connected Devices CON275 Web Services on Devices Hands-On Lab PRI113 Windows Image Acquisition Enhancements in Windows Vista Ask the Experts Microsoft Pavilion

23 Additional Resources Microsoft Rally http://www.microsoft.com/rally Devices Profile for Web Services (February 2006) http://schemas.xmlsoap.org/ws/2006/02/devprof/ WSD Developer Story http://msdn.microsoft.com/library/en-us/dnlong/html/WebSerDev.asp Windows’ Web Services http://msdn.microsoft.com/webservices/default.aspx Web Services Feedback Workshops http://msdn.microsoft.com/webservices/community/workshops/ Web Services Basics http://msdn.microsoft.com/webservices/understanding/ webservicebasics/default.aspx http://msdn.microsoft.com/webservices/understanding/ webservicebasics/default.aspx

24 © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

25


Download ppt "Web Services On Devices In Windows Vista Dave Roth Program Manager Windows Device Experience Group Microsoft Corporation."

Similar presentations


Ads by Google