Good day
I want to host a WCF service in a Windows service and as such I am following the tutorial: http://msdn.microsoft.com/en-us/library/ff649818.aspx
During "Step 8: Add a WCF Service Reference to the Client" I get the following errors:
Could not connect to net.tcp://localhost:100/Triggers.
The connection attempt lasted for a time span of 00:00:02.0058550.
TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:100
I tried most if not all of the solutions mentioned on the following site: http://social.msdn.microsoft.com/forums/en-US/wcf/thread/58e420e9-43a3-4119-b541-d18158038e36/
with no avail.
Can someone please shine some light on this matter please?
Following is the WCF config file:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<!-- <add name="ABSAConnectionString" connectionString="Data Source=192.168.0.18;Initial Catalog=ABSA;Integrated Security=False;user=Wimpie;password=menschen;" -->
<!-- Charlene -->
<!--<add name="ABSAConnectionString" connectionString="Data Source=ik-charlene\SQL2008;Initial Catalog=ABSA;Integrated Security=True" providerName="System.Data.SqlClient" />-->
<add name="ABSAConnectionString" connectionString="Data Source=.\;Initial Catalog=ABSANICO;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms"/>
<authorization>
<!--<deny users="?"/>-->
<allow users="?"/>
</authorization>
<membership defaultProvider="Membership">
<providers>
<clear/>
<add name="Membership" type="ABSAService.Membership"/>
</providers>
</membership>
</system.web>
<system.serviceModel>
<services>
<service name="ABSAService.Triggers" behaviorConfiguration="ABSAService.TriggersBehavior" >
<endpoint address="" binding="netTcpBinding" bindingConfiguration="" contract="ABSAService.ITriggers">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:100/Triggers" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ABSAService.TriggersBehavior">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "c:\log\Traces.svclog" />
</listeners>
</source>
<source name="CardSpace">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.IO.Log">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.Runtime.Serialization">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.IdentityModel">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="UserTraceSource" switchValue="Warning, ActivityTracing" >
<listeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="C:\logs\UserTraces.svclog" />
</listeners>
</source>
</sources>
<trace autoflush="true" />
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\log\Traces.svclog" />
</sharedListeners>
</system.diagnostics>
</configuration>
Next is the Windows service config file (which is the same as above according to tutorial):
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<!-- <add name="ABSAConnectionString" connectionString="Data Source=192.168.0.18;Initial Catalog=ABSA;Integrated Security=False;user=Wimpie;password=menschen;" -->
<!-- Charlene -->
<!--<add name="ABSAConnectionString" connectionString="Data Source=ik-charlene\SQL2008;Initial Catalog=ABSA;Integrated Security=True" providerName="System.Data.SqlClient" />-->
<add name="ABSAConnectionString" connectionString="Data Source=.\;Initial Catalog=ABSANICO;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms"/>
<authorization>
<!--<deny users="?"/>-->
<allow users="?"/>
</authorization>
<membership defaultProvider="Membership">
<providers>
<clear/>
<add name="Membership" type="ABSAService.Membership"/>
</providers>
</membership>
</system.web>
<system.serviceModel>
<services>
<service name="ABSAService.Triggers" behaviorConfiguration="ABSAService.TriggersBehavior" >
<endpoint address="" binding="netTcpBinding" bindingConfiguration="" contract="ABSAService.ITriggers">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:100/Triggers" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ABSAService.TriggersBehavior">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
Thanks to evgenyl for pointing out that I had to start the Windows Service.
Completely missed this step.
Related
I am trying to connect to a WCF service over https and i get the following error
An error occurred while making the HTTP request to https://mysite/App/Service/MyService.svc.
This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.
Please help me out of this issue. We need to move to prod by weekend.
WCF web.config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections><sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" />
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<add key="MyEnv" value="Server01" />
</appSettings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
<assemblies>
<add assembly="Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89B483F429C47342" />
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
</assemblies>
<buildProviders><add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" /></buildProviders>
</compilation>
<customErrors mode="Off" />
<pages>
<namespaces>
<add namespace="System.Runtime.Serialization" />
<add namespace="System.ServiceModel" />
<add namespace="System.ServiceModel.Web" />
</namespaces>
</pages>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<defaultDocument>
<files>
<add value="MyService.svc" />
</files>
</defaultDocument>
</system.webServer>
<businessObjects><crystalReports><rptBuildProvider><add embedRptInResource="true" /></rptBuildProvider></crystalReports></businessObjects></configuration>
Web Application web.config file:
<configuration>
<appSettings>
<add key="HelpLoadMode" value="All" />
</appSettings>
<system.web>
<sessionState mode="InProc" timeout="35"></sessionState>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
<assemblies>
<add assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</assemblies>
</compilation>
<customErrors mode="Off"></customErrors>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true"></serviceHostingEnvironment>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IReportService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="4194304" maxBufferPoolSize="10485760" maxReceivedMessageSize="4194304"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="6400" maxStringContentLength="4194304" maxArrayLength="131072"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="BasicHttpBinding_IMyService1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://mysite/App/Service/MyService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyService"
contract="MyService.IMyService" name="BasicHttpBinding_IMyService" />
</client>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
<system.webServer>
<caching>
<profiles>
<add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".gif" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
</profiles>
</caching>
<directoryBrowse enabled="false" />
</system.webServer>
</configuration>
By default, WCF configuration only supports HTTP protocol to expose the service, we need to set up the additional service endpoint in the System.ServiceModel section.
Please consider the below configuration.
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
</system.serviceModel>
Then we specify an https binding in IIS.
After publishing the service in IIS, we add the service reference on the client to generate the client proxy. It would auto-generate the https endpoint.
One thing must be noted is that we should trust the server certificate when calling the service with the HTTPS endpoint on the server-side.
There are two ways to accomplished this.
Use the below code segments before instantiating the client proxy
class.
ServicePointManager.ServerCertificateValidationCallback += delegate
{
return true;
};
Install the server certificate on the client-side Trusted Root
Certification Authorities(certificate store).
Feel free to let me know if the problem still exists.
Below give the web.config file in WCF service.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.diagnostics>
<sources>
<source propagateActivity="true" name="System.ServiceModel" switchValue="Warning,ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="c:\tfslatest\entermarkets\project specific\psbd\trunk\smartincident\pss.web.services.internal\web_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
</sharedListeners>
</system.diagnostics>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<!-- -->
<!-- *** DATABASE *** -->
<!-- -->
<add key="Db Timeout Seconds" value="200" />
<add key="Enable SMS" value="true" />
<add key="Enable Notification" value="true" />
<add key="K2 Server" value="EM-K2" />
<add key="Forgot Password External Url" value="http://localhost/PSS.Web/ResetPassword.aspx?id=" />
<add key="Incident Mobile Download Url" value="http://localhost/PSS.Web/DownloadApp.aspx?id=" />
</appSettings>
<system.web>
<compilation targetFramework="4.5" debug="true" />
<httpRuntime maxRequestLength="2097151"
useFullyQualifiedRedirectUrl="true"
executionTimeout="14400" />
</system.web>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="AttachmentService"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647" transferMode="Streamed" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</webHttpBinding>
<basicHttpBinding>
<binding name="BasicHttpBinding_INotificationService" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/Utility.Notification.Service/NotificationService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_INotificationService" contract="INotificationService" name="BasicHttpBinding_INotificationService" />
<endpoint address="http://localhost/PSS.Web.Services.Internal/AttachmentService.svc" binding="basicHttpBinding"
bindingConfiguration="AttachmentService"
contract ="IAttachmentService">
</endpoint>
</client>
<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" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<!--<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>-->
<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>
<authentication>
<windowsAuthentication enabled="true" />
</authentication>
</security>-->
<directoryBrowse enabled="true" />
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" maxUrl="2147483648" maxQueryString="2147483648" />
</requestFiltering>
</security>
</system.webServer>
<connectionStrings>
<add name="Conn_PSBDDb" connectionString="DATA SOURCE=192.168.0.100:1521/orcl;USER ID=PSBD;Password=password*1;" providerName="Oracle.ManagedDataAccess.Client" />
</connectionStrings>
</configuration>
This is Server Side Config Files
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<!-- -->
<!-- *** PLUG-IN CONFIGURATION *** -->
<!-- -->
<!-- Plug-In Collection -->
<!-- Format for each entry is <Type>#<Assembly> -->
<add key="AD Authentication PlugIn Evaluation List" value="PSS.AD.Adapters.NonMemberServer.NonMemberServerManager#PSS.AD.Adapters.NonMemberServer" />
<add key="Login Url" value="http://localhost/PSS.Web/Login.aspx" />
<add key="Forgot Password External Url" value="http://localhost/PSS.Web/ResetPassword.aspx?id=" />
<add key="Incident Mobile Download Url" value="http://localhost/PSS.Web/DownloadApp.aspx?id=" />
<add key="PSS Url" value="http://localhost/PSS.Web/" />
<!--<add key="Templates Url" value="C:\TFS\EnterMarkets\Project Specific\PSBD\Trunk\SmartIncident\PSS.Web.Services.Internal\bin\MessageTemplates" />-->
<add key="Templates Url" value="\\192.168.0.243\psbd\PSS.Web.Services.Internal\bin\MessageTemplates" />
<add key="Hyper Pay URL" value="https://test.oppwa.com/" />
<add key="Hyper Pay UserId" value="8a829417527905e80152794f55950197" />
<add key="Hyper Pay Password" value="e2XRrKJa" />
<add key="Hyper Pay EntityId" value="8a829417527905e80152794f8af10199" />
<add key="Hyper Pay PaymentType" value="DB" />
<!--For testing it must be 'EXTERNAL' else change to 'INTERNAL' as per documentation-->
<add key="Hyper Pay Test Mode" value="EXTERNAL" />
<!-- -->
<!-- *** DATABASE ** * -->
<!-- -->
<add key="Db Timeout Seconds" value="200" />
<!-- -->
<!-- *** LOGGING *** -->
<!-- -->
<add key="EnableLogging" value="false" />
<add key="LogFilePath" value="C:\Temp\Logs\PSS.Web.log" />
<add key="Enable SMS" value="true" />
<add key="Enable Notification" value="true" />
<add key="Domain Name" value="coruscant" />
<add key="EnableExamExecution" value="false" />
<!--
If "EnableLogging" is set to true, this integer
specifies the max size in bytes which the log file can be until it will
be purged on next write to the log file
Default value: 100000000
-->
<add key="Attachment Plug-In List" value="PSS.Core.Attachment.Adapters.FileServer.FileServerManager#PSS.Core.Attachment.Adapters.FileServer" />
<add key="MaxLogFileSize" value="100000000" />
<!-- Event Log Logging -->
<add key="EventLogSourceName" value="PSS.Web" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="language" value="ar" />
<add key="FilestorePath" value="C:\Filestore\" />
<!--Phisical Paths-->
<add key="C:\TFS\EnterMarkets\Project Specific\PSBD\Trunk\SmartIncident\PSS.Web" value="" />
<add key="UploadedFiles" value="C:\TFS\EnterMarkets\Project Specific\PSBD\Trunk\SmartIncident\PSS.Web\UploadedFiles\" />
<!--/Phisical Paths-->
</appSettings>
<system.web>
<customErrors mode="Off" defaultRedirect="~/ErrorPage.aspx" redirectMode="ResponseRewrite"></customErrors>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime maxRequestLength="2097150"/>
</system.web>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483647" />
</webServices>
</scripting>
</system.web.extensions>
<connectionStrings>
<add name="Conn_PSBDDb" connectionString="DATA SOURCE=192.168.0.100:1521/ORCL;USER ID=PSBD;Password=password*1;" providerName="Oracle.ManagedDataAccess.Client" />
</connectionStrings><!---->
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" maxUrl="2147483648" maxQueryString="2147483648" />
</requestFiltering>
</security>
<!--<modules runAllManagedModulesForAllRequests="true">
<remove name="BundleModule" />22
<add name="BundleModule" type="System.Web.Optimization.BundleModule" />
</modules>-->
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<staticContent>
<!--
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<remove fileExtension=".svgz" />
<mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
<remove fileExtension=".eot" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<remove fileExtension=".otf" />
<mimeMap fileExtension=".otf" mimeType="font/otf" /> -->
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/x-woff" />
<remove fileExtension=".mp4" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<!--
<mimeMap fileExtension=".apk" mimeType="application/vnd.android.package-archive" />
<mimeMap fileExtension=".ipa" mimeType="application/octet-stream" /> -->
</staticContent>
<directoryBrowse enabled="true" />
</system.webServer>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IADService" />
<binding name="BasicHttpBinding_IWorkFlowService" />
<binding name="BasicHttpBinding_INotificationService" />
<!--<binding name="BasicHttpBinding_IAttachmentService" />-->
<binding name="BasicHttpBinding_IAttachmentService" closeTimeout="04:01:00" openTimeout="04:01:00" receiveTimeout="04:10:00" sendTimeout="04:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Streamed" useDefaultWebProxy="true">
<readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://192.168.0.245/PSS.AD.Web.Services/ADService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IADService" contract="ADWebService.IADService" name="BasicHttpBinding_IADService" />
<endpoint address="http://192.168.0.242/PSS.Web.Services.Internal/WorkFlowService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWorkFlowService" contract="PSSWorkFlowService.IWorkFlowService" name="BasicHttpBinding_IWorkFlowService" />
<endpoint address="http://localhost/Utility.Notification.Service/NotificationService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_INotificationService" contract="INotificationService" name="BasicHttpBinding_INotificationService" />
<endpoint address="http://localhost/PSS.Web.Services.Internal/AttachmentService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAttachmentService" contract="AttachmentsService.IAttachmentService" name="BasicHttpBinding_IAttachmentService" />
</client>
</system.serviceModel>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I am unable to upload more the 50KB file, less than 50kb is working fine the exception I am getting is (The remote server returned an unexpected response: (400) Bad Request.). Any help could be appreciated. Thanks!!
After deploy my ASP.NET 4.5 Web Forms site under IIS7 I got error that didn't have when run from VS2013.
The errors on browsing my site from firebug:
"NetworkError: 404 Not Found - h t t p://wcfjsproxydemo/bundles/modernizr?v=Vd40cG5fYxxjdknf_y9ilK-zi7pnjL35tk9IAsOQgQc1"
modern...sOQgQc1
"NetworkError: 404 Not Found - h t t p://wcfjsproxydemo/Content/css?v=f5ydPh92LWsttS1MEc8JZmFtAgT6RUaer_jy37xBkQs1"
css?v=...7xBkQs1
"NetworkError: 404 Not Found - h t t p://wcfjsproxydemo/bundles/MsAjaxJs?v=J4joXQqg80Lks57qbGfUAfRLic3bXKGafmR6wE4CFtc1"
MsAjax...E4CFtc1
"NetworkError: 404 Not Found - h t t p://wcfjsproxydemo/bundles/WebFormsJs?v=q9E9g87bUDaS624mcBuZsBaM8xn2E5zd-f4FCdIk2cA1"
WebFor...dIk2cA1
TypeError: Sys.WebForms is undefined
...bForms.PageRequestManager._initialize('ctl00$ctl08', 'ctl01', [], [], [], 90, 'c...
wcfjsproxydemo (line 67)
POST http://intext.nav-links.com/util/intexteval.pl?op=eval&x=3&xop=eval&rnum=911043
200 OK
214ms
intext...inks=3& (line 3039)
I see my site without style.
What should I change here in my site?
my web.config
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-WCFJSproxyDemo-20130722004707;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-WCFJSproxyDemo-20130722004707.mdf" />
</connectionStrings>
<system.web>
<compilation targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<pages>
<namespaces>
<add namespace="System.Web.Optimization" />
</namespaces>
<controls><add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /></controls></pages>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
</authentication>
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</profile>
<membership defaultProvider="DefaultMembershipProvider">
<providers>
<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<roleManager defaultProvider="DefaultRoleProvider">
<providers>
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</roleManager>
<!--
If you are deploying to a cloud environment that has multiple web server instances,
you should change session state mode from "InProc" to "Custom". In addition,
change the connection string named "DefaultConnection" to connect to an instance
of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express.
-->
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
</providers>
</sessionState>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="WCFJSproxyDemo.Service.WCFJSproxyDemoBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="WCFJSproxyDemo.Service.DemoWCFService">
<endpoint address="" behaviorConfiguration="WCFJSproxyDemo.Service.WCFJSproxyDemoBehavior" binding="webHttpBinding" contract="WCFJSproxyDemo.Service.IDemoWCFService">
</endpoint>
</service>
</services>
</system.serviceModel>
<system.webServer>
<defaultDocument>
<files>
<remove value="default.aspx" />
<remove value="iisstart.htm" />
<remove value="index.html" />
<remove value="index.htm" />
<remove value="Default.asp" />
<remove value="Default.htm" />
<add value="TestWCFService.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
I fixed it.
After some hours working in this issue I found a blog with just one think to do:
<modules runAllManagedModulesForAllRequests="true">
<remove name="BundleModule" />
<add name="BundleModule" type="System.Web.Optimization.BundleModule" />
</modules>
Optimization.cs
bundles.Add(new StyleBundle("~/Static/css/stylesheets.css")
.Include(
"~/Static/stylesheets/base.css",
"~/Static/stylesheets/layout.css"
)
);
bundles.Add(new ScriptBundle("~/Static/js/script.js")
.Include("~/Static/js/jquery.refineslide.min.js",
"~/Static/js/script.js"));
Root.Master
<asp:ContentPlaceHolder ID="cssBundle" runat="server">
<%= System.Web.Optimization.Styles.Render("~/Static/css/stylesheets.css") %>
</asp:ContentPlaceHolder>
.
.
.
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
<%= System.Web.Optimization.Scripts.Render("~/Static/js/script.js") %>
</asp:ContentPlaceHolder>
In ASP.net forms,
Just you have to change modules in webconfig to the below
<modules runAllManagedModulesForAllRequests="true">
<remove name="BundleModule" />
<add name="BundleModule" type="System.Web.Optimization.BundleModule" />
</modules>
I consumed wcf by adding service reference to my project then I changed the web.confing to be like that
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.;initial catalog=Services;user id=sa;password=123;Connect Timeout=45;"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
</authentication>
<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>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<system.serviceModel>
<services>
<service name="DreamServices.DreamService">
<endpoint address="" binding="webHttpBinding" contract="DreamServices.IServices" behaviorConfiguration="web">
</endpoint>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="defaultRest">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="64" maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</webHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<appSettings>
<add key="JsonWebService" value="http://localhost:1381/PMAHost/Service.svc" />
</appSettings>
</configuration>
but I always get the exception
Could not find default endpoint element that references contract 'ServiceReference.IServices' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
the module system.serviceModel is repeated either in the library or the site
any idea how to fix that
This is a service-side configuration
<service name="DreamServices.DreamService">
What does the client-side configuration look like? It should have a client element with contract="DreamServices.IServices" or whatever the name of your contract is.
I am hosting Workflow service on iis 7.0 with net.tcp binding. My config file like as
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<appSettings>
<add key="SMTPAddress" value="000.00.0.00"/>
<add key="ToAddress" value="abc#abc.com"/>
<add key="FromAddress" value="abc#abc.com"/>
<add key="SMTPUserName" value="abc#abc.com"/>
<add key="SMTPPassword" value ="abc#abc.com"/>
</appSettings>
<connectionStrings>
<add name="RewindConnectionString" connectionString="Data Source=xxx;User Id=xxx;Password=xxx;Connection Timeout=5" providerName="Oracle.DataAccess.Client" />
</connectionStrings>
<system.serviceModel>
<tracking>
<profiles>
<trackingProfile name="Sample Tracking Profile">
<workflow activityDefinitionId="*">
<workflowInstanceQueries>
<workflowInstanceQuery>
<states>
<state name="*"/>
</states>
</workflowInstanceQuery>
</workflowInstanceQueries>
<activityStateQueries>
<activityStateQuery activityName="*">
<states>
<state name="*"/>
</states>
<variables>
<variable name="*"/>
</variables>
</activityStateQuery>
</activityStateQueries>
<activityScheduledQueries>
<activityScheduledQuery activityName="*" childActivityName="*"/>
</activityScheduledQueries>
<faultPropagationQueries>
<faultPropagationQuery faultSourceActivityName="*" faultHandlerActivityName="*"/>
</faultPropagationQueries>
<customTrackingQueries>
<customTrackingQuery name="*" activityName="*"/>
</customTrackingQueries>
</workflow>
</trackingProfile>
</profiles>
</tracking>
<services>
<service name="RewindTest" behaviorConfiguration="RewindTest_Behavior">
<endpoint address="RewindTest"
binding="netTcpBinding" contract="IRewindTestService" name="RewindTestNetTcpEndPoint" bindingConfiguration="RewindTestBinding" />
<endpoint address="wce"
binding="netTcpBinding" kind="workflowControlEndpoint" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9095/Service.Workflow.RewindTest/RewindTest" />
</baseAddresses>
</host>
<endpoint address="mex"
binding="mexTcpBinding"
name="MEX"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding portSharingEnabled="true" name="RewindTestBinding" closeTimeout="00:10:00" openTimeout="00:10:00"
sendTimeout="00:10:00" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<standardEndpoints>
<workflowControlEndpoint>
<standardEndpoint/>
</workflowControlEndpoint>
</standardEndpoints>
<extensions>
<behaviorExtensions>
<add name="oracleInstanceStore" type="Devart.Data.Oracle.Activities.Configuration.OracleInstanceStoreElement, Devart.Data.Oracle.WorkflowFoundation" />
<add name="oracleTracking" type="Devart.Data.Oracle.Activities.Configuration.OracleTrackingElement, Devart.Data.Oracle.WorkflowFoundation" />
</behaviorExtensions>
</extensions>
<behaviors>
<serviceBehaviors>
<behavior name="RewindTest_Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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"/>
<oracleTracking
connectionString="User Id=xxx;Password=xxx;Server=xxx;"
profileName="Sample Tracking Profile" />
<oracleInstanceStore
connectionString="User Id=xxx;Password=xxx;Server=xxx;"
instanceEncodingOption="None"
instanceCompletionAction="DeleteNothing"
instanceLockedExceptionAction="NoRetry"
hostLockRenewalPeriod="00:00:30"
runnableInstancesDetectionPeriod="00:00:05" />
<workflowIdle timeToUnload="0"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Now my issue is i am unable to generate proxy through net.tcp binding but i can generate it through http. http://testsrv.com/RewindService/RewindTest.xamlx?wsdl. then i am unable to call receive operation method. Although it is workking fine with local console Host.
As we know that workflow service is similar to wcf service. So I decided to reconsider my deployment steps. I found a very good link about it and follow and check each and every step carefully and able to resolved my problem.
http://galratner.com/blogs/net/archive/2010/10/08/setting-up-a-nettcpbinding-enabled-wcf-service-in-iis-7.aspx
My configuration is ok and updated the tcp port no. it works like a charm.