response content type

yes you’re right , the company ha configured this proxy on apigee.

The problem is in the space between contenttype and chareset , with autogerated proxy i’m not able to change the charset , but i’m new to api programming maybe is for this.

the charset set by the autogenerated class is always text/xml; charset=utf-8 even if I try to override it without the space.

Notice the space before the semicolon. This way I get the following error from apigee

The content of the response detected by the client is of type ‘application/xml’, instead of the expected ‘text/xml’. Request failed with empty response.

this is the response message

Message stage: SOAP RESPONSE (AfterSerialize)
Exception thrown? No

<?xml version="1.0" encoding="utf-8"?>2024where 1 = 0

Web service: https://api-svil.groupama.it/gestioneMailRoom/1
Web method: urn:getMailRoomQryTbPAnno
Called at 21/03/2024 20:48:34
Message stage: SOAP REQUEST (BeforeDeserialize)

<env:Envelope xmlns:env=“http://www.w3.org/2003/05/soap-envelope”>env:Header/env:Bodyenv:Faultenv:Codeenv:ValueError</env:Value>
</env:Code>env:Reason<env:Text xml:lang=“en-US”>
Invalid SOAP Message
</env:Text>
</env:Reason>
</env:Fault>
</env:Body>
</env:Envelope>

to solve the problem after many research and many many attemts i added this class

but in this way i must write a wrapper for each method , no more override webrequest ..

MailRoomPortTypeClient is the autogenerated proxy class after addin service reference and passing wsdl.

previously using the class generated via webreference I could automatically intercept and overwrite the webrequest

1 Like