xml odrobiny c# odrobinyczarnik/zajecia/xml11/w14-xml_po_lata… · silverlight sql server...
TRANSCRIPT
XML , XPATH, SOAP ++
Odrobiny C#
Odrobiny .NET
/
/1
/1/1
/1/1/1
/1/1/2
/1/2
/2 /3
/3/1 /3/2
• Uwaga! Blokowane jest całe pole!
Web Services Reliable Messaging v1.1 Web Services Reliable Messaging Policy Assertion v1.1WS-SecureConversation v1.3 WS-Trust v1.3WS-SecurityPolicy v1.2Web Services Atomic Transaction (WS-AtomicTransaction) Version 1.1Web Services Coordination (WS-Coordination) Version 1.1Web Services Policy 1.5 - Framework Web Services Policy 1.5 - AttachmentSOAP 1.1 SOAP 1.2 WSDL 1.1 WS-MetadataExchangeWSS SOAP Message Security 1.0 WSS SOAP Message Security UsernameToken Profile 1.0 WSS SOAP Message Security X.509 Certificate Token Profile 1.0 WSS SOAP Message Security Kerberos Token Profile 1.1Web Services Addressing 1.0 - Core Web Services Addressing 1.0 - SOAPWSS SOAP Message Security 1.0 WS-Trust WS-ReliableMessagingMTOM
http://technet.microsoft.com/en-us/library/ms730294.aspx
<customBinding>
<binding name="string" closeTimeout="TimeSpan" openTimeout="TimeSpan" receiveTimeout="TimeSpan" sendTimeout="TimeSpan"
<compositeDuplex clientBaseAddress="Uri"/>
<reliableSession acknowledgementInterval="TimeSpan" advancedFlowControl="Boolean" bufferedMessagesQuota="Integer" inactivityTimeout="TimeSpan" maxPendingChannels="Integer" maxRetryCount="Integer" ordered="Boolean" />
<pnrpPeerResolver />
<windowsStreamSecurity protectionLevel="None/Sign/EncryptAndSign"/>
<sslStreamSecurity requireClientCertificate="Boolean" />
<transactionFlow transactionProtocol="OleTransactions/ WSAtomicTransactionOctober2004"/>
<security defaultAlgorithmSuite="Basic128/Basic192/Basic256/Basic128Rsa15/ Basic256Rsa15/TripleDes/TripleDesRsa15/Basic128Sha256/Basic192Sha256/TripleDesSha256/Basic128Sha256Rsa15/Basic192Sha256Rsa15/Basic256Sha256Rsa15/TripleDesSha256Rsa15" authenticationMode="UserNameForAnonym ous"contextMode="Cookie" defaultProtectionLevel="Sign" enableKeyDerivation="false" keyEntropyMode="ClientEntropy" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature" securityVersion="WSSecurityXXX2005">
<localClientSettings cacheCookies="false" detectReplays="false" maxCookieCachingTime="00:07:24" />
<localServiceSettings replayCacheSize="9" maxClockSkew="00:00:03" replayWindow="00:07:22.2190000" />
</security>
<binaryMessageEncoding maxReadPoolSize="Integer" maxWritePoolSize="Integer" maxSessionSize="Integer" />
<httpsTransport manualAddressing="Boolean" maxMessageSize="Integer" authenticationScheme="Negotiate" bypassProxyOnLocal="Boolean" hostNameComparisonMode="Exact"
mapAddressingHeadersToHttpHeaders ="Boolean" proxyaddress="Uri" realm="String" requireClientCertificate="Boolean" />
<peerTransport manualAddressing="false" maxMessageSize="20002" listenIPAddress="202.10.1.9" messageAuthentication="false" peerNodeAuthenticationMode="None" port="1000" />
<security defaultAlgorithmSuite="Basic128/Basic192/Basic256/Basic128Rsa15/ Basic256Rsa15/TripleDes/TripleDesRsa15/Basic128Sha256/Basic192Sha256/TripleDesSha256/Basic128Sha256Rsa15/Basic192Sha256Rsa15/Basic256Sha256Rsa15/TripleDesSha256Rsa15" authenticationMode="UserNameForAnonym ous" bootstrapBindingConfiguration="Str ing" bootstrapBindingSectionName="String" defaultProtectionLevel="None/Sign/EncryptAndSign" requireDerivedKeys="Boolean" securityHeaderLayout="Strict/Lax/LaxTimestampFirst/LaxT imestampLast" includeTimestamp="Boolean" keyEntropyMode="ClientEntropy/ServerEntropy/CombinedEntropy" messageProtectionOrder="SignBeforeEncrypt/SignBeforeEncryptAndEncryptSignature/EncryptBeforeSign" protectTokens="Boolean" requireSecurityContextCancellation="Boolean" securityVersion="
WSSecurityJan2004/WSSecurityXXX2005" requireSignatureConfirmation="Boolean" >
<localClientSettings cacheCookies="Boolean" detectReplays="Boolean" replayCacheSize="Integer" maxClockSkew="TimeSpan" maxCookieCachingTime="TimeSpan" replayWindow="TimeSpan" sessionKeyRenewalInterval="TimeSpan" sessionKeyRolloverInterval="TimeSpan" reconnectOnTransportFailure="Boolean" timestampValidityDuration="TimeSpan" cookieRenewalThresholdPercentage="Integer" />
<localServiceSettings detectReplays="Boolean" issuedCookieLifeTime="TimeSpan" maxStatefulNegotiations="Integer" replayCacheSize="Integer" maxClockSkew="TimeSpan" negotiationTimeout="TimeSpan" replayWindow="TimeSpan" inactivityTimeout="TimeSpan" sessionKeyRenewalInterval="TimeSpan" sessionKeyRolloverInterval="TimeSpan" reconnectOnTransportFailure="Boolean" maxConcurrentSessions="Integer" timestampValidityDuration="TimeSpan" />
<federationParameters trustVersion="WSTrustApr2004/WSTrustFe b2005" />
<security defaultAlgorithmSuite="Basic128/Basic192/Basic256/Basic128Rsa15/ Basic256Rsa15/TripleDes/TripleDesRsa15/Basic128Sha256/Basic192Sha256/TripleDesSha256/Basic128Sha256Rsa15/Basic192Sha256Rsa15/Basic256Sha256Rsa15/TripleDesSha256Rsa15" authenticationMode="UserNameForAnonymous" bootstrapBindingConfiguration="String" bootstrapBindingSectionName="String" defaultProtectionLevel="None/Sign/EncryptAndSign" requireDerivedKeys="Boolean" securityHeaderLayout="Strict/Lax/LaxTimestampFirst/LaxT imestampLast" includeTimestamp="Boolean" keyEntropyMode="ClientEntropy/ServerEntropy/CombinedEntropy" messageProtectionOrder="SignBeforeEncrypt/SignBeforeEncryptAndEncryptSignature/EncryptBeforeSign" protectTokens="Boolean" requireSecurityContextCancellation="Boolean" securityVersion=" WSSecurityJan2004/WSSecurityXXX2005" requireSignatureConfirmation="Boolean" >
<localClientSettings cacheCookies="Boolean" detectReplays="Boolean" replayCacheSize="Integer" maxClockSkew="TimeSpan" maxCookieCachingTime="TimeSpan" replayWindow="TimeSpan" sessionKeyRenewalInterval="TimeSpan" sessionKeyRolloverInterval="TimeSpan" reconnectOnTransportFailure="Boolean" timestampValidityDuration="TimeSpan" cookieRenewalThresholdPercentage="Integer" />
<localServiceSettings detectReplays="Boolean" issuedCookieLifeTime="TimeSpan" maxStatefulNegotiations="Integer" replayCacheSize="Integer" maxClockSkew="TimeSpan" negotiationTimeout="TimeSpan" replayWindow="TimeSpan" inactivityTimeout="TimeSpan" sessionKeyRenewalInterval="TimeSpan" sessionKeyRolloverInterval="TimeSpan" reconnectOnTransportFailure="Boolean" maxConcurrentSessions="Integer" timestampValidityDuration="TimeSpan" />
<federationParameters trustVersion="WSTrustApr2004/WSTrustFe b2005" />
<GenericIssuedTokenParameters>
<LocalIssuerIssuedTokenParameters keyType=" SymmeticKey/PublicKey" keySize="Integer" tokenType="String" />
<IssuedTokenParametersEndpointAddress address="URI" bindingConfiguration="String" binding="String" />
<IssuedTokenClient localIssuerChannelBehaviors="String" cacheIssuedTokens="Boolean" maxIssuedTokenCachingTime="TimeSpan" keyEntropyMode="ClientEntropy/ServerEntropy/CombinedEntropy" />
<IssuedTokenClientBehavior issuerAddress="String" behaviorConfiguration="String" />
<IssuedTokenClientBehavior address="URI" bindingConfiguration="String" binding="String" />
</GenericIssuedTokenParameters>
</security></binding></customBinding>
http://www.microsoft.com/standards/
http://www.microsoft.com/interop/osp/default.mspx
http://msdn.microsoft.com/en-us/library/dd208104(PROT.10).aspx
• WebGet
• webHttpBinding
• webServiceHost
• webServiceHostFactory
[OperationContract] [WebGet(UriTemplate=“/WeatherMap/{country}/{zipcode}”)] Stream GetWeatherMap(String country, String zipcode);
Operator URI Znaczenie
GET http://serwer/customer/5
http://serwer/product/6
Zwraca klienta o id = 5
Zwraca produkt o id=6
GET http://serwer/customer Zwraca kolekcję klientów
(zwykle stronicowanie)
POST http://serwer/customer/1
(w ciele POST – XML z polami)
Dodaje klienta o id =1 i
danej wartości
PUT http://serwer/customer/1 Aktualizuje klienta o id=1
DELETE http://serwer/customer/1 Kasuje klienta o id=1
Przeznaczenia poleceń REST
Bezpieczne
?
Idempotentne
?
Poleceni
e
Opis
Tak GET Zwraca reprezentację danego zasobu. Nie powinna
być wykonywana żadna inna czynność
POST Wysyła dane do przetworzenia Dane są zawarte w
ciele żądania (jak w przypadku formularzy HTML)
Tak PUT Modyfikuje zasób wgrywając nowe dane. Każde
kolejne wywołanie tego polecenia w identyczny
sposób zmienia stan zasobu.
Tak DELETE Usuwa dany zasób.
PATCH Modyfikuje część zasobu (dla porównania – PUT
zastępuje cały). Polecenie jest częścią RFC 2789 z
2010 roku;
Tak HEAD Podobne jak GET, ale nie pobiera ciała dokumentu,
ale same elementy nagłówka. Używane do analizy
metadanych.
OData, protokół do
odpytywania i aktualizacji
danych, bazuje na REST/
ATOMPub / JSON,
Opisuje też
Conceptual
Schema
Definition
File (model EDM)
Excel/PowerPivot
Visual Studio
.NET Framework
Silverlight
Javascript/AJAX
PHP
Java
.NET Framework
Sharepoint
Sharepoint Services
SQL Server Reporting Services
Windows Azure Table Storage
Codename “Dallas”
WebSphere eXtreme Scale
Klienci OData OData Producers
IDataServiceStreamProvider
ObservableCollection
Źródła
danych
ADO.NET SharePoint
SQL Azure
WCF Data
& RIA Services
SQL Server
Excel
PowerPivot .NET Client Silverlight Javascript PHP …
Analysis &
Reporting
Win
Azure
Open Data Protocol (AtomPub + EDM)
Klienci na
dane
Runtime Data Services
Ruch
HTTP
Provider do Entity
Framework Provider na refleksji Własny provider
.NET Classes
[+ LINQ provider] Entity Framework
Baza Źródło Źródło
Własny provider:
- IDataServiceMetadataProvider
- IDataServiceQueryProvider
Aktualizacje:
- IDataServiceUpdateProvider
Dodatkowe usługi:
- IDataServiceStreamProvider
- IDataServicePagingProvider
http://services.odata.org/Northwind/Northwind.svc/Customers?$filter=startswith(CompanyName, 'Alfr') eq true
http://services.odata.org/OData/OData.svc/Products?$select=Name,Categoryhttp://services.odata.org/OData/OData.svc/Categories?$select=Name,Products&$expand=Products/Suppliers
http://services.odata.org/OData/OData.svc/Categories(1)/Products(1)/Supplier/Address/City
https://github.com/OData/odata4objc
<?xml version=”1.0” encoding=”utf-8” standalone=”yes”?> <feed xml:base=”http://localhost/AppFabricApp/CustomDataService.svc/” xmlns:d=”http://schemas.microsoft.com/ado/2007/08/dataservices” xmlns:m=”http://schemas.microsoft.com/ado/2007/08/dataservices/metadata” xmlns=”http://www.w3.org/2005/Atom”> <title type=”text”>Users</title> <id>http://localhost/AppFabricApp/CustomDataService.svc/Users</id> <updated>2011-05-29T17:36:05Z</updated> <link rel=”self” title=”Users” href=”Users” /> <entry> <id>http://localhost/AppFabricApp/CustomDataService.svc/Users(1)</id> <title type=”text”></title> <updated>2011-05-29T17:36:05Z</updated> <author> <name /> </author> <link rel=”edit” title=”User” href=”Users(1)” /> <link rel=”http://schemas.microsoft.com/ado/2007/08/dataservices/related/Contacts” type=”application/atom+xml;type=feed” title=”Contacts” href=”Users(1)/Contacts” /> <category term=”SampleWCFDataServices.User” scheme=”http://schemas.microsoft.com/ado/2007/08/dataservices/scheme” /> <content type=”application/xml”> <m:properties> <d:ID m:type=”Edm.Int32”>1</d:ID> </m:properties> </content> </entry> <entry> […] </entry> </feed>
https://datamarket.azure.com/dataset/explore/f707ec8f-fc8a-483f-9e50-ed4e56ea6caa
https://api.datamarket.azure.com/Data.ashx/WorldBank/WorldDevelopmentIndicators/GetData?LanguageCode=%27en%27&CountryCode=%27AFG%27&IndicatorCode=%27AG.AGR.TRAC.NO%27&$top=100
C# 3.0 VB 9.0 Inne
.NET Language Integrated Query
LINQ to
Objects
LINQ to
DataSets
LINQ to
SQL
LINQ to
Entities
LINQ to
XML
Obiekty
<book>
<title/>
<author/>
<year/> <price/>
</book>
XML Dane
relacyjne
gridCategories.DataSource = from category in db.Production.ProductSubcategory orderby category.ProductSubcategoryID select new { CategoryID = category.ProductSubcategoryID, Name = category.Name };
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 }; int oddNumbers = numbers.Count(n => n % 2 == 1);
BizTalk Server (BPEL, EDI itp.)
Workflow Foundation 3.x
Workflow Foundation 4.0
Receive Port
Receive Adapter
Receive Pipeline
Send Port
Send Adapter
Send Pipeline
MessageBox Persistent Store
Host
Host
Host
Business Rules Inference Engine
Orchestration
Message
Message
Wygenerowane
aktywności z
adaptera LOB
Wbudowana
aktywność
mappera
PeopleSoft
Peregrine
Pivotal
QAD
Quickbooks
Remedy
RethinkNDo
SAP Scala
ServiceSwitch
Siebel
Staffware
Ultimus
Vantive
Visibility
Walker Int
Worldtrak
HIPAA, HL7 (healthcare)
RosettaNet (high-tech)
CIDX (chemical)
O/POS & RBI (retail)
FIX, SWIFT (financial)
cXML, xCBL (suppliers)
Oracle
DB2
Sybase
Informix
Progress
CICS
IMS
IMS DC/TM
dBase
ADABAS
ISAM
C-ISAM
Cloudbase
ALLBASE/S
AS/400 ADDS Regent 40 ADDS Viewpoint ADM11 AFP ALL-IN-1 Ampex 230 AXIS Navigator Bull TP CORBA Cobol Cufer T205 DEC VT Deployment DG 216 DG5220 DL/1 DMS EBCDIC EDI (X12) EDIFACT Essbase Focus Galileo Hazeltime 1500 HP 700/92/2392A IBM 3101 IBM3151/3161 IBM 3270/E ICL 7561 IDS-II IN2 SM9400g/j INFOAccess Infoman Java EJB
JMS KSAM Loopback MDIS PRISM 8/9 Microfusion MF-30 MODEL 204 MQSeries MVS Mumps Omnidex Oracle AQ P9 ANSI PACE PC Monitor Pick PT200 QSAM QUME QVT Red Brick RMS RPG SCO ANSI ShareBase SIF SUPRA System 2000 Tandem NonStop/ TS530 Televideo 910-955 Teradata TI924 Total VT WYSE
CA-Datacom/DB
CA-IDMS
CA-Ingres
Ingres
XA Transactions
ODBC
OLE DB
JDBC
HTTP/S
FTP
Rdb
Net-ISAM
QL
SQL/DS
Baan
Broadvision
Cove Systems
Covisint
FrontStep
Hogan
i2
Integral
J.D. Edwards
Mapics
McHugh
Mega
Navision
Onyx
Oracle e-bus
Peachtree
Infrastruktura Dane Aplikacje
Wertykały
ESB Core
Core Engine Services
ESB Management Portal (Sample)
Provisioning Framework
Reports
Alerts
Exception Management
Exception Logger
Exception Handler or Custom Application
Fault Processor
Transform Service
Route Service
On-ramps Off-ramps
Generic SOAP Send
Generic WCF Send
Generic JMS Send
Custom Send
Pipeline
Generic Pipeline
Pipeline
Custom Pipeline
Generic SOAP Receive
Generic WCF Receive
Generic JMS Receive
Generic Custom Receive
Pipeline
Pipeline
JMS Pipeline
Custom Pipeline
Enrich Service
Exception Management
Store
Custom Service
ESB Services
Resolver Web Service
Transformation Web Service
Exception Web Service
UDDI Service
Operations Service
Itinerary Configuration
Store
Resolver-Adapter Framework
Custom Resolver
Resolvers (…) Adapter Providers(…)
Custom Adapter Provider