Maltra

Hello,
I have this problem:
I have create an application xbap and web service for passed a dataset.
This is WebService passed DataSet
[WebMethod]
public DataSet caricaTutti()
{
// crea un oggetto DataSet (serializzabile via SOAP)
DataSet result = new DataSet();
// gli aggancia la DataTable tornata dalla DB library
result.Tables.Add(dsa.CaricaTutti());
return result;
}
This is Xbap
public Page1()
{
InitializeComponent();

ws.ClientCredentials.SupportInteractive = true;


try
{
Griglia.DataContext = ws.caricaTutti();
}
catch (Exception exc)
{
MessageBox.Show(exc.Message);

}

}
When run I have this error messageTongue Tiedystem.data.Webpermission.
How do I do for resolving this error
Thanks



Re: Windows Presentation Foundation (WPF) System.data.WebPermission xbap

Matt Galbraith

Hi,

A couple things to try...

- Is your web service being accessed via a port number that is less than 1024 (needs to be)

- Is your .xbap being deployed from a URL using the same port as your webservice (needs to be... so if you you access http://foo.com:123/bar.asmx, then your Xbap must also be launched from a URL starting with http://foo.com:123/... .

For debugging, you will hit security execeptions currently because the Site of Origin (SOO) is the local file system, which does not match the URL of the web service. To work around:

- Make your .xbap fully trusted while debugging (so that it can access any web service)

- Change your debugging options thusly: (unfortunately this feature isnt currently integrated with Visual Studio)

- Executable: %windir%\system32\PresentationHost.exe

- Arguments : " -debug <path to your .xbap> -debugsecurityzoneurl <base URL of http site your service is stored on>

Looking for forum posts from ChangoV on the same subject may also help you with some of the tricks of getting this scenario working.

Hope this helps,

Matt