I am having a silverlight pivotviewer control in a sharepoint page. This Pivotviewer talks to a web service hosted under sharepoint to fetch cxml/dzi/dzc. Everything is fine as long as its in http. Once on https - the CXML and dzc responses come out fine, but the dzi never happens - no images come up.Can anyone let me know why this is happening - and how to fix this?
Note: The Image directory is also under the same Sharepoint site - its a virtual directory. So even this is under ssl. If I configure the image path {for forming dzi} to another http virtual directory, everything works fine. But it simply doesn't work for a https virtual directory under the SP site.
This should definitely work as I've done exactly that (using https) for http://percollate.com. Is it possible that https is bound to something unexpected on your IIS server? Have you tried using Fiddler to see what's happening?
Related
I'm sending simple messages to Google Analytics from a Silverlight app. They look something like this (data changed):
http://www.google-analytics.com/collect?v=1&tid=foobar&cid=foobar&t=pageview&dp=foobar&dt=foobar
Very simple API. If I use HTTP it works beautifully.
If I use HTTPS, I run afoul of Silverlight's cross domain policies. According to the docs, google-analytics.com needs to approve the cross-domain call by hosting either a clientaccesspolicy.xml (Silverlight-specific) or crossdomain.xml (original used by FLASH). Turns out they do host crossdomain.xml, and I can see that Silverlight downloads it (via Fiddler), but apparently Silverlight doesn't like the file's content and doesn't allow HTTPS calls to that domain (System.Security.SecurityException).
So.. at least at the moment, I can't use Google Analytics from Silverlight using HTTPS. Does anyone know a work around for this issue?
Note, I can't just use HTTP, because that causes IE to issue a "Allow Mixed Content" prompt which causes problems for some of our customers. I need to use HTTPS like the rest of our app.
EDIT: OK, I took a totally different approach, using HtmlPage.Window.Invoke to call a 3 line Javascript function to do the asynchronous send rather than using WebClient in the Silverlight code. Works like a champ. Anybody see any potential problems with that?
I suspect there may be a way to make this work, because I know google-analytics.com is very cross-domain friendly for exactly this reason.
If you absolutely can't get it to work another option would be to proxy the hits. If you do this, you'll want to make sure to use the ua and uip override fields in the hit you're sending so that they show up in Google Analytics with the IP address and User Agent of the original visitor and not your server.
Here's some more info on using a proxy server with the Measurement Protocol:
https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#using-a-proxy-server
The Application
In short, the application surfaces data from a backend onto a web page. The client application is a Single Page Application made using AngularJS. It calls an ASP.NET Web API service located on a different domain to retrieve the data. I utilize BreezeJS on both the client application and the web service to manage this data. The client is hosted on a SharePoint Online site, and the service is hosted on IIS7.
The Error
I encounter an "Access is Denied" error when AngularJS attempts to make an XMLHttpRequest.open() call targeting this web service. However, though this seems like a simple CORS issue, it has some peculiarities which have me stumped:
Foremost, this error only occurs when using Internet Explorer 11 (or a previous version). When the application is viewed in Chrome or Firefox, it can connect and retrieve data from the service.
The web service is configured to accept the calling origin.
No network traffic is detected either by the native IE development tools or by Fiddler.
Specifically, the line: xhr.open(method, url, true); of the angular.js file throws this error.
Does anyone have any insight as to why this error occurs?
Also, if more specific details are needed I certainly can provide them. I'm not even sure where the issue might be coming from and I don't want to dump tons of irrelevant lines of code.
I think that this is due to using "localHost", i.e when attempting to access a resource in the "Local intranet" zone from an origin in the "Internet" zone.
See: Access denied in IE 10 and 11 when ajax target is localhost
This is not just a localhost issue as previously suggested. I have a production AngularJS application that is trying to POST to a public Web API 2 on a different domain. IE11, Chrome, and Firefox work without a hitch when the site is accessed externally. When accessing from a subnet that can talk directly to those servers, I get Access Denied and IE doesn't even send the request (Chrome and Firefox work flawlessly, of course. One workaround (I refuse to call this a fix) is to add the site as a Trusted Site in IE11. Even when the security settings for Internet mirror the settings for Trusted Site, I get access denied. I have to add the site on each internal IE system to gain access.
I am one of 2 developers on a silverlight project that is hosted online. The problem is that i seem to randomly have problems with our webservices not working (This never happens to my colleague).
Using firebug, i had a look at any problems that it was reporting and i found this:
GET clientaccesspolicy.xml 404 not found
GET crossdomain.xml 404 not found
Any ideas why only i have a problem with like this?
We have both cleared out our cache and recycled the application pool of the webserver... no joy.
Thanks,
Kohan
So the webserver intermittently returns 404 errors on the policy file? What version IIS?
If your colleague never gets the error, compare the request headers between his system and yours to be sure there isn't something weird going on.
If the policy file is hosted by a provider and you're getting intermittent 404 errors you should put in a ticket with the provider.
This happens when the client attempts to connect to a domain on which it is not hosted. The policy files are used to grant access to that server from the SL client.
Are you both running the client from the same location? Double check your proxy settings and hosts file too.
Found out the problem came when accessing the site without typing "www."
I should have known to check that first. :(
I made a simple Silverlight app, with a web service calling a database, and got it to work on my development computer.
When I published the web service project to IIS, on the same computer, and accessed the Silverlight app from IIS using http://localhost/SilverlightTest/, I could see the Silverlight in the page, but the call to the web service was not working.
So I added the file clientaccesspolicy.xml in several places. All of the instructions say to put it in the root directory, so I tried:
c:\inetpub/wwwroot\ Did not work
c:\webs\SilverlightTest\ This the folder to which I published the web service project, including the xap file. But did not work
c:\webs\ Just a guess, but that did not work.
Then, in VS, I added the file to the web service project, and that added it to the folder where the web service project is stored c:\work\Silverlight\TestWCF\TestWCF.Web\ . When I opened the page in Firefox from IIS, the call to the web service now worked. Apparently, the Silverlight application is calling the web service in my development folder, not the service in the IIS virtual directory c:\webs\SilverlightTest\ (He call to the web service did not work when I opened the page from a different computer in the workgroup)/
Why would the Silverlight application call a web service in a development folder? Shouldn't the web service be in the virutal directory to which it was published? How can I resolve the confusion?
Here is the configuration in my ServiceReferences.ClientConfig file
<client>
<endpoint address="http://dellnov2006:2753/SimpleWCF.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ISimpleWCF" contract="SimpleWCF.ISimpleWCF"
name="BasicHttpBinding_ISimpleWCF" />
Any help, explanation, or pointers to relevant articles would be greatly appreciated. An article explaining how Silverlight apps call web services would be greatly appreciated.
Thanks
Mike Thomas
In your config file, the endpoint address is http://dellnov2006:2753/SimpleWCF.svc
So it seems that you are trying to connect to that address.
Before you publish the application you must modify that address to http://localhost/Service/SimpleWCF.svc or something to point exactly to your service.
The clientaccesspolicy.xml must be in **c:\inetpub\wwwroot** But you need this file only if you will access the service from different host that it was downloaded. I don't think you need it in your case, if you want to use localhost on the local iis.
The address in the ClientConfig is the address of the service you "Added Service Reference" against. As you noticed, it's not a relative path. To overridde this behavior, specify the URI of the address in the constructor of the Service client.
Also, you really need Fiddler. You'll love it. It helps with these issues as well as cross domain issues.
Many thanks djjoyro. You were right. Changing the config file to:
endpoint address="http://MachineName/SilverlightTest/SimpleWCF.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ISimpleWCF" contract="SimpleWCF.ISimpleWCF"
name="BasicHttpBinding_ISimpleWCF"
worked, and without a client access policy file. This also worked when I accessed the Silverlight app from other computers in the workgroup.
I also tried using localhost instead of the computer name, but I did have to use a clientaccesspolicy file, and I could not access the web service when using other computers in the workgroup.
There is a lot more I need to know about this, but at least deployment is now working after several days of struggling.
Mike Thomas
Late to the party, but I will add that if your binding address includes a port #, then you are still using the Visual Studio web server. http://dellnov2006:2753 is a dead giveaway that you still using the VS web server and not IIS as you intended.
I've got a Silverlight application which uses a built-in .ASMX WebService to access a SQL database and run some queries. Everything runs without any hitches on my Development machine.
I'm trying to deploy the application to IIS 6 and I'm having some issues.
The Silverlight application itself seems to run fine, however the Web Service does not. I get an unhandled exception error that says [Async_ExceptionOcurred] as soon as the page loads (when the page loads I'm making some Async WebService method calls).
I think this is an issue with the Web Service but I don't know what the problem is. I tried setting the WebService namespace to my URL, but that didn't work. I've tried messing with the SQL connection string in my Web Config but that also affects nothing.
One thing to note is that my IIS Virtual Directory only contains my SilverlightApp.Web folder. I know that the other folder that's part of the application contains a .ClientSettings file for the WebService, but I think this is embedded into the .xap.
Can anyone shed any light on this?
The most likely thing that's happening:
Your webservice proxy on the client is using the address of the web service it was built against: ("http://localhost...").
Things to do:
Use fiddler to confirm this is the issue. It will show you where the proxy is making the call to.
Use the overloaded constructor for the web service and specify a URI. Consider using id/deffing for debug/release. This will overwrite the settings in the client.config.
Create another endpoint in the client config for the release build (Shawn's article here) and select one or the other (again using if/defs).
There are other options as well (looking at the URI and building up the service adress)... but that's the general idea.
hth,
Erik