none
List Enum webHttpBinding erro RRS feed

  • Question

  • Hello.


    I'm trying a problem trying to pass an enumeration list for a WCF.

    Below is the code snippet:

        [DataContract]
        public class ListarFilial
        {
    
            [DataMember]
            public PagingRequest Page { get; set; }
    
            [DataMember]
            public List<TipoDeposito> TiposDeposito { get; set; }
    
            [DataMember]
            public List<TipoFilial> TiposFilial { get; set; }
    
            [DataContract, Flags]
            public enum TipoDeposito
            {
                [EnumMember]
                Loja = 1,
                [EnumMember]
                Deposito = 2
            }
    
            [DataContract, Flags]
            public enum TipoFilial
            {
                [EnumMember]
                Convencional = 1,
                [EnumMember]
                Virtual = 2,
                [EnumMember]
                Internet = 3,
                [EnumMember]
                AssistenciaTecnica = 4,
                [EnumMember]
                Deposito = 5,
                [EnumMember]
                Escritorio = 6
            }
        }


    When trying to send data to the WCF Error

    An exception of type 'System.ServiceModel.ProtocolException' occurred in mscorlib.dll but was not handled in user code

    Additional information: The remote server returned an unexpected response: (400) Bad Request.


    Monday, July 20, 2015 3:00 PM

Answers

  • Hi Thiago Da Silva Moreira,
    According to this issue,as far as I know,it means the ProtocolException exception occurs on the client when communication with the remote party is impossible because of mismatched data transfer protocols.

    Sometimes the ProtocolException can be caused by incompatible bindings between endpoints, the use of an incorrect remote endpoint address, or similar incorrect configuration.
    Next,when you send data to server, you need to make sure the data format is matched.
    I hope that will be helpful to you.
    Best Regards,
    Tracy Dj




    Tuesday, July 21, 2015 7:45 AM
    Moderator

All replies

  • Additional information: The remote server returned an unexpected response: (400) Bad Request.

    You have to put the service in debug mode and let it blow-up while in VS debug mode so that you can expose what the problem really is about. Fiddler may expose it when you see the 400 error in Fiddler and double-click the line.

    Monday, July 20, 2015 3:57 PM
  • Hi Thiago Da Silva Moreira,
    According to this issue,as far as I know,it means the ProtocolException exception occurs on the client when communication with the remote party is impossible because of mismatched data transfer protocols.

    Sometimes the ProtocolException can be caused by incompatible bindings between endpoints, the use of an incorrect remote endpoint address, or similar incorrect configuration.
    Next,when you send data to server, you need to make sure the data format is matched.
    I hope that will be helpful to you.
    Best Regards,
    Tracy Dj




    Tuesday, July 21, 2015 7:45 AM
    Moderator