WCF 서비스를 사용하여 간단한 Silverlight 응용 프로그램을 만들었습니다. 내 서비스가 잘 만들어졌으며 wcftestclient의 도움을 받아 WCF 서비스가 제대로 작동하는지 테스트합니다. 서비스를 제공합니다. 실버 라이트에 대한 참조도 있지만 실버 라이트 어플리케이션을 실행할 때 결과를 얻을 수 없습니다.내 Silverlight 응용 프로그램 WCF 서비스를 호출 할 수 없습니다.
여기에 여기에 실버 코드
void getdatacs(object sender, ServiceReference1.GetDataCompletedEventArgs e)
{
MessageBox.Show(e.Result);
}
private void button1_Click(object sender, RoutedEventArgs e)
{
ServiceReference1.Service1Client cs = new ServiceReference1.Service1Client();
cs.GetDataCompleted += new EventHandler<ServiceReference1.GetDataCompletedEventArgs>(getdatacs);
cs.GetDataAsync(Convert.ToInt32(textBox1.Text));
}
하고하는 것은
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
어떤 몸은 내가 결과를 얻을 수없는 나에게 Y를 알 수 있습니다 내 WCF 코드입니다.
예외가 있습니까? – tomasmcguinness
번호. 내가 SL 응용 프로그램을 실행하면 브라우저의 하단에 아무 것도 일어나지 않는다. 로컬 호스트에 연결이 ... – Raj
Synchronously 메서드를 호출 해 보았습니까? Silverlight를 실행하는 동안 서비스가 실행 중입니까? – tomasmcguinness