Could not find default endpoint element that references

Topics: General Discussion Forum, July and December Releases Forum, Service Factory Modeling Edition Forum
Apr 7, 2008 at 8:58 PM
Hi All,


I am getting the below error when i am calling the web service(WSSF).

Could not find default endpoint element that references contract 'TWServiceContract' 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 contract could be found in the client element.

Can any body please tell me what i am missing??

Thanks
Kumar.
Apr 8, 2008 at 3:27 PM
Check in your client side code, when you create the client proxy, that you are specifying the correct endpoint.
This may happen on subsequent proxy creations, you config file will contain multiple endpoints using the same contract so you need to specify which one you want to use by adding the endpoint name to the constructor of your proxy client.
Apr 8, 2008 at 5:20 PM

I checked the Client Side code and also the Config, and everything seems to be fine.

What about the Address for the EndPoint?
What Value i have to give ?

i did not mentioned any addressed for the enpoint. Is this the Cause for the error i got??





charlyfriend wrote:
Check in your client side code, when you create the client proxy, that you are specifying the correct endpoint.
This may happen on subsequent proxy creations, you config file will contain multiple endpoints using the same contract so you need to specify which one you want to use by adding the endpoint name to the constructor of your proxy client.

Apr 8, 2008 at 6:00 PM
Did you try something like this?

MyClientProxy proxy = new MyClientProxy("endpoint name");

Where "endpoint name" should be pointing to one of your endpoints (name attr) in client config file.
Apr 8, 2008 at 9:14 PM
In the client where i am calling the web service i used the above code , but the result is same.

And also can u please tell me where and how can we add the bussiness logic and the Data Access code in WSSF(2008).










charlyfriend wrote:
Did you try something like this?

MyClientProxy proxy = new MyClientProxy("endpoint name");

Where "endpoint name" should be pointing to one of your endpoints (name attr) in client config file.

Apr 9, 2008 at 4:24 PM
Check again that you have that client proxy name used in the constructor added in your App.config file.
Regarding the BL and DA generation, WSSF(2008) does not have generations for them so you may choose the one you like. You may also use the Rpository Factory to create the DA layer.
Apr 9, 2008 at 7:54 PM
Edited Apr 10, 2008 at 3:18 PM
Hi Charly,


This is the code i am using in my Client Application

TWServiceContractClient client = new TWServiceContractClient();


Below is the App.Config File of WSSF.

Please look and tell me what is the mistake..

Even i tried to consume the HOL WebService in a client application, but i got the same Error "Coul not find EndPoint".

**************APP.Config File*****************
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="FinalPoint" 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:1591/WCFService.Test.Host/ReportWebService.svc"
binding="basicHttpBinding" bindingConfiguration="FinalPoint"
contract="WCFService.Test.Client.ReportWebServiceProxy.TWServiceContract"
name="FinalPoint" />
</client>
</system.serviceModel>
</configuration>

************************************************************

charlyfriend wrote:
Check again that you have that client proxy name used in the constructor added in your App.config file.
Regarding the BL and DA generation, WSSF(2008) does not have generations for them so you may choose the one you like. You may also use the Rpository Factory to create the DA layer.

Apr 10, 2008 at 11:26 PM
The config file seems fine. I guess that you already try "TWServiceContractClient client = new TWServiceContractClient("FinalPoint");".
In that case, then check if you proxy class, TWServiceContractClient derives from ClientBase<WCFService.Test.Client.ReportWebServiceProxy.TWServiceContract>.
Apr 11, 2008 at 4:08 AM

This is how the proxy class TWServiceContractClient derives from clientbase
public partial class TWServiceContractClient : System.ServiceModel.ClientBase<TWServiceContract>, TWServiceContract


TWServiceContract is an interface.






charlyfriend wrote:
The config file seems fine. I guess that you already try "TWServiceContractClient client = new TWServiceContractClient("FinalPoint");".
In that case, then check if you proxy class, TWServiceContractClient derives from ClientBase<WCFService.Test.Client.ReportWebServiceProxy.TWServiceContract>.

Apr 11, 2008 at 10:52 PM
Edited Apr 14, 2008 at 3:29 PM
HI All,

Any idea how to solve this problem,
i got stuck with this error"Could not find default endpoint". I am using VS2008 and WSSF 2008.

Please let me know your ideas ..


This is how the proxy class TWServiceContractClient derives from clientbase
public partial class TWServiceContractClient : System.ServiceModel.ClientBase<TWServiceContract>, TWServiceContract


TWServiceContract is an interface.




kumarvem wrote:

This is how the proxy class TWServiceContractClient derives from clientbase
public partial class TWServiceContractClient : System.ServiceModel.ClientBase<TWServiceContract>, TWServiceContract


TWServiceContract is an interface.






charlyfriend wrote:
The config file seems fine. I guess that you already try "TWServiceContractClient client = new TWServiceContractClient("FinalPoint");".
In that case, then check if you proxy class, TWServiceContractClient derives from ClientBase<WCFService.Test.Client.ReportWebServiceProxy.TWServiceContract>.


Apr 14, 2008 at 3:29 PM
HI All,

Any idea how to solve this problem,
i got stuck with this error"Could not find default endpoint". I am using VS2008 and WSSF 2008.

Please let me know your ideas ..


This is how the proxy class TWServiceContractClient derives from clientbase
public partial class TWServiceContractClient : System.ServiceModel.ClientBase<TWServiceContract>, TWServiceContract


TWServiceContract is an interface.




kumarvem wrote:

This is how the proxy class TWServiceContractClient derives from clientbase
public partial class TWServiceContractClient : System.ServiceModel.ClientBase<TWServiceContract>, TWServiceContract


TWServiceContract is an interface.






charlyfriend wrote:
The config file seems fine. I guess that you already try "TWServiceContractClient client = new TWServiceContractClient("FinalPoint");".
In that case, then check if you proxy class, TWServiceContractClient derives from ClientBase<WCFService.Test.Client.ReportWebServiceProxy.TWServiceContract>.


{quote}
Apr 14, 2008 at 4:54 PM
Did you get the same error when you add the endpount name to the ctor?
(TWServiceContractClient client = new TWServiceContractClient("FinalPoint");)
Apr 14, 2008 at 5:01 PM
Edited Apr 14, 2008 at 5:01 PM
Hi Charly,

Igot the below eeror when i mention EndpointName
TWServiceContractClient client = new TWServiceContractClient("FinalPoint");


Error-----


Could not find endpoint element with name 'FinalPoint' and contract 'TWServiceContract' 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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find endpoint element with name 'FinalPoint' and contract 'TWServiceContract' 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.

Source Error:


Line 183: }
Line 184:
Line 185: public TWServiceContractClient(string endpointConfigurationName) :
Line 186: base(endpointConfigurationName)
Line 187: {


Source File: c:\Documents and Settings\pgpxv\My Documents\Visual Studio 2008\WebSites\TestReport\App_Code\TWService.cs Line: 185




charlyfriend wrote:
Did you get the same error when you add the endpount name to the ctor?
(TWServiceContractClient client = new TWServiceContractClient("FinalPoint");)

Apr 14, 2008 at 5:37 PM
Wait a minute, by reading the source file path, it seems that your client is a web app so you should use a web.config file, not an app.config so that may be the reason why you cannot loacte the endpoint.
Apr 14, 2008 at 6:17 PM
Hi Charly,

Yes i am using a WebApplication to Consume the WebServices.

First i created a WSSF(2008) Web Service

svcutil.exe http://localhost:1591/WCFService.Test.Host/ReportWebService.svc?wsdl

This generated a configuration file("Output.config") and a code file("TWService.CS") that contains the client class. Add the two files to my ClientApplication


and used the fowwing code to call web service


TWServiceContractClient client = new TWServiceContractClient("FinalPoint");


ClientParams cp = new ClientParams();

cp.ClientID = "CLA0000286";
cp.CompanyNumber = "02";
cp.State = "TN";

client.GeneratePolicyDocs(cp);
client.Close();



Please let me know what i am missing, and where i am doing wrong.





charlyfriend wrote:
Wait a minute, by reading the source file path, it seems that your client is a web app so you should use a web.config file, not an app.config so that may be the reason why you cannot loacte the endpoint.

Apr 14, 2008 at 7:56 PM
Check that all your config settings are placed in a web.config file in the root folder of your web client and NOT an App.config file.
Apr 14, 2008 at 9:01 PM
Edited Apr 14, 2008 at 9:56 PM
Hi Charly,


Thanks A Lot, I solved the Problem.


Thanks and Regards,
Kumar.






charlyfriend wrote:
Check that all your config settings are placed in a web.config file in the root folder of your web client and NOT an App.config file.

Apr 24, 2009 at 7:12 AM
Hi Kumar,
       Please let us know how you solved this problem. I am encountering the same error.

Thanks
Satyaprakash J
Apr 28, 2009 at 9:17 PM
Edited Apr 28, 2009 at 9:17 PM
Hello Satyaprakash,

Did you copied the content of the Output.config file to the web.config file of the application in which you are trying to consume the webservice?
Aug 20, 2010 at 5:18 PM

Hi Kumar,

Please help me to how to fix this problem. I am using VSTS 2008 to do the Biztalk server - WCF services Performance Testing.

I am having the same problem when I do WCF load testing i.e I have a created unit tests and the unit test working fine with out any error. Its showing the error only when I am running the loadtest and the error as follows:

Steps I did before I did: I Created web test with C# project and added a "Service Refference" thena after I completed the required code in UnitTest.cs. I debigged and executed the test with out any issues. Now I added the load test from new item. When I run the load test its started to spit the error as posted below.

 

Error when I run the load test :-- TestProject1.GetIndividualPolicyHolderInfo.TestMethod1 threw exception:  System.InvalidOperationException: Could not find default endpoint element that references contract 'ServiceReference1.ProcessItinerary' 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 contract could be found in the client element.

App.Config file that is working for unit test and the same is using for load test as well :-

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <netTcpBinding>
                <binding name="CustomBinding_ITwoWayAsync" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    transactionFlow="false" transferMode="Streamed" 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="None">
                        <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                        <message clientCredentialType="Windows" />
                    </security>
                </binding>
            </netTcpBinding>
        </bindings>
        <client>
            <endpoint address="net.tcp://required url"
                binding="netTcpBinding" bindingConfiguration="CustomBinding_ITwoWayAsync"
                contract="ServiceReference1.ProcessItinerary" name="CustomBinding_ITwoWayAsync" />
        </client>
    </system.serviceModel>
</configuration>