FYP Final Report v1.0.0
Copyright and All Rights Reserved To: Pee-Lo Team @2003/04
47
Snippet 8: Sample Codes to Consume Data Sent by Pee-LoWS XML Web Services
In Line 8 of Snippet 8, there is the using directive. It states that the programs in this file can use
any types within the peeloApps.localhost namespace without a fully qualified name. In other
words, statements dont need the peeloApps.localhost prefix. This is evident in the
OnControlLoad(object sender, System.EventArgs e)
method where the
peelowebservice()
method in Line 391 is invoke. In Line 19, we then declare the private
member variable called wsService of the type peelowebservice (from WSDL file) and set it to
null. We then do the same in Line 20 for objHC.
If without the using directive, the codes in Lines 19, 20, 391 and 393 would be look like those in
Snippet 9:
Snippet 9: Sample Codes if the using directive is not present.
private peeloApps.localhost.peelowebservice wsService = null;
private peeloApps.localhost.HealthCare objHC = null;
UserControlHospitalInfo.wsService = new
peeloApps.localhost.peelowebservice();
UserControlHospitalInfo.objHC =
UserControlHospitalInfo.wsService.ShowHealthCareInfo();