Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-06

WST SOAP HTTP CONTENT TYPE

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dimitrios Chr. Ioannidis

Hi,

FYI, in a wst soap client talking to a .net web service i find out, that for SOAP calls, if the CONTENT-TYPE http header ( i'm using fpc-http-protocol ) doesn't have the 'text/xml' plus the 'charset=UTF-8' like this 'text/xml; charset=UTF-8', the server chocks. So, i changed the const sSOAP_CONTENT_TYPE in base_soap_formatter.pas to sSOAP_CONTENT_TYPE = 'text/xml; charset=UTF-8', and all is working fine.

I don't know if this is a bug or not.

Dimitrios Chr. Ioannidis

Reply by email

Reinier Olislagers
to Dimitrios Chr. Ioannidis
Dimitrios Chr. Ioannidis wrote 8 lines
FYI, in a wst soap client talking to a .net web service i find out, that for SOAP calls, if the CONTENT-TYPE http header ( i'm using fpc-http-protocol ) doesn't have the 'text/xml' plus the 'charset=UTF-8' like this 'text/xml; charset=UTF-8', the server chocks. So, i changed the const sSOAP_CONTENT_TYPE in base_soap_formatter.pas to sSOAP_CONTENT_TYPE = 'text/xml; charset=UTF-8', and all is working fine. I don't know if this is a bug or not.

No idea, but Isn't there a specific wst mailing list/group mentioned on the WST wiki page? Maybe it's a better idea to post there.

BTW: if the content is indeed UTF8, IIRC, it's not a bug to explicitly specify charset=UTF-8; a similar fix was needed for exporting XML files to Microsoft .Net dataset XML format IIRC.

Reply by email

Dimitrios Chr. Ioannidis
to Reinier Olislagers

Hi,

Στις 3/6/2014 1:20 μμ, ο/η Reinier Olislagers έγραψε:

Show quoted text 11 lines
On 03/06/2014 12:17, Dimitrios Chr. Ioannidis wrote: > FYI, in a wst soap client talking to a .net web service i find out, > that for SOAP calls, if the CONTENT-TYPE http header ( i'm using > fpc-http-protocol ) doesn't have the 'text/xml' plus the 'charset=UTF-8' > like this 'text/xml; charset=UTF-8', the server chocks. So, i changed > the const sSOAP_CONTENT_TYPE in base_soap_formatter.pas to > sSOAP_CONTENT_TYPE = 'text/xml; charset=UTF-8', and all is working fine. > > I don't know if this is a bug or not. No idea, but Isn't there a specific wst mailing list/group mentioned on the WST wiki page? Maybe it's a better idea to post there.

i already done that. I posted here also because i wanted to share it with users who doesn't keep track that list while using the wst framework.

BTW: if the content is indeed UTF8, IIRC, it's not a bug to explicitly specify charset=UTF-8; a similar fix was needed for exporting XML files to Microsoft .Net dataset XML format IIRC.

AFAIU, in the SOAP HTTP Binding the character encoding in the Content-Type header is optional.

Regards,

Dimitrios Chr. Ioannidis

Reply by email

Inoussa OUEDRAOGO
to Dimitrios Chr. Ioannidis: FYI, in a wst soap client talking to a .net web service i find out, that for SOAP calls,…

Hi

2014-06-03 10:17 UTC, Dimitrios Chr. Ioannidis :

Show quoted text 10 lines
Hi, FYI, in a wst soap client talking to a .net web service i find out, that for SOAP calls, if the CONTENT-TYPE http header ( i'm using fpc-http-protocol ) doesn't have the 'text/xml' plus the 'charset=UTF-8' like this 'text/xml; charset=UTF-8', the server chocks. So, i changed the const sSOAP_CONTENT_TYPE in base_soap_formatter.pas to sSOAP_CONTENT_TYPE = 'text/xml; charset=UTF-8', and all is working fine. I don't know if this is a bug or not.

You can change the content using the service reference :

var
  serviceRef : IMyService;
  sp : IServiceProtocol;
begin
   serviceRef := <create the service as in wst_CreateInstance_IMyService() >
   sp := serviceRef as IServiceProtocol;
   sp.GetSerializer().GetPropertyManager().SetProperty('ContentType','WhatYouWantHere');
   ....
end;
Inoussa O.

Reply by email