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

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>
VBdotnet2005Asked:
Who is Participating?
 
DarrenDConnect With a Mentor Commented:
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
 
Bob LearnedCommented:
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
 
DarrenDCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
VBdotnet2005Author Commented:
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
 
VBdotnet2005Author Commented:
I did just tried to recreate a new app config file.
0
 
VBdotnet2005Author Commented:
"Also check the asmx file and make sure that this is pointing to the correct service..."

asmx file? I don't understand
0
 
Bob LearnedCommented:
Did that work?
0
 
Bob LearnedCommented:
.asmx files are the old web service files, and not the new WCF service files, so you can ignore that comment.
0
 
VBdotnet2005Author Commented:
I am still geting the same error.
0
 
VBdotnet2005Author Commented:
please see attachment.
ee.bmp
0
 
VBdotnet2005Author Commented:
I hosted the service in in DevSharepoint IIS.
0
 
VBdotnet2005Author Commented:
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
 
VBdotnet2005Author Commented:
please see attachment
ee.bmp
0
 
VBdotnet2005Author Commented:
TheLearnedOne,
Any thoughts?
0
 
Bob LearnedCommented:
How many projects do you have in the solution?  The configuration items for <system.ServiceModel> need to go in the entry project.
0
 
DarrenDCommented:
Hi, open the .svc file and see where it points to. Make sure it's pointing to the correct service.

Darren
0
 
VBdotnet2005Author Commented:
This is a very simple one. Please see an attachment. I hosted on my devserver.
0
 
VBdotnet2005Author Commented:
sorry, here is the file
ee.doc
0
 
DarrenDCommented:
Hi,

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

Thanks

Darren
0
 
VBdotnet2005Author Commented:
Did you see my attachment? It is under Eval.svc
0
 
VBdotnet2005Author Commented:
That is all I have.
0
 
DarrenDCommented:
Hi again,

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

Darren
0
 
VBdotnet2005Author Commented:
The name of my WCF service is called "HostedWCFService1


<%@ ServiceHost Language="C#" Debug="true" Service="HostedWCFservice1.eval" CodeBehind="eval.svc.cs" %>
0
 
VBdotnet2005Author Commented:
Any thoughts?
0
 
DarrenDCommented:
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
 
VBdotnet2005Author Commented:
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
 
VBdotnet2005Author Commented:
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
 
VBdotnet2005Author Commented:
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
 
DarrenDCommented:
Hi,

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

Darren
0
 
DarrenDCommented:
Hi,

How are you getting on with this?

Darren
0
 
VBdotnet2005Author Commented:
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
 
VBdotnet2005Author Commented:
Please see attachment.
ee.doc
0
 
VBdotnet2005Author Commented:
I have VS2008 on the one I am consuming WCF.
0
 
VBdotnet2005Author Commented:
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
 
VBdotnet2005Author Commented:
0
 
VBdotnet2005Author Commented:
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
 
DarrenDCommented:
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
 
VBdotnet2005Author Commented:
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
 
VBdotnet2005Author Commented:
It is in my eval.scv.cs file.
0
 
VBdotnet2005Author Commented:
spsvr01 is my dev server.
0
 
VBdotnet2005Author Commented:
I am calling it from another box.
0
 
VBdotnet2005Author Commented:
0
 
VBdotnet2005Author Commented:
This is now resolved. Thank you very much.
0
All Courses

From novice to tech pro — start learning today.