In this part of the article let’s dissect the proxy to understand it better. We can use the “WSDL.EXE” utility to generate a proxy, but for this one time let us hand-code the proxy to have a better understanding!
Let us keep the UI for this Web Application simple: a Web Form, which accepts “Flight Number” and “Day offset” and a text box to display the returned XML in the form of a string. The UI looks like the figure shown below:
Fig 11: Web Form for SAS Web Service proxy
The “code behind” page for this web form is “WebForm1.aspx.cs”. Now, let us decide if we really want a separate “proxy” dll that contains code to invoke the Web Service, or if it is okay to add that functionality in the “code behind” file itself! Assuming that we are not re-using the code to invoke the SAS Flight Status Web Service anywhere else and also since we are hand-coding the proxy, let us incorporate the proxy code in the “code behind” file, which is “WebForm1.aspx.cs”.