web services on devices in windows vista dave roth program manager windows device experience group...

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

Upload: marvin-black

Post on 02-Jan-2016

234 views

Category:

Documents


0 download

TRANSCRIPT

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

Web Services On Devices Web Services On Devices In Windows VistaIn Windows Vista

Dave RothDave RothProgram ManagerProgram ManagerWindows Device Experience GroupWindows Device Experience GroupMicrosoft CorporationMicrosoft Corporation

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

AgendaAgenda

Web Services on Devices (WSD)Web Services on Devices (WSD)Devices Profile for Web Services (DPWS)Devices Profile for Web Services (DPWS)

DiscoveryDiscovery

DescriptionDescription

Control and eventingControl and eventing

DemoDemo

Windows Vista’s support for WSDWindows Vista’s support for WSDWSD on Windows VistaWSD on Windows Vista

WSDAPI ArchitectureWSDAPI Architecture

Client codeClient code

Generating WSDAPI CodeGenerating WSDAPI Code

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

WindowsWindows®® Rally™ Program Rally™ Program

Simple Unified License

Access to Technologies

Technical Guidance

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

WindowsWindows®® Rally™ Devices Rally™ Devices

Reliable and simple to manage

Effortless to configure and

maintain

More secure and provide rich

digital experiences

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

Windows Rally ExperiencesWindows Rally ExperiencesApplications

IP Network(IPv4, IPv6)

Wir

eles

s S

etu

p

Ethernet/Wireless

Qu

alit

y o

f S

ervi

ce

AV DevicesDis

cove

ry

Net

wo

rk M

ap

Windows Rally Experiences

Device Specific Drivers

Management Interfaces

NetworkedDevices

LL

TD

: Q

ues

t E

xten

sio

ns

LL

TD

: T

op

olo

gy

Map

Win

do

ws

Co

nn

ect

No

w

UPnP

Plug and Play Extensions

Windows Rally TechnologiesWindows Rally Technologies

Windows Rally Technologies

Fu

nct

ion

Dis

cove

ry

Device Profile for Web Services

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

Web Services On DevicesWeb Services On DevicesDevices profile for web services (DPWS)Devices profile for web services (DPWS)

Defines how devices can use Web ServicesDefines how devices can use Web Services

Supports resource constrained devicesSupports resource constrained devices

Ensures interoperability between devices and PCsEnsures interoperability between devices and PCs

Enables device and service discoveryEnables device and service discovery

Supports rich eventingSupports rich eventing

Endpoint provides device/host metadataEndpoint provides device/host metadata

Built on standards and WS specificationsBuilt on standards and WS specifications

WS-AddressingWS-Addressing

WS-EventingWS-Eventing

WS-MetadataTransferWS-MetadataTransfer

HTTP/1.1HTTP/1.1

WSDL 1.1WSDL 1.1

SOAP 1.2SOAP 1.2

WS-DiscoveryWS-Discovery

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

Web Services On DevicesWeb Services On DevicesWindows Vista supportWindows Vista support

Windows Vista WSD supportWindows Vista WSD supportPrintingPrinting

ScanningScanning

ProjectorsProjectors

ComputersComputers

WSD API WSD API Supports DPWSSupports DPWS

Function Discovery discovers WSD devicesFunction Discovery discovers WSD devices

PnP-X detects WSD device presencePnP-X detects WSD device presence

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

Web Services On DevicesWeb Services On DevicesDiscoveryDiscovery

Uses the WS-Discovery specificationUses the WS-Discovery specificationMulticast announcementsMulticast announcements

Multicast query requests (probe/resolve)Multicast query requests (probe/resolve)

Unicast responsesUnicast responses

Device announces presenceDevice announces presenceSend out Hello and Bye messagesSend out Hello and Bye messages

Device responds to client requestsDevice responds to client requestsProbe: Identify a device or serviceProbe: Identify a device or service

Resolve: Locate device or service endpointResolve: Locate device or service endpoint

Get information via metadata exchangeGet information via metadata exchange

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

Web Services Web Services on Deviceson DevicesDiscoveryDiscovery

Hello!

ResolveMatch:Sure do!

Hello!

Hello!

Bye!Hello!

Probe: Printer

ProbeMatch: Hey, I’m a printer!

Resolve: Got an Endpoint?

ClientClient

Ser

vice

Ser

vice

DeviceDevice Probe

Resolve

MetadataExchange

MetadataExchange

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

Probe Request: Looking for printers

Web Services On DevicesWeb Services On DevicesDiscoveryDiscovery

<?xml version="1.0" encoding="utf-8" ?><soap:Envelopexmlns:soap=“http://www.w3.org/2003/05/soap-envelope”xmlns:wsa=“http://schemas.xmlsoap.org/ws/2004/08/addressing”xmlns:wsd=“http://schemas.xmlsoap.org/ws/2005/04/discovery”xmlns:wsdp=“http://schemas.xmlsoap.org/ws/2006/02/devprof”

xmlns:wprt=“http://schemas.microsoft.com/windows/2006/01/wpd/print”><soap:Header><wsa:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To><wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</wsa:Action><wsa:MessageID>urn:uuid:95854ad7-d7ef-4769-bcbb-0648a5fa39d6</wsa:MessageID>

</soap:Header><soap:Body><wsd:Probe><wsd:Types> wsdp:Device wprt:PrintDeviceType </wsd:Types>

</wsd:Probe></soap:Body>

</soap:Envelope>

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

Web Services On DevicesWeb Services On DevicesDescriptionDescriptionMetadata 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" >

<!-- Headers omitted for brevity. --> <soap:Body>

<wsx:Metadata> <wsx:MetadataSection dialect="http://schemas.xmlsoap.org/ws/2006/02/devprof/ThisModel">

<wsdp:ThisModel> <wsdp:Manufacturer> ACME Manufacturing </wsdp:Manufacturer> <wsdp:ModelName xml:lang="en-GB"> ColourBeam 9 </wsdp:ModelName> <wsdp:ModelName xml:lang="en-US"> ColorBeam 9 </wsdp:ModelName>

</wsdp:ThisModel> </wsx:MetadataSection> <wsx:MetadataSectionDialect="http://schemas.xmlsoap.org/ws/2006/02/devprof/ThisDevice">

<wsdp:ThisDevice> <wsdp:FriendlyName xml:lang="en-GB"> ACME ColourBeam Printer </wsdp:FriendlyName> <wsdp:FriendlyName xml:lang="en-US"> ACME ColorBeam Printer </wsdp:FriendlyName>

</wsdp:ThisDevice> </wsx:MetadataSection>

<!-- Other Metadata Sections omitted for brevity. --> </wsx:Metadata>

</soap:Body> </soap:Envelope>

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

Web Services On DevicesWeb Services On DevicesControl and eventingControl and eventing

Contract defined by WSDL and XML schemaContract defined by WSDL and XML schemaEnsures common baseline for interopEnsures common baseline for interopUses standard WSDL/1.1Uses standard WSDL/1.1

Presents rich eventing modelPresents rich eventing modelWSDL allows for detailed eventsWSDL allows for detailed eventsClient subscribes to eventsClient subscribes to eventsDevice pushes events to clientsDevice pushes events to clients

Supports a Secure ChannelSupports a Secure ChannelBased on SSLBased on SSLProvides encryptionProvides encryptionSupports host and client authenticationSupports host and client authentication

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

WSD ScanningWSD ScanningAnd PrintingAnd Printing

Shang-Lin ChuangShang-Lin ChuangProgram ManagerProgram ManagerDigital Documents GroupDigital Documents Group

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

WSD On Windows VistaWSD On Windows VistaWSDAPIWSDAPI

““Web Services on Devices API”Web Services on Devices API”

Implements DPWS compliant SOAP stackImplements DPWS compliant SOAP stack

Implements discovery networking stackImplements discovery networking stack

Low level APILow level API

Unmanaged codeUnmanaged code

‘‘C++’ InterfacesC++’ InterfacesDiscovery/PublicationDiscovery/Publication

Client/HostingClient/Hosting

Works with Function Discovery, PnP-XWorks with Function Discovery, PnP-X

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

WSD On Windows VistaWSD On Windows VistaDevice discovery and descriptionDevice discovery and description

Function Discovery discovers devices Function Discovery discovers devices Query network for devices and servicesQuery network for devices and services

Notifies application when devices go on/offlineNotifies application when devices go on/offline

Supports Directed DiscoverySupports Directed Discovery

Provides device description metadataProvides device description metadata

Enables device activationEnables device activation

PnP-X manages “associated” devicesPnP-X manages “associated” devicesDetect networked device presenceDetect networked device presence

Load drivers for networked devicesLoad drivers for networked devices

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

WSDAPI ArchitectureWSDAPI Architecture

Session

Client API Host APIGeneratedCode

Client Application

HTTP Transport UDP Transport Listener AddressResolver

Hosted Device

Message Queuing

Provided by:Provided by:

MicrosoftMicrosoft

ISV/IHVISV/IHV

Code GenCode Gen

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

WSD On Windows VistaWSD On Windows VistaWSDAPI code generation toolWSDAPI code generation tool

Code Gen tool abstracts complexityCode Gen tool abstracts complexityConverts WSDL types into WSDAPI callsConverts WSDL types into WSDAPI calls

Complies WSDL into C++ codeComplies WSDL into C++ codeProxy code – Used by clientsProxy code – Used by clients

Stub code – Used by hostsStub code – Used by hosts

IDL – Describes interfacesIDL – Describes interfaces

Apps call into generated codeApps call into generated code

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

WSD On Windows VistaWSD On Windows VistaWSDAPI proxiesWSDAPI proxies

Device proxyDevice proxyObtained via FD Function Instance (FI)Obtained via FD Function Instance (FI)

Used to obtain service proxyUsed to obtain service proxy

Service proxyService proxyService proxy is the control channel Service proxy is the control channel

Used to initialize COM based objectUsed to initialize COM based object

““Activation Layer” for class IDActivation Layer” for class ID

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

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 VistaWSD On Windows VistaWSDAPI client codeWSDAPI client code

Query Function Discovery for FIQuery Function Discovery for FI

Activate Service from FIActivate Service from FI

Interact with service via proxyInteract with service via proxyvoid 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 );}

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

WSD On Windows VistaWSD On Windows VistaWSDAPI code generation processWSDAPI code generation process

Takes in WSDL and XML SchemaTakes in WSDL and XML Schema

Code Code generationgeneration

WSDL IDL

..cpp

Generate IDL and proxy/stub codeGenerate IDL and proxy/stub code

CompileCompileand linkand link

Run Code Generation toolRun Code Generation tool

Compile with App codeCompile with App code

Produce executableProduce executable

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

Call To ActionCall To Action

Implement WSD support on devicesImplement WSD support on devices

Implement PnP-X complianceImplement PnP-X compliance

Write FD activation codeWrite FD activation code

Use WSDAPI for WSD drivers and appsUse WSDAPI for WSD drivers and apps

Use FD and PnP-X to discover devices Use FD and PnP-X to discover devices and load driversand load drivers

Check out the Rally web siteCheck out the Rally web site

Read whitepapersRead whitepapers

Toolkit available end of 2006Toolkit available end of 2006

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

Related SessionsRelated Sessions

CON106CON106Web Services on Devices: Current and Future DirectionsWeb Services on Devices: Current and Future Directions

CON254 CON254 Plug and Play for Network Connected DevicesPlug and Play for Network Connected Devices

CON275CON275Web Services on Devices Hands-On LabWeb Services on Devices Hands-On Lab

PRI113PRI113Windows Image Acquisition EnhancementsWindows Image Acquisition Enhancementsin Windows Vistain Windows Vista

Ask the ExpertsAsk the Experts

Microsoft PavilionMicrosoft Pavilion

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

Additional ResourcesAdditional Resources

Microsoft RallyMicrosoft Rallyhttp://www.microsoft.com/rallyhttp://www.microsoft.com/rally

Devices Profile for Web Services (February 2006)Devices Profile for Web Services (February 2006)http://schemas.xmlsoap.org/ws/2006/02/devprof/http://schemas.xmlsoap.org/ws/2006/02/devprof/

WSD Developer StoryWSD Developer Storyhttp://msdn.microsoft.com/library/en-us/dnlong/html/WebSerDev.asphttp://msdn.microsoft.com/library/en-us/dnlong/html/WebSerDev.asp

Windows’ Web ServicesWindows’ Web Serviceshttp://msdn.microsoft.com/webservices/default.aspxhttp://msdn.microsoft.com/webservices/default.aspx

Web Services Feedback WorkshopsWeb Services Feedback Workshopshttp://msdn.microsoft.com/webservices/community/workshops/http://msdn.microsoft.com/webservices/community/workshops/

Web Services BasicsWeb Services Basicshttp://msdn.microsoft.com/webservices/understanding/webservicebahttp://msdn.microsoft.com/webservices/understanding/webservicebasics/default.aspxsics/default.aspx

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

© 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.

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