Presentation is loading. Please wait.

Presentation is loading. Please wait.

UNIT - III WEB SERVICES BUILDING BLOCKS. Transport protocols for web services Transport such as HTTP and TCP are becoming common for SOAP traffic. However.

Similar presentations


Presentation on theme: "UNIT - III WEB SERVICES BUILDING BLOCKS. Transport protocols for web services Transport such as HTTP and TCP are becoming common for SOAP traffic. However."— Presentation transcript:

1 UNIT - III WEB SERVICES BUILDING BLOCKS

2 Transport protocols for web services Transport such as HTTP and TCP are becoming common for SOAP traffic. However UDP and SMTP are also used for SOAP Messaging. Anyway SOAP is designed to be transport independent.

3 Transport protocols for web services (Cont….) TCP – More traffic in world runs over TCP/IP stack and this is most popular networking stack.

4 Sample TCP code … TcpClient tcpClient=new TcpClient(); tcpClient.Connect(txtServer.Text,55); txtServer.Text is to access text from txtServer textbox NetworkStream stream=tcpClient.GetStream(); If(stream.CanWrite && stream.CanRead) Used to make sure stream can be written over and read from Byte[] buffer=Encoding.ASCII.GetBytes(txtWords.txt); stream.Write(buffer,0,buffer.Lengstream.Write(buffer,0,buffer.Length ); TcpListener listener=new TcpListener(55); listener.Start(); TcpClient client=clielistener.AcceptTcpClient();

5 Sample TCP code (Cont …)

6 Sample UDP code… IPAddress multicastAddress=IPAddress.Parse(“244.0.0.1”); UdpClient client=new UdpClient(555); Client.JoinMulticastGroup(multicClient.JoinMulticastGroup(multicastAddress,100); while(true ) { IPEndPointendpoint=null; Byte[] buByte[] buffer= client.Receive(ref,endpoint); String message=Encoding.ASCII.GetString(buffer); MessageBox.Show(mMessageBox.Show(message); } Client.DropMulticastgroup(multicastAddress); IPAddress multicastAddress=IPAddress.Parse(“244.0.0.1”); IPIPEndPointm_RemoteEP=new IPEndPoint(multicastAddress,555);=new IPEndPoint(multic UdpClient client=new UdpClient(555); Client.JoinMulticastGroup(multicClient.JoinMulticastGroup(multicastAddress,100); xtWords.Text.Length,buffer,0); Byte[] buffer=new Byte[txtWords,Text.ength+1); int length=Encoding.ASCII.GetBytes(txtWords.Text.ToCharArray(),0, t client.Send(buffer,length,m_RemoteEP);

7 SOAP in Email – SMTP

8 Cont…. HTTP – On top of TCP/IP the most popular transport protocol in the world HTTP which is connection oriented protocol that is based on request and response messages This is a request GET/CRWeb/CRService.html HTTP/1.1 This is a reponse for the request we used HTTP/1.1 200 OK Content-Type:text/xml; charset=utf-8 Content-Length:nnn This is an HTML Page

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30


Download ppt "UNIT - III WEB SERVICES BUILDING BLOCKS. Transport protocols for web services Transport such as HTTP and TCP are becoming common for SOAP traffic. However."

Similar presentations


Ads by Google