c# - HTTP to HTTPS silverlight wcf cross domain issue -


i've been looking on site , on stack overflow , can solve issue.

network setup

the way network on staging world have clients looking @ web app on 443 port - https, underlying structure listening on 80 port - http. when apps talk each other on port 80, when clients visit site port 443. example, svc called silverlight on port 80.

i should point out on staging , test domains: have web server acting portal app server; shouldn't matter since able working on test. it's staging has http forwarding https.

application

i have silverlight xap file on same domain hosted web application using iis 6.

now since silverlight xap file , web application on same domain, have no problems running on dev , test, when try deploy staging i'm getting weird cross domain reference problem:

"system.servicemodel.communicationexception: error occurred while trying make request uri . due attempting access service in cross-domain way without proper cross-domain policy in place, or policy unsuitable soap services."

digging around, realize app thinks xap (or service i'm calling) , web app on different domain, , looks crossdomain.xml , clientaccesspolicy.xml files automatically, can't stop it. however, in application, not case. both reside on same domain. have used fiddler , didn't see domain or subdomain matter.

browser issues

another weird thing found out issue chrome vs ie: on chrome finds crossdomain.xml , clientaccesspolicy.xml telling me insecure, fetch https side, signalling 404 error. however, on ie i'm getting 302 redirect. on microsoft's doc clientaccesspolicy.xml aren't supposed redirects xml file; mentioned here: http://msdn.microsoft.com/en-us/library/cc838250(v=vs.95).aspx

so question is, if app , xap on same domain, why xmls trying fetched? because i'm using dns instead of ip address? stumbled upon site: http://msdn.microsoft.com/en-us/library/ff921170(v=pandp.20).aspx

it states: avoid cross-domain call issues, remote modules' xap files should located on same domain main application; when deployed this, ref property on modulecatalog should uniform resource identifier (uri) relative main xap file location on web server.

what mean??

edit

okay changed services point https instead of http. new error comes out: provided uri scheme 'https' invalid; expected http.

the thing is, doesn't check crossdomain.xml or clientaccesspolicy.xml; realizes it's on same domain. it's expecting service on port 80, name has follow https:// in order work.

i think solution have break off being virtual directory, make root node of own website, , make whole thing 443. save myself headache.

it sounds you're working in environment there load balancer offloading ssl traffic. in situation, client(silverlight) needs configured https , server must configured http. because device between 2 parties decrypting ssl data.

in situations this, aside normal client , server side configurations, server side code needs bit more forgiving address of request.

you need add attribute service implementation allow client call on https, have service listening on http.

add service:

[servicebehavior(addressfiltermode = addressfiltermode.any)] 

this allows client call https://my.domain.com/service.svc , have server live @ http://my.domain.com/service.svc.

here links might well:

http://social.msdn.microsoft.com/forums/vstudio/en-us/b5ae495b-f5fb-4eed-ae21-2b2280d4fec3/address-filter-mismatch-wcf-addressing

http://www.i-m-code.com/blog/blog/2011/11/30/hosting-silverlight-over-http-under-f5-big-ip/

http://www.i-m-code.com/blog/blog/2011/08/18/hosting-silverlight-under-https/


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -