Click here to Skip to main content
15,886,362 members

When I start project I get Internal Server Error in WCF

thomas_wingfield asked:

Open original thread
Hello!When I start asp.net mvc project I get error.Internal Server Error.
I host asp.net mvc and wcf application on IIS express.
XML
<services>
  <service name="WCFSkyAuction.Service.UserRoleService">
    <endpoint address="" behaviorConfiguration="WCFSkyAuction.Service.UserRoleServiceAspNetAjaxBehavior"
      binding="webHttpBinding" name="UserService" contract="WCFSkyAuction.Service.UserRoleService" />
  </service>
  <service name="WCFSkyAuction.Service.AdminRoleService">
    <endpoint address="" behaviorConfiguration="WCFSkyAuction.Service.AdminRoleServiceAspNetAjaxBehavior"
      binding="webHttpBinding" name="AdminService" contract="WCFSkyAuction.Service.AdminRoleService" />
  </service>
  <service name="WCFSkyAuction.Service.VipRoleService">
    <endpoint address="" behaviorConfiguration="WCFSkyAuction.Service.VipRoleServiceAspNetAjaxBehavior"
      binding="webHttpBinding" contract="WCFSkyAuction.Service.VipRoleService"/>
  </service>
  <service name="WCFSkyAuction.Service.MailService">
    <endpoint address="" behaviorConfiguration="WCFSkyAuction.Service.MailServiceAspNetAjaxBehavior"
      binding="webHttpBinding" contract="WCFSkyAuction.Service.MailService" />
  </service>
</services>

XML
<endpointBehaviors>
     <behavior name="WCFSkyAuction.Service.UserRoleServiceAspNetAjaxBehavior">
       <enableWebScript />
     </behavior>
     <behavior name="WCFSkyAuction.Service.AdminRoleServiceAspNetAjaxBehavior">
       <enableWebScript />
     </behavior>
     <behavior name="WCFSkyAuction.Service.VipRoleServiceAspNetAjaxBehavior">
       <enableWebScript />
     </behavior>
     <behavior name="WCFSkyAuction.Service.MailServiceAspNetAjaxBehavior">
       <enableWebScript />
     </behavior>
   </endpointBehaviors>

That's my config file on WCF side I have each endpoint with webHttp binding and contract on 4 svc files.All methods has correct set in svc files with operationcontract, with one argument.I have cheacked services is cool.
XML
<system.serviceModel>
    <client>
      <endpoint address="http://localhost:8080/WCFSkyAuction/Service/UserRoleService.svc"
        binding="webHttpBinding" bindingConfiguration="" behaviorConfiguration="webhttp" contract="UserService.UserRoleService"
        name="UserService" />
      <endpoint address="http://localhost:8080/WCFSkyAuction/Service/AdminRoleService.svc" 
                binding="webHttpBinding" behaviorConfiguration="webhttp" contract="AdminService.AdminRoleService"
        name="AdminService" />
    </client>
    <behaviors>
      <endpointBehaviors>
        <behavior name="webhttp">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>

That's a web.config in asp.net mvc side. I have written client endpoints and behaviors by Edit WCF file.Add Service Referance works good and I added all reference.when I started project with a first operation of service I got Internal Server Error.Communication Exception was uhandled by user code.
Thank you.How can I decide it?
Tags: C#, WCF, MVC, ASP.NET

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900