Please help with java......urgent...?

timer Asked: Dec 26th, 2012

Question Description

Following is a program in C#....

please help me writing it in java with proper explanation..

Uri theUri = new Uri(txtURI.Text);

string json = string.Empty;

if (cmbPostType.Text == "AddUpdateNote")
AlarmNote theNote = new AlarmNote()
NoteId = Guid.NewGuid().ToString(),
AssociatedId = "56CF822F-F9AE-4525-A610-046D0AEADCA2",
ModifiedDate = DateTime.UtcNow.ToString(),
NoteText = "This is roger testing note...",
UserId = "d8d26841-b275-4fa6-953f-0b4a09bfd6b9"
//Convert the object to a json string
json = SerializeToJsonString(theNote);
else if (cmbPostType.Text == "ResolveAlarms")
string[] alarmIds = new string[] { "0b283fc1-f26f-4e4a-a54a-000472326123", "7bc26946-c83b-4ffc-9da3-001653659b58" };

//Convert the object to a json string
json = SerializeToJsonString(alarmIds);
WebClient client = new WebClient();

client.Headers[HttpRequestHeader.Authori… = "Basic " +
Encoding.UTF8.GetBytes(string.Format("{0… txtUserName.Text, txtPassword.Text)));

client.UploadStringCompleted += new UploadStringCompletedEventHandler(client…

client.Headers["Content-Type"] = "application/json";
client.UploadStringAsync(theUri, "POST", json, cmbPostType.Text);

This question has not been answered.

Create a free account to get help with this and any other question!

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors