Solved

WCF - error "Could not find endpoint element with ..."

Posted on 2012-03-16
43
2,149 Views
Last Modified: 2012-03-29
I need help on this error. So far I can find a solution.

"Could not find endpoint element with name 'BasicHttpBinding_IService1' and contract 'ServiceReference1.IService1' 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 name could be found in the client element."
 



protected void Page_Load(object sender, EventArgs e)
        {
           
            try
            {
                Service1Client proxy = new Service1Client("BasicHttpBinding_IService1");
                this.Label1.Text = " - Dept UserName : " + proxy.RetreiveUsername("abc_dom\jdoe");
            }
            catch (Exception ex)
            {
               
            }
        }




<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="basicHttpBinding_IEvalservice" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
                <binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
                <binding name="BasicHttpBinding_IService11" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
            <netTcpBinding>
                <binding name="NetTcpBinding_IEvalservice" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
                    hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                    maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
                    maxReceivedMessageSize="65536">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Transport">
                        <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                        <message clientCredentialType="Windows" />
                    </security>
                </binding>
            </netTcpBinding>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IEvalService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
      <client>
        <endpoint address="http://localhost:49355/eval.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpBinding_IService11" contract="ServiceReference1.IService1"
          name="BasicHttpBinding_IService1" />
      </client>
    </system.serviceModel>
</configuration>
0
Comment
Question by:VBdotnet2005
  • 30
  • 9
  • 4
43 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37732642
In the configuration settings, I see a lot of bindings with different names.  

Is that the client-side configuration, or the server-side configuration?  

What are the service contract interface names for the web service?
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 37737820
Hi,

<client>
<endpoint address="http://localhost:49355/eval.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpBinding_IService11" contract="ServiceReference1.IService1"
          name="BasicHttpBinding_IService1" />
</client>

Is it your intention to use the bindingconfiguration _IService11 with Contract _IService1 ?

Also check the asmx file and make sure that this is pointing to the correct service...

Your services seem to be a bit all over the place. You may be better recreating the client  config file.


Thanks,

Darren
0
 

Author Comment

by:VBdotnet2005
ID: 37739260
When I used "Add Service Reference..", it automatically added this for me to my App config file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:49355/eval.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
        name="BasicHttpBinding_IService1" />
    </client>
  </system.serviceModel>
</configuration>
0
 

Author Comment

by:VBdotnet2005
ID: 37739264
I did just tried to recreate a new app config file.
0
 

Author Comment

by:VBdotnet2005
ID: 37739275
"Also check the asmx file and make sure that this is pointing to the correct service..."

asmx file? I don't understand
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37739280
Did that work?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37739283
.asmx files are the old web service files, and not the new WCF service files, so you can ignore that comment.
0
 

Author Comment

by:VBdotnet2005
ID: 37739791
I am still geting the same error.
0
 

Author Comment

by:VBdotnet2005
ID: 37739850
please see attachment.
ee.bmp
0
 

Author Comment

by:VBdotnet2005
ID: 37739877
I hosted the service in in DevSharepoint IIS.
0
 

Author Comment

by:VBdotnet2005
ID: 37739882
same error

Could not find endpoint element with name 'BasicHttpBinding_IService1' and contract 'ServiceReference1.IService1' 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 name could be found in the client element.
0
 

Author Comment

by:VBdotnet2005
ID: 37740216
please see attachment
ee.bmp
0
 

Author Comment

by:VBdotnet2005
ID: 37744033
TheLearnedOne,
Any thoughts?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37744070
How many projects do you have in the solution?  The configuration items for <system.ServiceModel> need to go in the entry project.
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 37744504
Hi, open the .svc file and see where it points to. Make sure it's pointing to the correct service.

Darren
0
 

Author Comment

by:VBdotnet2005
ID: 37744832
This is a very simple one. Please see an attachment. I hosted on my devserver.
0
 

Author Comment

by:VBdotnet2005
ID: 37744837
sorry, here is the file
ee.doc
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 37744887
Hi,

Right click the eval.svc and open and post up what's in that file.

Thanks

Darren
0
 

Author Comment

by:VBdotnet2005
ID: 37744973
Did you see my attachment? It is under Eval.svc
0
 

Author Comment

by:VBdotnet2005
ID: 37744981
That is all I have.
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 37746686
Hi again,

On the eval.svc file right click and select open markup and put that up as well

Darren
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:VBdotnet2005
ID: 37748050
The name of my WCF service is called "HostedWCFService1


<%@ ServiceHost Language="C#" Debug="true" Service="HostedWCFservice1.eval" CodeBehind="eval.svc.cs" %>
0
 

Author Comment

by:VBdotnet2005
ID: 37750755
Any thoughts?
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 37751621
Hi again,

In your web.config you seem to be missing
<services>
      <service behaviorConfiguration="HostedWCFservice1.evalBehavior"
        name="HostedWCFservice1.eval">
        <endpoint address="" binding="basicHttpBinding" contract="HostedWCFservice1.eval">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>

This should go inside the   <system.serviceModel> tag.
0
 

Author Comment

by:VBdotnet2005
ID: 37754709
I followed your sample. I got this error when I tried to browse to .svc file.
"Metadata publishing for this service is currently disabled.

If you have access to the service, you can enable metadata publishing by completing the following steps to modify your web or application configuration file:
.."

Here is my webconfig file

<?xml version="1.0"?>
<configuration>

  <system.serviceModel>
    <services>
      <service behaviorConfiguration="HostedWCFService1.evalBehavior" name="HostedWCFService1.eval" >
        <endpoint address="" binding="basicHttpBinding" contract="HostedWCFservice1.eval">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="HostedWCFService1.evalBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  <system.web>
    <compilation debug="true"/>
  </system.web>
</configuration>
0
 

Author Comment

by:VBdotnet2005
ID: 37755194
ok. I got the error above post fixed. I  tried your code and still received the same error.
Within the same server, no problem. When I tried it on a different server, then it errored.
0
 

Author Comment

by:VBdotnet2005
ID: 37755252
when I tried to browse to eval.sv

http://myserveripaddress:4567/eval.svc (from my computer to my server)
I can view the service no problem. Maybe I should add my serverip instead of "localhost:4567/eval.svc ?
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 37756339
Hi,

Yes you will have to put your server name and directory where the svn file is located.

Darren
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 37765166
Hi,

How are you getting on with this?

Darren
0
 

Author Comment

by:VBdotnet2005
ID: 37768008
Hi Darren,
Now, I am trying to consume it from another server. I got an error (in my attachment).  I can browse to my service (from the server I am hosting).  Need help.
0
 

Author Comment

by:VBdotnet2005
ID: 37768016
Please see attachment.
ee.doc
0
 

Author Comment

by:VBdotnet2005
ID: 37768029
I have VS2008 on the one I am consuming WCF.
0
 

Author Comment

by:VBdotnet2005
ID: 37768043
error

"The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs."
0
 

Author Comment

by:VBdotnet2005
ID: 37768603
0
 

Author Comment

by:VBdotnet2005
ID: 37768648
Now it is Login failed for the user 'my_dom\spsvr01$'. My service log in sql and returns a value.

"spsvr01" is the name of my server, but it is not a login name or exist in sql as a user login.  What options do I have for the login on SQL?
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 37770484
Hi,

At least you can now communicate with the service which is a good start.

You should be using some connection string to talk to the database so I'm not sure where this error is comming from.

What are you using to connect to the database?

Darren
0
 

Author Comment

by:VBdotnet2005
ID: 37774485
this is what I am using to connect to sql.

 SqlConnection Sqlcon = new SqlConnection("Server=appdbsvr01;Max Pool Size=500;Database=WSS_Content;Integrated Security=SSPI;");
0
 

Author Comment

by:VBdotnet2005
ID: 37774486
It is in my eval.scv.cs file.
0
 

Author Comment

by:VBdotnet2005
ID: 37774490
spsvr01 is my dev server.
0
 

Author Comment

by:VBdotnet2005
ID: 37774491
I am calling it from another box.
0
 
LVL 18

Accepted Solution

by:
DarrenD earned 500 total points
ID: 37775557
Hi,

You will have to make sure that you have remote access to the dev box.

SQL Server 2010: Do you have Sql Server Management Studio. If yes, then you can open it and right click the instance in question, go to Properties -> Connections -> Check "Allow remote connections to this server".

You might also have to enable TCP/IP Protocol to be enabled thru Configuration Manager.

SQL Server 2005: http://support.microsoft.com/kb/914277

Hope this helps,

Darren
0
 

Author Comment

by:VBdotnet2005
ID: 37779591
0
 

Author Comment

by:VBdotnet2005
ID: 37779593
This is now resolved. Thank you very much.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now