SilverLight dan Webservis'e erişim |
Yanıt Yaz |
Yazar | |
murat turan
Üye Profili
Özel Mesaj Yolla
Bu kullanıcıya ait mesajları bul
Üyenin Web Sitesie Git
Arkadaş Listeme Ekle
Admin Group Datakent Kayıt Tarihi: 01.Ekim.2003 Bulundugu Yer: Turkey Online: Sitede Değil Gönderilenler: 1798 |
Alıntı Cevapla
Konu: SilverLight dan Webservis'e erişim Gönderim Zamanı: 29.Nisan.2012 Saat 18:06 |
SilverLight ve WPF 'den webservis'e erişirken ilk aşamada aşağıdaki hata benzeri hata alabilirsiniz. ISS'in wwwroot klasörüne aşağıdaki isimlerdeki dosyaları oluşturun. (varsayılan yol: C:\inetpub\wwwroot ) 1. dosya adı: clientaccesspolicy.xm <?xml version="1.0" encoding="utf-8"?> <access-policy> <cross-domain-access> <policy> <allow-from http-request-headers="SOAPAction"> <domain uri="*"/> </allow-from> <grant-to> <resource path="/" include-subpaths="true"/> </grant-to> </policy> </cross-domain-access> </access-policy> 2. dosya adı: crossdomain.xml <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-http-request-headers-from domain="*" headers="SOAPAction,Content-Type"/> </cross-domain-policy> akabinde web servis'e erişebilirsiniz. Erişim örneği: private void button3_Click(object sender, RoutedEventArgs e) { ServiceReference1.WebServiceSoapClient xx = new ServiceReference1.WebServiceSoapClient(); xx.testxCompleted+=new EventHandler<ServiceReference1.testxCompletedEventArgs>(xx_testxCompleted); xx.testxAsync(textBox1.Text); } void xx_testxCompleted(object sender, ServiceReference1.testxCompletedEventArgs e) { if (e.Error == null) { textBox1.Text = e.Result; } else { label1.Content = e.Error.ToString(); } } Düzenleyen murat turan - 29.Nisan.2012 Saat 18:07 |
|
Yanıt Yaz |
Forum Atla | Forum İzinleri Kapalı Foruma Yeni Konu Gönderme Kapalı Forumdaki Konulara Cevap Yazma Kapalı Forumda Cevapları Silme Kapalı Forumdaki Cevapları Düzenleme Kapalı Forumda Anket Açma Kapalı Forumda Anketlerde Oy Kullanma |