WCF Errors using WCFTestClient to test a simple WCF Web Service

前端 未结 5 996
盖世英雄少女心
盖世英雄少女心 2020-12-31 09:07

When I try to test the AutoLotWCFService using \"wcftestclient\", I get the following error. What am I doing wrong? Any insight will help. This is a simple Web Service that

相关标签:
5条回答
  • 2020-12-31 09:14

    you need to make sure that the service behaviour configuration enables has a metadata tag with httpGetEnabled="true"

    <serviceBehaviors>
      <behavior name="serviceBehavior">
        <serviceMetadata httpGetEnabled="true">
      </behavior>
    </serviceBehaviors>
    

    In addition, make sure your service references that behavior.

    
    <service name="blah" behaviorConfiguration="serviceBehavior">
    
    0 讨论(0)
  • 2020-12-31 09:24

    If installing compenonts doesnt work try a repair, this uninstalls and then installs.

    "%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r
    
    0 讨论(0)
  • 2020-12-31 09:32

    Thanks; believe it or not the problem of at least loading the service through wcftestclient was solved when I re-registered the ASPNET in IIS with aspnet-regiis.

    The next problem is to be able to invoke the methods exposed by the service through wcftestclient. What are the security issues that I have to deal with? I had to enable Anonymous login with windows auth. and still the invoke generated exceptions that pointed to something related to access violation. On searching some things point to installing certificates to be able to invoke.. Please enlighten if possible.

    0 讨论(0)
  • 2020-12-31 09:37

    I recently had this problem whilst trying to host WCF on my Windows Vista Laptop under IIS7.

    I first recieved the following error : "HTTP Error 404.3 - Not Found" and one of the resolutions suggested was to "Ensure that the expected handler for the current page is mapped."

    So I added a handler for the .svc file manually and defined it as a DiscoveryRequestHandler, thinking that this might help. This caused the problem you described above.

    The actual resolution was to delete the handler I had added, and to run the following commands:

    CD c:\windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\
    ServiceModelReg -i
    

    This resolved my issue and the service is working fine. I hope this might help shed some light on your problem. I can't be certain but this is probably because of the order in which I've installed the various packages on my dev laptop.

    0 讨论(0)
  • 2020-12-31 09:37

    Try checking if service(name) in the Service Markup (right click on servicename.svc) matches the service(name) in your web.config file.

    Cheers!

    0 讨论(0)
提交回复
热议问题