Skip to main content

Microsoft Silverlight

Answered Question Post Failed - Security Error RSS Feed

(0)

Rajeev BV
Rajeev BV

Member

Member

17 points

38 Posts

Post Failed - Security Error

Hi,

I'm getting this error (Post Failed - Security Error) when I'm getting the response back from Apache Server. There is a security exception thrown on the line response = request.EndGetResposne(ar); I'm using Silverlight Release 2 version. VS 2008 SP1

Request:

HttpWebRequest request =

WebRequest.Create(new Uri("http://132.186.192.84/WebDicomViewer/convertandgetxaml.php"))

as HttpWebRequest;

request.Method = "POST";

private void ResponseCallback(IAsyncResult ar)

{

HttpWebRequest request = ar.AsyncState as HttpWebRequest;

WebResponse response = null;

try

{

response = request.EndGetResponse(ar);

}

catch (WebException we)

{

statusString = we.Status.ToString();

}

catch (SecurityException se)

{

statusString = se.Message;

if (statusString == "")

statusString = se.InnerException.Message;

}

// Invoke onto UI thread

syncContext.Post(ExtractResponse, response);

}

Any reasons?

 

meshiach
meshiach

Member

Member

50 points

17 Posts

Re: Post Failed - Security Error

Perhaps

request.ContentType = "text/plain";

 

------------------------------------
If this post has solved your problem, please select ‘Mark as answer’

Thanks

Adlai Maschiach
http://blogs.microsoft.co.il/blogs/adlaim/

meshiach
meshiach

Member

Member

50 points

17 Posts

Answered Question

Re: Post Failed - Security Error

Another option could be

WebRequest.Create(new Uri("http://132.186.192.84/WebDicomViewer/convertandgetxaml.php"),UriKind.Absolute)

as HttpWebRequest;

------------------------------------
If this post has solved your problem, please select ‘Mark as answer’

Thanks

Adlai Maschiach
http://blogs.microsoft.co.il/blogs/adlaim/

laxmikantha
laxmikantha

Member

Member

28 points

12 Posts

Re: Post Failed - Security Error

Hi, 

I am also facing the same proble. My php file is simple php returning a string. The content is like

 <?php
echo 'teststream';
?>

and it is residing in my apache server. If I run it on the browser (url is like- http://xxx.yyy.zzz.mm/1.php), it displays the string.

I am expecting the string 'teststream' to be apper on the text box in response to button click event. I am using the same code as Rajeev posted. The same code working fine previous version of silverlight

regards,

Laxmikanth

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities