Galera tenho a seguinte aplicação simples só para teste de comunicação...
preciso comunicar c para continuar:
clientaccesspolicy.xml :
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<!--
Habilitar para todos os clientes
<domain uri="*"/>
-->
<domain uri="http://localhost:4532/" />
</allow-from>
<grant-to>
<resource path="/"
include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
CrossDomain.xml :
<?xml version="1.0" encoding="utf-8" ?>
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
XALM
<UserControl x:Class="SilverlightApplication9.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="956">
<Grid x:Name="LayoutRoot" Background="White">
<TextBox Height="23" HorizontalAlignment="Left" Margin="143,140,0,0" Name="textBox1" VerticalAlignment="Top" Width="575" />
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="724,140,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
</Grid>
</UserControl>
MAINPAGE.XALM.CS :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Browser;
namespace SilverlightApplication9
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
}
private void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error == null)
{
try
{
textBox1.Text = e.Result;
return;
}
catch
{
textBox1.Text = "Não funcionou!";
return;
}
}
else
{
textBox1.Text = "Não funcionou com erros!";
}
}
private void button1_Click(object sender, RoutedEventArgs e)
{
Uri address = new Uri("http://localhost:4532");
WebClient client = new WebClient();
client.DownloadStringCompleted += client_DownloadStringCompleted;
client.DownloadStringAsync(address);
}
}
}
Mesmo Assim acontece o Erro.
Lembrando WebService em Delphi.