1 / 40

ABC of and End Point Dhananjay Kumar

ABC of and End Point Dhananjay Kumar MVP-Connected System . End Point . Endpoint. Endpoint. Endpoint. End Point . Service. Client. Message. End Point . C. C. C. B. B. B. A. A. A. End Point .

nura
Download Presentation

ABC of and End Point Dhananjay Kumar

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ABC of and End Point Dhananjay Kumar MVP-Connected System

  2. End Point

  3. Endpoint Endpoint Endpoint End Point Service Client Message

  4. End Point

  5. C C C B B B A A A End Point Address, Binding, Contract Client Service Message Address Binding Contract (Where) (How) (What)

  6. End Point <endpoint address=“http://localhost:8080/abc" binding="wsHttpBinding" contract="HotsingSamples.IService1"> </endpoint>

  7. Address (A) Every service is associated with a unique address.

  8. Address (A) • Address specifies where the service is residing. • This is an URL( Uniform Resource Locator). • Address URL identifies , location of the service. • Address should follow the Web Service Addressing(WS-Addressing) standard.

  9. Address (A)

  10. Address (A)

  11. Address (A)

  12. Binding (B) • Describes how a service communicates. • This specifies which Protocol to be used. • This specifies the encoding method to format the message content. • This specifies the Security requirements. • This specifies the message exchange format. • This specifies message session mode. Etc . • Developer could create custom Binding also.

  13. Binding (B) • Transport Protocol • Message Encoding • Communication Pattern • Security • Transaction Property • Inter Operability

  14. Binding (B) basicHttpBinding • This is interoperable binding and commonly used as replacement for earlier web service based on ASMX. • This is designed to expose WCF service as legacy ASMX service such that old client can work with. • This also enables WCF client to work with ASMX • It supports HTTP & HTTPS protocols. • It supports MTOM/text encoding.

  15. Binding (B) wsHttpBinding • This is a secure and interoperable binding. • This uses SOAP over HTTP. • This supports reliability, transaction and security over Internet. • This supports HTTP/HTTPS protocol. • This supports text and MTOM encoding. • This is default binding provided by WCF. • This Binding is interoperate with any party that supports WS standards.

  16. Binding (B) wsDualHttpBinding • This supports all the feature of wsHttpBinding • This is mainly used for DUPLEX SERVICE CONTRACTS. • This supports bidirectional communication. • This is not a interoperable binding.

  17. Binding (B) webHttpBinding • This is a secure binding. • This is a interoperable binding. • It only supports Http/Https protocol. • It does not use SOAP style of message . • It uses REST style of message. • It is mainly used for REST enabled services.

  18. Binding (B) wsFederationHttpBinding • This is a secure Binding. • This is interoperable binding. • This supports federated security • This supports Https/Https protocols. • This uses text/MTOM encoding. • This supports Federated Identity.

  19. Binding (B) netTCPBinding • This is a secure Binding. • This is optimize to use if client is also a WCF machine. • This is used to send Binary encoded SOAP message from one WCF computer to another. • This uses TCP (Transmission Control Protocol) for cross machine communication on the Intranet. • This supports reliability, transaction, security. • This requires both the client and service to use WCF.

  20. Binding (B) netNamedPipeBinding • This is most secure Binding. • This could be used over a single WCF computer. • This sends Binary encoded SOAP message over named pipes. • This uses named pipes as transport for same machine communication.

  21. Binding (B) netMSMQBinding • This is designed to offer support for disconnected queued calls. • This is a queued Binding. • This uses Binary encoded SOAP message. • This sends message over MSMQ. • Here communication should occur between two computers.

  22. Binding (B) netPeerTCPBinding • This is a secure Binding. • This uses TCP over peer to peer. • Communication should occur between two or more computers.

  23. Binding (B) basicHttpContextBinding • This Binding is same as of basicHttpBinding with more attributes , like below • It supports HTTP cookies • It enables SOAP headers to exchange context. • This binding is mainly used for Durable services.

  24. Binding (B) Choosing Binding WCF To WCF No Yes Disconnected Calls No Yes Legacy ASMX Cross Machine No Yes No Yes WS Basic IPC TCP MSMQ

  25. Binding (B) Binding Classes

  26. Binding (B) Configuring Binding <endpoint address="Calculator" bindingSectionName="basicProfileBinding" bindingConfiguration="Binding1" contractType="ICalculator" /> <bindings> <basicProfileBinding> <binding configurationName="Binding1" hostnameComparisonMode="StrongWildcard" transferTimeout="00:10:00" maxMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" </binding></basicProfileBinding></bindings>

  27. Contract (C) • A WCF Contract is a collection of Operations that specifies what the Endpoint communicates to the outside world. • All WCF services exposes contract. • This is a platform neutral and standard way to say , what the service will do. • Defines , what a Service communicates.

  28. Contract (C) Types of Contracts Microsoft Innovation & Practice Team, MSCoE 28

  29. Contract (C) Service Contract • A Service Contract reflects specific business knowledge and is the basis for sharing and reusing service. • Describe which operations client can perform on the service. • Maps CLR types to WSDL Microsoft Innovation & Practice Team, MSCoE 29

  30. Contract (C) Service Contract • Interfaces are used to explicitly define a Contract. • Classes may also be used to define a Contract. • [ServiceContract] attribute is being used by interface/class to qualify them as a contract. • ServiceContract are implicitly public. Microsoft Innovation & Practice Team, MSCoE 30

  31. Contract (C) Service Contract 31

  32. Contract (C) Data Contract • These are the contractual agreement about the format and structure of the payload data in message exchange between a service and its consumer. • Defines which Data types are passed to and from the service. • Its specifies CLR type to XML schema. 32

  33. Contract (C) Data Contract • DataContract are preferred WCF way to enable Serialization. • WCF defines implicit contract for built in types like int and string. • Developer has to explicitly expose complex types as Data Contract. • [DataContract] and [DataMember] attribute are used to define a type as Data Contract. 33

  34. Contract (C) Data Contract 34

  35. Contract (C) Message Contract • It gives control over SOAP message structure on both header and body content. • Developer can designate optional SOAP headers. • It provides additional control over the WSDL generation. • It is used to interoperate with another non- WCF service. • It is used to control security issue at level of message. 35

  36. Contract (C) Fault Contract • This translates .Net Exception to SOAP fault propagated to consumer. • This can be applied to operation only. • This is not Inheritable. • This can be applied multiple times. • This enables developer to declare which faults a given service operation might issue if things goes wrong. 36

  37. Creating End Point • Could be created declaratively in configuration file. • Could be created imperatively through code. • Any thing done through code can be done with configuration file and vice versa. • It is considered good practice to use configuration file to specify End points. This accommodates changes without recompiling the code. 37

  38. Multiple End Point • For service exposed to multiple clients ; it makes sense to specify more than one End point. • This enables client to use the endpoint that is most applicable for them. • When creating multiple endpoints each client must have unique address • If two client uses the same address , error will raise at service load time. 38

  39. Multiple End Point • <endpointaddress="http://localhost:8890/a" binding="wsHttpBinding" contract="HotsingSamples.IService1"/> • <endpointaddress="http://localhost:8000/b" binding="basicHttpBinding" contract="HotsingSamples.IService1"/> • <endpointaddress="net.tcp://localhost:8001/c" binding="netTcpBinding" contract="HotsingSamples.IService1"/> 39

  40. Thank You. Dhananjay Kumar MVP-Connected System

More Related