Download presentation
Presentation is loading. Please wait.
Published byJemima Richardson Modified over 9 years ago
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.