Return to Snippet

Revision: 46767
at May 24, 2011 20:34 by kashif21


Initial Code
System.Runtime.Serialization

private void button1_Click(object sender, EventArgs e)
{
BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
EndpointAddress endpointAddress = new EndpointAddress("<a href="http://localhost:1031/Service/Person.svc&quot" rel="nofollow">http://localhost:1031/Service/Person.svc&quot</a>;);
IPersonService personService = new ChannelFactory<IPersonService>(basicHttpBinding, endpointAddress).CreateChannel();
Person person = personService.GetPersonData("F488D20B-FC27-4631-9FB9-83AF616AB5A6");
textBox1.Text = Convert.ToString("Name:"+person.FirstName + "\t" + "Last Name:"+person.LastName + "\t" + "Guid:"+person.Guid+"\t"+"Postal Code:"+person.PostalCode+"\t"+"State:"+person.State+"\t"+"City:"+person.City);
}

Initial URL

                                

Initial Description

                                

Initial Title
WCF service usage without adding its refrence

Initial Tags

                                

Initial Language
C#