26

Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Embed Size (px)

Citation preview

Page 1: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311
Page 2: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Web Services In Native CodeNikola DudarProgram ManagerMicrosoft CorporationSession Code: DTL 311

Page 3: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Session outline

Story of native code and web servicesIntroduction to Windows Web Services APIDemonstration of WWSAPIQ&A

Page 4: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Story of Native Code and Web Services

No simple way for native code connect to WCF and ASP .Net XML web services

SOAP Toolkit is not supportedATL SOAP does not work for most scenarios

Taking dependency on .Net Framework is not acceptable in many casesNative + managed code mixed solutions demonstrate poor performance

Page 5: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Windows Web Services APIIntroduction

Connecting native code and web servicesWin32 APINo dependency on .Net Framework

Interoperability with WS-* SOAP stacksWindows Communication Foundation (WCF)ASP .Net XML Web Services (ASMX)Non-Microsoft stacks

System Component of Windows 7Available for Windows XP/Vista/2003/2008

Page 6: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Web service and client in native codeNikola DudarProgram ManagerMicrosoft Corporation

demo

Page 7: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Server

Native Code Client to WCF Service

Managed code client using WCF

WCF Service

Sort DLL

Native code client using WWSAPI

Page 8: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Server

Native Code Service Using WWS API

Managed code client using WCF

Native Code Service

Sort DLL

Native code client using WWSAPI

Page 9: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Demo Summary

Using WWS API, you can buildInteroperable web services Clients to web services

Fully native code solutionNo dependency on .Net Framework

Expose native code as WWSAPI web service2x-4x improvement in service throughput

Page 10: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Windows Web Services API Layers

Your Application Code

Network I/O

Service Model

Channel Layer

XML Layer

Erro

rs

Hea

p

Asyn

c C

onte

xt

Page 11: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Service ModelWeb services as function calls

Automatically manages communicationService Proxy on clientService Host on service

Message exchanges as function callsClient calls generated functionServer implements callback

Driven from ContractWsUtil.exe generates C code from WSDL/XSD

Page 12: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Channel LayerFull control over communication

Message Data sent or receivedConsists of body and headers

ChannelAbstraction for message exchangeUnified API for all transports

HTTP, TCP, UDPProperties to tweak different settings

Page 13: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Security DescriptionSecuring message exchange on the channel

Transport securityHTTP: SSLTCP: Windows SSPI

Message plus Transport security (Mixed Mode)Username/Password, Kerberos APREQ, XML Token, Secure Conversation TokenBasic support for SAML and federation

No support for Full message security mode

Page 14: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

XML LayerFull access to content of messages

Unified API for all encodings Text, Binary, MTOM

SOAP subset of XML 1.0 (No DTD)XmlBuffer

In-memory store for XML dataXmlReader and XmlWriter

Forward only accessIntegrated canonicalization (C14n)

Page 15: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

SerializationMapping C data types to/from XML types

Simply C and Win32 types mapped to simple XSD typesComplex XSD types mapped to C structuresWsUtil.exe generate C types from XSD

struct PurchaseOrder{ int id;};

<PurchaseOrder> <id>123</id></PurchaseOrder>

Page 16: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Drilling down into how to use WWSAPINikola DudarProgram ManagerMicrosoft Corporation

demo

Page 17: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Demo Summary

Remember ABCA: Opening Service Proxy or Service HostB: Creating Service Proxy or Service HostC: wsutil.exe generates C code from WSDL/XSD

HeapRemoves need for parameters "Alloc/Free"

ErrorDetailed information about runtime errors

Page 18: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Supported ConfigurationsTransports

HTTP, TCP, UDPXML Encodings

Text, Binary, and MTOMEnvelope

SOAP 1.1 and 1.2Addressing

WS-Addressing 0.9 and 1.0Metadata

WSDL 1.1, XML Schema 1.0WS-MetadataExchange 1.1WS-Transfer March 2006

Security

WS-Security 1.0 and 1.1 (partial)WS-Trust February 2005 and 1.3 (partial)WS-SecureConversation 1.1 and 1.3 (partial)

PolicyWS-Policy from March 2006 and v.1.2WS-Policy Attachment from March 2006 and 1.2WS-SecurityPolicy 1.1

Page 19: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

WWSAPI Performance

TCP/Binary HTTP/UTF80

500000

1000000

1500000

2000000

2500000

3000000

3500000

4000000

4500000

5000000

Client side Working Set in Steady StatePurchaseOrder Scenario

WWSAPIWCF

Kilo

byte

s

Page 20: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

WWSAPI Performance

TCP/Binary HTTP/UTF80

2000

4000

6000

8000

10000

12000

14000

16000

Server Side ThroughputPurchaseOrder Scenario

WWSAPIWCF

Ope

ratio

ns p

er s

econ

d

Page 21: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Summary

WWSAPI connects native code and web services Available on Windows 7, XP, Vista, Server 2003 and 2008 WWSAPI does not replace WCFUse WWSAPI to build native code clients

Reduces working set of your client applicationsUse WWSAPI to host native code on service

Improve throughput of your service

Page 22: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Questions and Answers

MSDNhttp://msdn.microsoft.com/network/

Blogshttp://blogs.msdn.com/nikoladhttp://blogs.msdn.com/haoxu

Reports of issues and suggestionshttps://connect.microsoft.com/wndp/

[email protected]

Page 23: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

www.microsoft.com/teched

Sessions On-Demand & Community

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learningMicrosoft Certification and Training Resources

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources

Page 24: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Related Content

Windows 7 SessionsWCL202 - Developing for Windows 7 WCL305 - Focus on Fundamentals in Windows Applications (Graphics, Power, Services, Profiling) WCL311 - Optimizing Your Application for the Windows 7 User Experience WCL312 - Windows Application Readiness for Developers

Sessions for C++ developersDTL403 - Microsoft Visual C++ Library, Language, and IDE: Now and NextDTL310 - Parallel Computing with Native C++ in Microsoft Visual Studio 2010

Page 25: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

Complete an evaluation on CommNet and enter to win!

Page 26: Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311

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