none
Problem with endpoint WCF calling from Silverlight RRS feed

  • Question

  • 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 svcZipStream.ServiceZipStreamClient = New svcZipStream.ServiceZipStreamClient("BasicHttpBinding_IServiceZipStream")

     

    The error says

     Could not find endpoint element with name 'BasicHttpBinding_IServiceZipStream' and contract 'svcZipStream.IServiceZipStream' 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.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)

       at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()

       at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()

       at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)

       at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()

       at System.ServiceModel.ClientBase`1..ctor(String endpointConfigurationName)

       at Common.svcZipStream.ServiceZipStreamClient..ctor(String endpointConfigurationName)

       at Common.clsUtilities.GetFileInZip(String p_ZipFile, String p_FileName)

    The ServiceReferences.ClientConfig is:

    <configuration>

      

        <system.serviceModel>

        

         

            <bindings>

                <basicHttpBinding>

                    <binding name="BasicHttpBinding_IServiceZipStream" maxBufferSize="2147483647"

                        maxReceivedMessageSize="2147483647">

                        <security mode="None" />

                    </binding>

                </basicHttpBinding>

            </bindings>

            <client>

                <endpoint address="http://localhost:43871/ServiceZipStream.svc"

                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServiceZipStream"

                    contract="svcZipStream.IServiceZipStream" name="BasicHttpBinding_IServiceZipStream" />

            </client>

        </system.serviceModel>

    </configuration>

    I solved the problem so I wanted to post the answer for anyone who looks for this problem in the future.

    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/

    Any help will be appreciated.

    Bob


    Bob Avallone


    Wednesday, May 1, 2013 7:30 PM

Answers

  • On 5/1/2013 3:30 PM, Bob Avallone CHIA wrote:

    I solved the problem so I wanted to post the answer for anyone who looks for this problem in the future.

    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/



    Any help will be appreciated.

      Yes, normally a classlib project that consumed the WCF service and where the app.config is created with WCF elements in the app.config is not the root application project config file.

    The WCF elements must be  moved to the application solution's root-config of the root-project, which the root.config can be a Web.config or an app.config. .NET does not look for any configuration information in any config files that are in other projects subordinate to the root project and its config file.
     It should be also noted that if one created a classlib project call it IntergrationTest, it was being tested using MS Test with Nunit,  and it had reference to a to a classlib project that consumed the WCF service.

    In this case, IntergrationTest project would be the root-project that MS Test is hosting and is where the app.config in the project would be the root.config, and it's where the WCF configuration must be placed in order for it to be found by .NET.
     One must understand the configuration file hierarchy in .NET. .NET only looks in the root config file for information. If the configuration information is in any subordinate config file under the root config, .NET will not find the configuration information.

    Friday, May 3, 2013 3:26 AM

All replies

  • Hi,

    Thanks for your post.

    It seems the issue was resolved here, thanks for sharing the solution, it will be very beneficial for other community members who have similar questions.

    Best Regards. 


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 3, 2013 1:50 AM
    Moderator
  • On 5/1/2013 3:30 PM, Bob Avallone CHIA wrote:

    I solved the problem so I wanted to post the answer for anyone who looks for this problem in the future.

    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/



    Any help will be appreciated.

      Yes, normally a classlib project that consumed the WCF service and where the app.config is created with WCF elements in the app.config is not the root application project config file.

    The WCF elements must be  moved to the application solution's root-config of the root-project, which the root.config can be a Web.config or an app.config. .NET does not look for any configuration information in any config files that are in other projects subordinate to the root project and its config file.
     It should be also noted that if one created a classlib project call it IntergrationTest, it was being tested using MS Test with Nunit,  and it had reference to a to a classlib project that consumed the WCF service.

    In this case, IntergrationTest project would be the root-project that MS Test is hosting and is where the app.config in the project would be the root.config, and it's where the WCF configuration must be placed in order for it to be found by .NET.
     One must understand the configuration file hierarchy in .NET. .NET only looks in the root config file for information. If the configuration information is in any subordinate config file under the root config, .NET will not find the configuration information.

    Friday, May 3, 2013 3:26 AM