0
votes

I am having a problem with end point for the WCF service. I wrote the service and tested in with a windows form project. This worked fine. The problem occurs when I try to get it to work from Silverlight. The statement causing the problem is

Dim l_svcOOA As SvcZipStreamClient = New SvcZipStreamClient("BasicHttpBinding_IServiceZipStream")

The error says

Could not find endpoint element with name 'BasicHttpBinding_IServiceZipStream' and contract 'svcZipStream.ISvcZipStream' 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. Stack Trace at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName) at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName) at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address) at System.ServiceModel.ChannelFactory1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress) at System.ServiceModel.EndpointTrait1.CreateSimplexFactory() at System.ServiceModel.EndpointTrait1.CreateChannelFactory() at System.ServiceModel.ClientBase1.CreateChannelFactoryRef(EndpointTrait1 endpointTrait) at System.ServiceModel.ClientBase1.InitializeChannelFactoryRef() at System.ServiceModel.ClientBase`1..ctor(String endpointConfigurationName) at Common.svcZipStream.SvcZipStreamClient..ctor(String endpointConfigurationName) at Common.clsUtilities.GetFileInZip(String p_ZipFile, String p_FileName)

The ServiceReferences.ClientConfig is:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ISvcZipStream" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647">
                <security mode="None" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:22214/ServiceZipStream.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISvcZipStream"
            contract="svcZipStream.ISvcZipStream" name="BasicHttpBinding_ISvcZipStream" />
    </client>
</system.serviceModel>

As always, any help will be appreciated.

1

1 Answers

0
votes

I just wanted to let you know I figured out the problem. Because the call to the service was from a Silverlight class library I also needed the endpoint defined Silverlight application. I found the answer in the blog below.

http://chanmingman.wordpress.com/2011/04/04/could-not-find-endpoint-element-with-name-basichttpbinding_iservice-and-contract-servicereference1-iservice-in-the-servicemodel-client-configuration-section-this-might-be-because-no-configura/