Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

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>
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

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?
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
Avatar of VBdotnet2005

ASKER

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

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

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

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

Thanks

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

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

Darren
The name of my WCF service is called "HostedWCFService1


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

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

Darren
Hi,

How are you getting on with this?

Darren
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.
Please see attachment.
ee.doc
I have VS2008 on the one I am consuming WCF.
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."
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?
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
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;");
It is in my eval.scv.cs file.
spsvr01 is my dev server.
I am calling it from another box.
ASKER CERTIFIED SOLUTION
Avatar of Darren
Darren
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is now resolved. Thank you very much.