PDA

View Full Version : Silverlight Webservices


rohito
02-21-2008, 07:20 AM
Has anyone tried setting up a webservice to communicate with silverlight (client side code) successfully?
Mine runs fine in the virtual development server (VS 2008), but has problems on the webserver.

Cheers!

vvsharma
02-21-2008, 09:42 AM
Can you provide a detailed error message?

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

Nikola
03-11-2008, 02:40 AM
I've got a similar issue (may be the same), below is my error message. Also go to http://nokolacom00.web701.discountasp.net/services/ (http://nokolacom00.web701.discountasp.net/services/)to see it. Any help is greatly appreciated! Maybe we have to run "ServiceModelreg -i in c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation " in order to install WCF correctly? I had similar issue on my local box and fixed it with the above command.

Please help!

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

<FIELDSET><LEGEND>Detailed Error Information</LEGEND>




Module
IIS Web Core

Notification
BeginRequest

Handler
Not yet determined

Error Code
0x800700b7

Config Error
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ScriptHandlerFactory'

Config File
\\?\E:\web\nokolacom00\htdocs\services\web.config




Requested URL
http://nokolacom00.web701.discountasp.net:80/services/

Physical Path
E:\web\nokolacom00\htdocs\services\

Logon Method
Not yet determined

Logon User
Not yet determined
</FIELDSET>

<FIELDSET><LEGEND>Config Source</LEGEND> 119: <remove name="WebServiceHandlerFactory-Integrated"/>
120: <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
121: <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</FIELDSET>

<FIELDSET><LEGEND>Links and More Information</LEGEND>This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.


View more information » (http://go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=500,19,0x800700b7,6001)</FIELDSET>

Nikola
03-11-2008, 02:40 AM
Note: this service works perfectly on my local machine

Nikola
03-11-2008, 02:58 AM
Sorry, I just redeployed everything at /, and when trying to access the service:


http://nokolacom00.web701.discountasp.net/ShockService.svc (http://nokolacom00.web701.discountasp.net/ShockService.svc)

I get this:


Server Error in '/' Application.


This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item

Source Error:






An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:






[ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item]
System.ServiceModel.UriSchemeKeyedCollection.Inser tItem(Int32 index, Uri item) +4564833
System.Collections.Generic.SynchronizedCollection` 1.Add(T item) +56
System.ServiceModel.UriSchemeKeyedCollection..ctor (Uri[] addresses) +120
System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +145
System.ServiceModel.Activation.ServiceHostFactory. CreateServiceHost(Type serviceType, Uri[] baseAddresses) +28
System.ServiceModel.Activation.ServiceHostFactory. CreateServiceHost(String constructorString, Uri[] baseAddresses) +323
System.ServiceModel.HostingManager.CreateService(S tring normalizedVirtualPath) +516
System.ServiceModel.HostingManager.ActivateService (String normalizedVirtualPath) +31
System.ServiceModel.HostingManager.EnsureServiceAv ailable(String normalizedVirtualPath) +498

[ServiceActivationException: The service '/ShockService.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item.]
System.ServiceModel.AsyncResult.End(IAsyncResult result) +4413209
System.ServiceModel.Activation.HostedHttpRequestAs yncResult.End(IAsyncResult result) +183
System.ServiceModel.Activation.HostedHttpRequestAs yncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +205
System.ServiceModel.Activation.HttpModule.ProcessR equest(Object sender, EventArgs e) +322
System.Web.SyncEventExecutionStep.System.Web.HttpA pplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&amp; completedSynchronously) +64






Version Information:Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434 <!--
[ArgumentException]: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item
at System.ServiceModel.UriSchemeKeyedCollection.Inser tItem(Int32 index, Uri item)
at System.Collections.Generic.SynchronizedCollection` 1.Add(T item)
at System.ServiceModel.UriSchemeKeyedCollection..ctor (Uri[] addresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory. CreateServiceHost(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory. CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.Host ingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.Host ingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.Host ingManager.EnsureServiceAvailable(String normalizedVirtualPath)
[ServiceActivationException]: The service '/ShockService.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item.
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAs yncResult.End(IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAs yncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext)
at System.ServiceModel.Activation.HttpModule.ProcessR equest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
--><!--
This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->

Nikola
03-12-2008, 08:16 AM
ok everything works for me now...i created a new web site in vs (New -> web site from solution, then selected WCF service), then created a custom factory for it, and added a silverlight link

jmagaram
05-29-2008, 04:20 AM
i am getting the same error though my service has nothing to do with silverlight.
i createdthe "WCF Application" in Visual Studio 2008 with dependency on .net 3.5.
the WCF service works on my local machine but i can't get it to work on discountasp.net.
i published my service to a new IIS application folder. when i browse to it i get...

Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ScriptHandlerFactory'
134: <remove name="WebServiceHandlerFactory-Integrated"/>
135: <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
136: type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

you might be able to see the same error at http://www.timesupkidz.com/operations/service1.svc

i have no idea how to fix this problem.

jmagaram
05-29-2008, 04:27 AM
i deleted all the offending lines from the web.config. now i get...

This collection already contains an address with scheme http

jmagaram
05-29-2008, 04:42 AM
i then modified the web.config as follows, which seemed to fix the problem
when it was deployed to discountasp but causes it to fail on my dev machine.
i wish i didn't have to do any of this, esp when i don't understand what is going on.




<system.serviceModel>


<serviceHostingEnvironment>


[b]


<add prefix="http://www.timesupkidz.com/operations" />


</baseAddressPrefixFilters>