[RESOLVED] Deploy to webserver-VBForums
Results 1 to 30 of 30

Thread: [RESOLVED] Deploy to webserver

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Resolved [RESOLVED] Deploy to webserver

    Hi,
    this is the structure I have:
    The development is done on my machine as follows:
    using VS2010, silverlight 4
    1- Silverlight application is created as a project
    2- silverlight app has service references to the wcf project
    3- web project is a simple project which has the clientbin folder and a default.aspx page
    When running the .sln on my machine, all works fine.
    I have copied the entire folders for both my wcf and web projects from my local machine into the c:\inetpub\wwwroot of the webserver (Windows server 2003).
    on the web server, created two virtual directories. One for the web and one for the wcf project. each points to the appropriate folder under c:\inetpub\wwwroot
    I made sure the endpoints in the file Servicereferences.ClientConfig under the wcf project in the webserver is pointing to the webservername:80
    The webserver does have the correct mime file type i.e. .xap
    I have also added the domain policy files onto webserver machine's C:/inetpub/wwwwroot/
    In IIS, under the web project virtual directory, when I right click, browse, then it says "Page can not be found"
    What have I done wrong please?
    Thanks

  2. #2
    Frenzied Member MattP's Avatar
    Join Date
    Dec 2008
    Location
    WY
    Posts
    1,227

    Re: Deploy to webserver

    A guess would be that IIS isn't set up to handle Silverlight MIME types.

    Configuring a Web Server to Host Silverlight Content

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    Thanks for the link BUT I alerady have these files as mime types.
    I wonder if this error could be to do with running .net 4 application in windows server 2003 ?
    Thanks

  4. #4
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Silly question, but let's just rule it out....

    Do you have .Net Framework 4.0 installed on the server?

    Gary

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    Hi,
    I can now browse to the site but it only shows pages with empty controls. This
    Tells me that maybe the wcf part does not get data. How do I solve this?
    Thanks

  6. #6
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Hey,

    What did you have to do to get to this point?

    Have you tried running Fiddler while accessing your page? Are there any errors?

    Have you tried using the WcfTestClient to connect to the endpoint, and execute the methods on there?

    Gary

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    I changed the service extensions in IIS in webserver to allow asp.net 4
    Now when browse to the server i.e.
    http://webserverfullname/sitename/defaultpage.aspx it shows the page but with no data in it
    Not sure how to soove this now.
    Any thoughts?
    Thanks

  8. #8
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Hey,

    Did you try what I suggested? Use the WcfTestClient to connect to the WCF Endpoint, and execute one of the methods that you are using. Make sure that the data is coming through.

    Gary

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    by wcftestClient, do you mean to create a windows app which calls the wcf?

  10. #10
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    No, that would be too much like hard work

    There is a built in WCF Test Client that you can use. You should be able to find it here:

    Code:
    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WcfTestClient.exe
    If it isn't in there, if you do a search for WcfTestClient, you should be able to find it.

    Gary

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    By the way, I am running vs2010 silverlight 4
    Shall I still go ahead with the wcftestclient path you suggested?

  12. #12
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Hey,

    I think it is still worth it yes. You need to figure out where the problem lies, and testing the WCF End Point directly means that you can rule that out, and from there you need to look at the Silverlight application.

    Gary

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    Quote Originally Posted by gep13 View Post
    No, that would be too much like hard work

    There is a built in WCF Test Client that you can use. You should be able to find it here:

    Code:
    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WcfTestClient.exe
    If it isn't in there, if you do a search for WcfTestClient, you should be able to find it.

    Gary
    I found the .exe under vs 10
    I am trying to add service. It says please enter the endpoint address.
    What do I enter in there exactly?

    The endpoint I know of is the one in servicesreferences.clientconfig file in the silverlight application project
    i.e.
    <endpoint address="http://webserverfullname:80/DM.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IDM"
    contract="FMService.IDM" name="BasicHttpBinding_IDM" />

  14. #14
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Hey,

    Enter this:

    Code:
    http://webserverfullname:80/DM.svc
    Gary

  15. #15

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    When pointing to a service on my local machine it works fine
    BUT pointing to the webserver service shows the following message:

    Error: Cannot obtain Metadata from http://webserverfullname/DM.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?Link...55.WS-Metadata Exchange Error URI: http://webserverfullname/DM.svc Metadata contains a reference that cannot be resolved: 'http://webserverfullname/DM.svc'. There was no endpoint listening at http://webserverfullname/DM.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found.HTTP GET Error URI: http://webserverfullname/DM.svc There was an error downloading 'http://webserverfullname/DM.svc'. The request failed with HTTP status 404: Not Found.

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    Quote Originally Posted by gep13 View Post
    Hey,

    Enter this:

    Code:
    http://webserverfullname:80/DM.svc
    Gary
    I was not using the correct path.
    But now the error is:
    The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

    Server stack trace:
    at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

  17. #17

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    Using the testclient tool you suggested, I can access one of the methods inside the service as it calls an xml file to get data from inside the xml file.
    But the errors are caused from the methods that connect to the sql server.
    Could that be the reason? how can I find the exact issue?
    Thanks

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    Hi gary,
    Looking at logs, it says login failed for user 'domain\webserverfullname$'
    Note that the connectionstring in the webconfig uses windows integrated security
    Any t houghts on how to solve this please?
    Thanks

  19. #19
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Hey,

    I think this is a good candidate for the problem yes.

    Have you updated the connection string to point to the correct SQL server for this installation?

    What exactly is the error?

    Gary

  20. #20
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Quote Originally Posted by arkiboys View Post
    Hi gary,
    Looking at logs, it says login failed for user 'domain\webserverfullname$'
    Note that the connectionstring in the webconfig uses windows integrated security
    Any t houghts on how to solve this please?
    Thanks
    This would suggest that the current user doesn't have access to the database. Have you verified that they do have access? Is this a database server that you have full control over?

    Gary

  21. #21

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    Gary,
    I have just been told that we can only access the sql server using the integrated security as the sql authentication is disabled.
    May be to solve this problem I can make the wcf which is now hosted on the webserver to run under the account that the site is logging in as ?
    May be I should check the settings on the virtual directory of the wcf ?

    The message is:
    22/12/2010 10:27:42 - Connection --> Data Source=sqlservermachinename;Initial Catalog=my database;Integrated Security=true
    22/12/2010 10:27:42 - --------------
    22/12/2010 10:27:42 - System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'domain\webserverfullname$'.

  22. #22
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Yip, that sounds like a plan.

    Gary

  23. #23

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    How do i make the wcf service (Which is hosted in the webserver) to run under a specific account?
    At present it as enable anonymous access checked as well as integrated windows authentication.
    Thanks

  24. #24
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Hey,

    You can change the identity of the Application Pool that is hosting the WCF Endpoint.

    Gary

  25. #25

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    Now the error is:

    The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

    Server stack trace:
    at System.ServiceModel.Channels.HttpInput.ThrowMaxReceivedMessageSizeExceeded()
    at System.ServiceModel.Channels.HttpInput.GetMessageBuffer()
    at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
    at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception& requestException)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(T imeSpan timeout)
    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    at IDM.GetAllNames()
    at DMClient.GetAllNames()

    Inner Exception:
    The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

  26. #26
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Hey,

    This suggests that the data being returned is too much for the WCF Contract that has been created. If you look in the config file for the WCF EndPoint, as well as your client, you should find the value of 65536. If you increase this to a higher number, it should start to work.

    Gary

  27. #27

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    The data returned is only 1300.
    i think you are referring to the config file of the wcftest tool you pointed me to, right?

  28. #28
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    The MaxReceivedMessageSize can be specified on both the client and the server, i.e. the maximum amount that can be sent, and that can be received, so you have to set it on both sides. I typically make these the same value.

    Gary

  29. #29

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    Re: Deploy to webserver

    On the server, you mean the wcf project ?
    On the client, you mean the servicereferences.clientconfig in the silverlight application project?

  30. #30
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,961

    Re: Deploy to webserver

    Correct.

    Or in the case of the WcfTestClient, it's config file, as you mentioned before.

    However, now that you have the WcfTestClient returning this error, have you tried the Silverlight application again?

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.