locked
sliverlight site getting wrong database details RRS feed

  • Question

  • Hi

    I have recently been asked to copy a Silverlight website on a development space. I was sent a zip of all the files plus a db dump.  I set up a new db, set the mime types and uploaded all the files. I put all the site db details into mysite/_config.php

    its probably 2.2 or 2.3 - yes I know its old!

    When I turned on error reporting I see that the db connection script looks like its getting its connection details from the old site. Somehow it looks like the site is being directed back to the _config.php file on the live server rather than on my testing one.

    Is there a setting somewhere that tells the installation what the domain is that it is sitting on. I have looked and I can't find it.

    I'd really appreciate any help

    Thanks


    Edward

    Thursday, March 12, 2015 6:58 PM

All replies


  • Hi,

    Please make sure you have change the connecting string in the new project.

    Here is an article talks about it :

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms722656(v=vs.85).aspx

    Besides, you could try to refer:

    http://www.codeproject.com/Articles/44684/Basic-Database-Operations-in-Silverlight

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    Friday, March 13, 2015 7:33 AM
  • Hi thanks for your reply - I really appreciate it.

    I can't find anything in the website that looks like it would fit with either of those help files.

    I tried doing sitewide searches for connectionString - nothing.

    Anymore ideas - something is sending it to the wrong domain


    I should say its running on an apache/Linux setup
    • Edited by maxelcat Friday, March 13, 2015 8:42 AM
    Friday, March 13, 2015 8:39 AM
  • You have a Silverlight web site therefore this is presumably an in browser application?

    Silverlight with say wcf ria uses web services which are served from the same site which hosted the page serving the xap.

    You can, however, conceivably do cross domain web services and be using rest or something with a specific url for the web calls.

    I can't think of a good reason to do that but then I do Microsoft stack and I don't do php.

    Your answer could well lie in the Silverlight code.

    Do you have that?


    Hope that helps.
    Recent Technet articles: Property List Editing; Dynamic XAML

    Friday, March 13, 2015 8:48 AM
  • Thanks Andy

    I have all the code for the website which the last developer sent. (He is closing his server so we have to move.) The existing site is still live so we are trying to get it set up on another server with a different domain, and then repoint the correct domain.

    I have searched through the whole code for the exisiting domain jammdesign.co.uk - and it doestn' come up. I thought it might be in the db somewhere (Like in wordpress) but I can't find it.

    I don't know what else to try really - other than hope it all comes good when the domain moves.

    Friday, March 13, 2015 10:20 AM
  • Hoping it just works... that's not the way to go.

    Take a look at the services registered in silverlight.

    In visual studion these will usually be in a Service References tree just under References of your silverlight project.

    Pick one and see how it connects.

    Pobably be clearest in the .wsdl file.

    The top of an imag eupload service I have to hand and part of it looks like

      <wsdl:service name="ImageUploadService">
        <wsdl:port name="BasicHttpBinding_IImageUploadService" binding="tns:BasicHttpBinding_IImageUploadService">
          <soap:address location="http://localhost:5606/ImageUploadService.svc" />
        </wsdl:port>
      </wsdl:service>

    That says go use the service from the site that served the xap.

    If you have a domain name or ip address there then that could well be a problem.

    You might find he's dynamically building a connection though.

    I guess his app won't be a regular one hosted in asp.net because you're talking php.

    It has to use some sort of web service though - silverlight lives in a browser sandbox and can't just reach out and update a db itself.


    Hope that helps.
    Recent Technet articles: Property List Editing; Dynamic XAML

    Friday, March 13, 2015 2:12 PM
  • Many thanks for your reply - and you're right of course, hoping isn't the way

    I have no experience of Sliverlight or visual studio. As far as I can see I have a pile of website files in php and js.

    You suggest 'Take a look at the services registered in silverlight.' - how do I do that from a pile of files?

    I tried searching through for some extracts of the code you supplied - no joy.

    I also searched out 'http' which gave 1000s of replies. The I did baseurl and anything that looked vaguely like it was making the url. Again, 100s of results.

    Last thing I have tried is looing up the ip for the live version. Again, no joy. I looked up 'accessing services in Silverlight' and there are pages and pages of links.

    Do you suppose there is a quick fix for this?

    Saturday, March 14, 2015 12:44 PM
  • You could phone that last developer and ask him.

    .

    Silverlight isn't php.

    It's sort of .net.

    Do you definitely have a .xap file there?

    When I go to your url and poke about a bit I see html.

    I didn't spend much time looking but I don't see any Silverlight there.

    .

    There are two possibilities.

    Broadly speaking, that is.

    You have services called on your server which may use a web.config or whatever the php equivalent is to point to where the data is supposed to be.

    If you have a config file, take a look at it.

    In the web.config for my site here I have this line:

    <connectionStrings> <add name="blaaEntities" connectionString="metadata=res://*/blaa.csdl|res://*/blaaModel.ssdl|res://*/NblaaModel.msl;provider=System.Data.SqlClient

    ;provider connection string=&quot;

    data source=localhost;initial catalog=blaa;persist security info=True;user id=sa;password=blaa;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" /> </connectionStrings>

    Where that localhost is there you could have an ip address or a server name or something instead.

    If you find something like that then you can just change it because it's plain text.

    .

    The other option is that the developer does something in the Silverlight app to connect.

    If he does that then I could fix it but I'm rather doubtful about someone who isn't a dev messing with that sort of thing.


    Hope that helps.
    Recent Technet articles: Property List Editing; Dynamic XAML

    Saturday, March 14, 2015 2:04 PM
  • Hi again.

    the url for this site is c6704767.myzen.co.uk

    I added mime types:

    AddType application/x-silverlight-app .xap
    AddType application/x-ms-xbap .xbap
    AddType application/xaml+xml .xaml

    into the .htaccess.

    |There is no web.config but I have _config.php which has nothing with urls in it

    Apart from db connect stuff this is all that's in the _config.php

    // Set the site locale
    i18n::set_locale('en_US');

    // enable nested URLs for this site (e.g. page/sub-page/)
    SiteTree::enable_nested_urls();

    Object::add_extension('SiteConfig', 'CustomSiteConfig');

    //Make a data objects sortable (for DOM)
    SortableDataObject::add_sortable_classes(array(
     'Project',
     'Testimonial'
    ));

    I have asked the dev for help but he wasn't really very keen...

    Saturday, March 14, 2015 3:31 PM
  • Do you have source code?

    That url didn't work for me, btw.


    Hope that helps.
    Recent Technet articles: Property List Editing; Dynamic XAML

    Saturday, March 14, 2015 8:41 PM
  • HI -

    I have set

    Director::set_environment_type("dev");

    so you can see the errors again.

    Like I said, I have all the files for the site. Be very happy to share any of them you might want to see (there seem to be at least 100 though)

    Thanks again!

    Sunday, March 15, 2015 5:52 PM