CCWS Praticals
CCWS Praticals
Practical No:-1
Aim:- Define a simple Service like Converting Rs into Dollar and Call it from different platform like
java and .Net
Steps:-
Output:
Practical No:-2
Steps:-
Output:-
Practical No:-3
Steps:-
Output:-
Practical No:-4
Code:-
package practical4;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.maps.GeoApiContext;
import com.google.maps.GeocodingApi;
import com.google.maps.errors.ApiException;
import com.google.maps.model.GeocodingResult;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
test();
GeocodingResult[] results;
try {
System.out.println(gson.toJson(results[0].addressComponents));
context.shutdown();
Output:
run:
"types": [
"ROUTE"
},
"types": [
"POLITICAL",
"SUBLOCALITY",
"SUBLOCALITY_LEVEL_2"
},
"types": [
"POLITICAL",
"SUBLOCALITY",
"SUBLOCALITY_LEVEL_1"
},
"longName": "Virar",
"shortName": "Virar",
"types": [
"LOCALITY",
"POLITICAL"
},
"longName": "Palghar",
"shortName": "Palghar",
"types": [
"ADMINISTRATIVE_AREA_LEVEL_3",
"POLITICAL"
},
"types": [
"ADMINISTRATIVE_AREA_LEVEL_2",
"POLITICAL"
},
"longName": "Maharashtra",
"shortName": "MH",
"types": [
"ADMINISTRATIVE_AREA_LEVEL_1",
"POLITICAL"
},
"longName": "India",
"shortName": "IN",
"types": [
"COUNTRY",
"POLITICAL"
},
"longName": "401303",
"shortName": "401303",
"types": [
"POSTAL_CODE"
Practical No:-5
Steps:-
Practical No:-6
Steps:-
Create WebService
DownloadImageWS.aspx
DownloadImageWS.asmx.cs
public class DownloadImageWS : System.Web.Services.WebService
{
[WebMethod]
public byte[] GetImageFile(String fileName)
{
if (System.IO.File.Exists(Server.MapPath("~/Images/") + fileName))
{
return System.IO.File.ReadAllBytes(Server.MapPath("~/Images/") +
fileName);
}
else
{
return new byte[] { 0 };
}
}
}
}
}
else
{
context.Response.ContentType = "image/jpeg";
context.Response.BinaryWrite(binImage);
}
}
Form name:DownloadImage.aspx
Output:-
Practical No:-7
Steps:-
4. Select Typical
AND select the the Foss folder from c drive which is already created.
Select Network