Error during deserialization of the body of the response message to the operation - WSDL

Asked

Viewed 886 times

2

I am new to implementing services as a reference, and I see myself at the moment at a dead end.

I can successfully test the call to the service via Postman. It is worth saying that a certificate is required, but once added in Postman, I have no problem.

I am trying to consume this same service referenced in my application in Web_appreferences. The . wsdl file used to add the reference to the project comes from a url provided by the company that developed it. Thus, as expected, some classes (types) are generated and made available as metadata. Among them we have the class (type) that allows me to instantiate the customer who will consume the service and the class (type) that will be used to receive the reply.

The customer object used to make the call to service needs to be configured in my application to meet the requirements of the service:

var transport = new HttpsTransportBindingElement();
transport.RequireClientCertificate = true;  
CustomBinding binding = new CustomBinding(new CustomTextMessageBindingElement("ISO-8859-1", "text/xml", MessageVersion.Soap11), transport);       
cliente.Endpoint.Binding = binding;
cliente.ClientCredentials.ClientCertificate.Certificate = SecureWebServiceHelper.CriarCertificado();

Next, the customer calls the service by passing the expected parameter:

respostasolicitarProtocoloWS resposta = cliente.solicitarProtocoloOperation(solicitacao);

However, when getting the answer from it, an Exception is generated:

"Exeption: Error during deserialization of the body of the reply message for the 'request' operation. Innerexception: Error in XML document (1.548). Innerexception: Invalid character in the given encoding. Line 1, position 548."

Consulting the company that makes the service available to me, I receive information that my calls occur successfully within their application. This leads me to think that the problem may be generated by some wrong configuration in my application or even in Visual Studio. Does anyone have any idea?

1 answer

0

Hello.

Try modifying the following settings in the client’s app.config:

<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

Browser other questions tagged

You are not signed in. Login or sign up in order to post.