I am trying to upload files from react app to server via wcf service. The code is working fine on local server. The service is hosted on godaddy servers. When I try to upload file the server gives error 400 bad request. The code is working fine on local server and creating folder and saving the file in the right folder. What other details I should provide.
public void UploadFile(Stream stream)
{
MultipartParser parser = new MultipartParser(stream);
string uploadpath = HttpContext.Current.Server.MapPath("~/images/");
if (parser.Success)
{
string filename = HttpUtility.UrlDecode(parser.Filename);
File.WriteAllBytes(uploadpath + filename, parser.FileContents);
}
else
{
Console.WriteLine("error");
}
}
}
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.6.1" />
<httpRuntime targetFramework="4.6.1"/>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
<trust level="Full" originUrl=""/>
<customErrors mode="Off"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehaviors">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web" >
<webHttp></webHttp>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="largeMessage" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
<security mode="None"/>
</binding>
</webHttpBinding>
</bindings>
<services>
<service name="mailService.Service1" behaviorConfiguration="serviceBehaviors">
<endpoint address="" contract="mailService.IService1" binding="webHttpBinding" bindingConfiguration="largeMessage" behaviorConfiguration="web"></endpoint>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
<security>
</security>
</system.webServer>
</configuration>
The file size is not big 127kb only
Postman is showing that access denied to the path.
Changed the permission on the server for images folder and I worked.
Related
I am trying to upload an image file in base64 format from a angular app. The app is working fine for small images but wcf is giving error of entity too large error for images larger then 200kb. My webconfig file is like this.
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
</appSettings>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=LAPTOP-7JC2DRGE;Integrated Security=true;Initial Catalog=ExamDB" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehaviors">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web" >
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="ExamService.ExamService" behaviorConfiguration="serviceBehaviors">
<endpoint address="" contract="ExamService.IExamService" binding="webHttpBinding" behaviorConfiguration="web" ></endpoint>
</service>
</services>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ApplicationInsightsWebTracking"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
preCondition="managedHandler"/>
</modules>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>
I tried previous answers on this site but none seems to be working. I am using framework 4.6.
I suspect you need to add a binding element for the webHttpBinding binding and set maxReceivedMessageSize to something large. The default value is 65536 bytes.
This needs to be set in the system.serviceModel node in the web.config
Below is an example xml set to 5MB
<bindings>
<webHttpBinding>
<binding name="largeMessage" maxReceivedMessageSize="5000000" maxBufferPoolSize="5000000" maxBufferSize="5000000" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00">
<readerQuotas maxStringContentLength="5000000" maxArrayLength="5000000" maxBytesPerRead="5000000" />
<security mode="None"/>
</binding>
</webHttpBinding>
</bindings>
Could you try updating the services node to explicitely use the binding config (bindingConfiguration attribute equals the binding name attribute). I don't think this is really required as there is only one binding but lets try being explicit.
<services>
<service name="ExamService.ExamService" behaviorConfiguration="serviceBehaviors">
<endpoint address="" contract="ExamService.IExamService" binding="webHttpBinding" bindingConfiguration="largeMessage" behaviorConfiguration="web" ></endpoint>
</service>
</services>
UPDATE
Not sure whats going on here. I made a quick dummy service to replicate the problem.
namespace LargeMessageService
{
[ServiceContract]
public interface ILobService
{
[OperationContract]
[WebGet]
string EchoWithGet(string s);
[OperationContract]
[WebInvoke]
string EchoWithPost(string s);
}
public class LobService : ILobService
{
public string EchoWithGet(string s)
{
return "You said " + s;
}
public string EchoWithPost(string s)
{
return "You said " + s;
}
}
}
When I had a configuration without the binding defined it failed with a 413 as you are seeing. When I added the binding it worked. My full web.config with binding:
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.6.1" />
<httpRuntime targetFramework="4.6.1"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehaviors">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web" >
<webHttp></webHttp>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="largeMessage" maxReceivedMessageSize="5000000" maxBufferPoolSize="5000000" maxBufferSize="5000000" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00">
<readerQuotas maxStringContentLength="5000000" maxArrayLength="5000000" maxBytesPerRead="5000000" />
<security mode="None"/>
</binding>
</webHttpBinding>
</bindings>
<services>
<service name="LargeMessageService.LobService" behaviorConfiguration="serviceBehaviors">
<endpoint address="" contract="LargeMessageService.ILobService" binding="webHttpBinding" bindingConfiguration="largeMessage" behaviorConfiguration="web" ></endpoint>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
I was using IISExpress and calling it through Postman by calling the EchoWithPost operation with an xml.
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Hello</string>
replacing 'Hello' with a large string (approx 500K)
Try getting this one to work and if it does its a case of trying to work out the difference between this one and your one. Let me know how you get on.
I keep getting this error when debugging my WCF service in VS17
Buffer Exceeded limit error picture
However, I have gone through all of this before and it was working up until I re-installed VS. I double checked to make sure I was connected to my database in the ServerWindow and I definitely have the buffer set to more than 65536.
[EDIT] Also I have checked the client projects I have built that are referencing and consuming this service, just in case, they are all set to the same endpoint as is detailed in this app.config and their buffer sizes are set the same as this service as well.
Here is my app.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<system.web>
<compilation debug="true" />
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider"
type="System.Web.ClientServices.Providers.
ClientFormsAuthenticationMembershipPro vider, System.Web.Extensions,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider"
type="System.Web.ClientServices.Providers.ClientRoleProvider,
System.Web.Extensions, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<!-- When deploying the service library project, the content of the config
file must be added to the host's
app.config file. System.Configuration does not support config files for
libraries. -->
<system.serviceModel>
<services>
<service name="MBM.Services.MBMExtClientService">
<endpoint address="" binding="basicHttpBinding"
contract="MBM.Services.IMBMExtClientService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add
baseAddress="http://localhost:8733/Design_T
ime_Addresses/MBMServices/MBMExtClientService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
<!-- To receive exception details in faults for debugging
purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="LargeBuffer" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
I have an issue when deploying wcf service to remote iis,
first, I have vs solution contains two projects
WCF Library (ExchangeMailCore)
WCF Application(ExchangeMailService)
Inside my library project there is ExchangeEmailService.cs and ExchangeEmailService.cs files.
Then I included the library in ExchangeMailService project and created new .svc file as follows
<%#ServiceHost Language="C#" Debug="true" Service="ExchangeMailCore.ExchangeEmailService" %>
my web.config file as follows,
<?xml version="1.0"?>
<configuration>
<appSettings>
<!--<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />-->
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<system.web>
<!--<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>-->
<compilation debug="true" />
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<system.serviceModel>
<!--<bindings>
<basicHttpBinding>
<binding name="NetTcpBindingEndpointConfig">
--><!--<security mode="Message" />--><!--
<security mode="Transport">
<transport clientCredentialType="Windows">
</transport>
--><!--<message clientCredentialType=""/>--><!--
</security>
</binding>
</basicHttpBinding>
</bindings>-->
<!--<services>
<service name="ExchangeMailCore.ExchangeEmailService">
</service>
</services>-->
<services>
<service name="ExchangeMailCore.ExchangeEmailService">
<endpoint address="" binding="basicHttpBinding" contract="ExchangeMailCore.IExchangeEmailService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8734/Design_Time_Addresses/ExchangeMailCore/ExchangeEmailService/" />
</baseAddresses>
</host>
</service>
</services>
<!--<behaviors>
<serviceBehaviors>
<behavior>
--><!-- To avoid disclosing metadata information, set the values below to false before deployment --><!--
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="False"/>
--><!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --><!--
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>-->
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="False" />
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
<!--<protocolMapping>
<add binding="basicHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />-->
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
This runs perfectly on localhost, but when I deploy to the remote server it gives following error,
.Net framework is 4.5
Is any one can help on this?
After spending beautiful night, I found the solution, solution is adding the required library files(.dlls) to the deployed folder bin folder, I was using the EWS for email extraction so I have to add ews library to the bin folder of the published folder, thanks, hops this will help to someone.
I've my RESTful service hosted here .
I can use it perfectly with get&post http request.
How can I use as "service reference" in a Visual Studio project? I have added it in my test project and I see the methods correctly, but, when I try to call on of them, I get the "could not find default endpoint element that references contract in the servicemodel client" error, with http code 404.
So, I'm trying to modify my web.config file, but I get only different errors. For example, now I have try to add a SOAP endpoint,but I get a "bad request" error.
This is one of my methods (they are defined in the same way)
[OperationContract]
[WebGet(UriTemplate = "impianto.json?retista={codret}&storeID={storeID}&H={hashedString}", ResponseFormat = WebMessageFormat.Json)]
List<WrapImpianti> GetImpiantoJSON(string codret, string storeID, string hashedString);
and this is the web.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="ServerAddress" value="37.59.146.241:8099/isOverviewExport.svc" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<services>
<service name="isOverviewExport.Service1" behaviorConfiguration="MyBehavior">
<endpoint address="soap" behaviorConfiguration="soapBehavior" binding="basicHttpBinding" name="s" contract="isOverviewExport.isOverviewExport"/>
<endpoint address="rest" behaviorConfiguration="restBehavior" binding="webHttpBinding" name="base" contract="isOverviewExport.isOverviewExport">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="SecurityByTransport" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" />
</security>
</binding>
</webHttpBinding>
</bindings>
<extensions>
<behaviorExtensions>
<add name="CorsSupport" type="WebHttpCors.CorsSupportBehaviorElement, WebHttpCors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</behaviorExtensions>
</extensions>
<behaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<!--<enableWebScript/>-->
<webHttp helpEnabled="true" />
<CorsSupport />
</behavior>
<behavior name="soapBehavior">
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MyBehavior">>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="123456" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
</system.serviceModel>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
<connectionStrings>
<add name="Entities" connectionString="metadata=res://*/AccessData.Model.csdl|res://*/AccessData.Model.ssdl|res://*/AccessData.Model.msl;provider=System.Data.SqlClient;provider connection string="data source=myds;initial catalog=mydb;persist security info=True;user id=myuser;password=mypwd;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
You can also try yourself adding the service reference (the link is the same as above, http://37.59.146.241:8097/isOverviewExport.svc ). Why the second line of this snippet gives me the error I wrote above?
var svc = new ServiceReference5.isOverviewExportClient();
var ret = svc.GetImpiantoXML("123456", "AAA111", "test");
So, how can I use it as service reference in VS? I was thinking I have to set the soap endpoint, but maybe it isn't correct. Can you help me? :)
I'm currently stacked with the web service that im creating right now. when Testing it in local it all works fine but when I try to deploy it to the web server it throws me the following error
An error occurred while trying to make a request to URI '...my web service URI here....'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.
here is my web config.
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
<validation validateIntegratedModeConfiguration="false" />
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2000000000" />
</requestFiltering>
</security>
</system.webServer>
<connectionStrings>
<add name="........" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<!-- Testing -->
<add key="DataConnectionString" value="..........." />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
</compilation>
<httpRuntime executionTimeout="1200" maxRequestLength="2000000" />
</system.web>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<behaviors>
<serviceBehaviors>
<behavior name="Service1">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2000000000" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="nextSPOTServiceBehavior">
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2000000000" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="SecureBasic" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport" />
<readerQuotas maxArrayLength="2000000" maxStringContentLength="2000000"/>
</binding>
<binding name="BasicHttpBinding_IDownloadManagerService" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="nextSPOTServiceBehavior" name="NextSPOTDownloadManagerWebServiceTester.Web.WebServices.DownloadManagerService">
<endpoint binding="basicHttpBinding" bindingConfiguration="SecureBasic" name="basicHttpSecure" contract="NextSPOTDownloadManagerWebServiceTester.Web.WebServices.IDownloadManagerService" />
<!--<endpoint binding="basicHttpBinding" bindingConfiguration="" name="basicHttp" contract="NextSPOTDownloadManagerWebServiceTester.Web.WebServices.IDownloadManagerService" />-->
<!--<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IDownloadManagerService" contract="NextSPOTDownloadManagerWebServiceTester.Web.WebServices.IDownloadManagerService" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
</service>
</services >
</system.serviceModel>
</configuration>
Client access Policy
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="http://*"/>
<domain uri="https://*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
CROSS Domain policy
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain- policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
This sounds like the error you get when you are trying to use silverlight to access a webservice from where it is not hosted. If this is the case you need to add a clientaccesspolicy.xml to your web application folder.
MSDN article on allowing crossdomain access for a silverlight application.