none
IndexOutOfRangeException from MessageSecurityOverHttpElement class of System.ServiceModel.dll RRS feed

  • Question

  • I am getting the "System.IndexOutOfRangeException" exception when I try to create a Service Proxy object in the WCF Client application. I am getting this only in some select machines. It is working fine in all the other machines. See the Stack Trace below.

    System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
       at System.Configuration.PropertyInformationCollection..ctor(ConfigurationElement thisElement)
       at System.Configuration.ElementInformation.get_Properties()
       at System.ServiceModel.Configuration.MessageSecurityOverHttpElement.ApplyConfiguration(MessageSecurityOverHttp security)
       at System.ServiceModel.Configuration.WSHttpSecurityElement.ApplyConfiguration(WSHttpSecurity security)
       at System.ServiceModel.Configuration.WSHttpBindingElement.OnApplyConfiguration(Binding binding)
       at System.ServiceModel.Configuration.StandardBindingElement.ApplyConfiguration(Binding binding)
       at System.ServiceModel.Description.ConfigLoader.LookupBinding(String bindingSectionName, String configurationName, ContextInformation context)
       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.ClientBase`1..ctor(String endpointConfigurationName)
       at WCFClient.WCFServiceClient..ctor(String endpointConfigurationName) in C:\WCFClient\Service References\WCFServiceClient.cs:line 148



    See below how I am creating the Service Proxy object in the Client.
    WCFServiceClient WCFServiceProxy = new WCFServiceClient(endpointname);


    See below the WCF Server Configuration.
    <system.serviceModel>
        <
    bindings>
            <
    wsHttpBinding>
                <
    binding name="WsHttpBinding_WCFService">
                    <
    security>
                        <
    transport clientCredentialType="None" />
                    </
    security>
                </
    binding>
            </
    wsHttpBinding>
        </
    bindings>
        <
    services>
            <service behaviorConfiguration="behaviour" name="WCFService">
                <
    endpoint address="http://localhost:2842/WCFService/Service.svc"
                binding="wsHttpBinding"

                bindingConfiguration
    ="WsHttpBinding_WCFService" 
                name
    ="WCFService_wsHttpBinding"
                contract="IWCFService"
                listenUri="http://localhost:2842/WCFService/Service.svc" />
            </
    service>
        </
    services> 
        <
    behaviors>
            <
    serviceBehaviors>
                <
    behavior name="behaviour">
                    <
    serviceDebug includeExceptionDetailInFaults="true"/>
                    <
    serviceMetadata httpGetEnabled="true"/>
                </
    behavior>
            </
    serviceBehaviors>
        </
    behaviors>
    </system.serviceModel>

    See below the configuration on the Client machine.
    <system.serviceModel
        <
    bindings>
            <wsHttpBinding>
                <binding name="WCFService_WSHttpBinding">
                    <
    security>
                        <
    transport clientCredentialType="None" />
                    </
    security>
                </
    binding>
            </
    wsHttpBinding>
        </bindings>
        <client>
            <endpoint address=http://localhost:2842/WCFService/Service.svc 
                
    binding="wsHttpBinding" 
                bindingConfiguration="WCFService_WSHttpBinding"
                contract="IWCFService"
                name="WSHttpBinding_WCFService">
                <
    identity>
                    <
    userPrincipalName value="D-142218\administrator" />
                </
    identity>
            </
    endpoint>
        </client>
    </
    system.serviceModel>


    Any idea why it happens?

    Thanks.
     

    • Edited by sibitg Wednesday, October 15, 2008 3:22 PM
    Wednesday, October 15, 2008 12:37 PM

All replies