Hi, I am using XE7, Win8.1 I have a https site with a webservice and I am trying to use Indy HTTP to post a request without success. I always get "HTTP/1.0 500 Error" I have tested with SOAPUI. I can to do a request post and I get a correct response. Here is the post with SOAPUI. Request: {code} POST https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "" Content-Length: 4463 Host: wsp.hom.orizonbrasil.com.br:6214 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.ans.gov.br/padroes/tiss/schemas" xmlns:xd="http://www.w3.org/2000/09/xmldsig#"> <soapenv:Header/> <soapenv:Body> <sch:solicitacaoProcedimentoWS> <sch:cabecalho> <sch:identificacaoTransacao> <sch:tipoTransacao>SOLICITACAO_PROCEDIMENTOS</sch:tipoTransacao> <sch:sequencialTransacao>k1</sch:sequencialTransacao> <sch:dataRegistroTransacao>2015-01-30</sch:dataRegistroTransacao> <sch:horaRegistroTransacao>16:55:00</sch:horaRegistroTransacao> ...... ...... {code} Response with SOAPUI: {code} HTTP/1.1 200 OK X-Backside-Transport: OK OK Connection: Keep-Alive Content-Encoding: gzip Transfer-Encoding: chunked Content-Type: text/xml Date: Tue, 10 Feb 2015 12:56:43 GMT Server: DistribuidorV3-Orizon/4.6.2 X-Client-IP: 179.236.254.241 <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.ans.gov.br/padroes/tiss/schemas" xmlns:xd="http://www.w3.org/2000/09/xmldsig#"> <soapenv:Header/> <soapenv:Body> <sch:autorizacaoProcedimentoWS> <sch:cabecalho> <sch:identificacaoTransacao> <sch:tipoTransacao>RESPOSTA_SOLICITACAO</sch:tipoTransacao> <sch:sequencialTransacao>k1</sch:sequencialTransacao> <sch:dataRegistroTransacao>2015-01-30</sch:dataRegistroTransacao> <sch:horaRegistroTransacao>16:55:00</sch:horaRegistroTransacao> </sch:identificacaoTransacao> <sch:falhaNegocio>5015</sch:falhaNegocio> <sch:origem> <sch:identificacaoPrestador> <sch:codigoPrestadorNaOperadora>4529</sch:codigoPrestadorNaOperadora> </sch:identificacaoPrestador> ...... ....... {code} Using Indy, I am trying to do the same request post but I get always HTTP/1.0 500 Error Here is my code: {code} procedure TForm5.Button3Click(Sender: TObject); var S: TStringList; M: TStream; SSL1 : TIdSSLIOHandlerSocketOpenSSL; begin SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); SSL1.SSLOptions.Method := sslvSSLv23; S := TStringList.Create; M := TMemoryStream.Create; try // here is the content starting at <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" //xmlns:sch="http://www.ans.gov.br/padroes/tiss/schemas" xmlns:xd="http://www.w3.org/2000/09/xmldsig#"> S.Text:=Memo1.Text; IdHTTP1.IOHandler := SSL1; IdHTTP1.Request.ContentType := 'text/xml;charset=UTF-8'; IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', S, M); MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); M.Position := 0; S.LoadFromStream(M); MemoResp.Lines.AddStrings(S); finally SSl1.Free; S.Free; M.Free; end; end; {code} Please, some help will be appreciated. Thanks in Advance, Luiz
![]() |
0 |
![]() |
Mr Remy, Very thanks for your help. I have tried your two suggestions, but the result is the same. I still have the same "HTTP/1.0 500 Error" The site has a webservice in "https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento" and I have no certicate installed in windows. Also, I didn´t installed certificate in SOAPUI and it works well. The site administrator said me that certificate is not required. First, I was trying to consume the webservice with HTTPRIO-SOAP using WinInet(default install drom XE7) and I have no success. It shows a message saying a certificatte is required to authetication of the client. Although the certificate is not required, I get always this message. So, trying to solve the problem I compiled SOAP units to work using Indy instead WinInet but when I try consume the webservice I get a message "HTTP/1.0 500 Internal Server Error". I am now trying post directly with IdHttp and I get the error: HTTP/1.0 500 Error With Indy or WinInet I am unable to get a correct response. With SOPAUI, all is ok. Can you help me to solve it? Best Regards, Luiz > {quote:title=Remy Lebeau (TeamB) wrote:}{quote} > Luiz wrote: > > > I have a https site with a webservice and I am trying to use Indy HTTP > > to post a request without success. I always get "HTTP/1.0 500 Error" > > That usually means you are posting bad data to the server, causing it to > crash or otherwise mismanage the request. 500 is typically used for server-side > runtime errors. > > > I have tested with SOAPUI. I can to do a request post and I get a > > correct response. Here is the post with SOAPUI. > <snip> > > Using Indy, I am trying to do the same request post but I get always > > HTTP/1.0 500 Error > > That is because you are posting the SOAP data using a TStringList. TIdHTTP > encodes TStrings data in a manner appropriate for an "application/x-www-form-urlencoded" > formatted request (ie, a webform submission), which your server is not expecting, > and is going to break you XML. You need to use a TStream instead, so TIdHTTP > will post the XML as-is, eg: > > {code} > procedure TForm5.Button3Click(Sender: TObject); > var > Req, Resp: TStream; > SL: TStringList; > SSL1 : TIdSSLIOHandlerSocketOpenSSL; > begin > Resp := TMemoryStream.Create; > try > Req := TMemoryStream.Create; > try > WriteStringToStream(Req, Memo1.Text, IndyTextEncoding_UTF8); > Req.Position := 0; > > SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); > try > SSL1.SSLOptions.Method := sslvSSLv23; > IdHTTP1.IOHandler := SSL1; > > IdHTTP1.Request.ContentType := 'text/xml'; > IdHTTP1.Request.Charset := 'UTF-8'; > IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', > Req, Resp); > finally > SSl1.Free; > end; > finally > Req.Free; > end; > > MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); > MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); > > SL := TStirngList.Create; > try > Resp.Position := 0; > SL.LoadFromStream(Resp); > MemoResp.Lines.AddStrings(SL); > finally > SL.Free; > end; > finally > Resp.Free; > end; > end; > {code} > > > Alternatively: > > {code} > procedure TForm5.Button3Click(Sender: TObject); > var > Req: TStream; > SL: TStringList; > S: String; > SSL1 : TIdSSLIOHandlerSocketOpenSSL; > begin > Req := TStringStream.Create(Memo1.Text, TEncoding.UTF8); > try > SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); > try > SSL1.SSLOptions.Method := sslvSSLv23; > IdHTTP1.IOHandler := SSL1; > > IdHTTP1.Request.ContentType := 'text/xml'; > IdHTTP1.Request.Charset := 'UTF-8'; > > S := IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', > Req); > finally > SSl1.Free; > end; > finally > Req.Free; > end; > > MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); > MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); > > SL := TStringList.Create; > try > SL.Text := S; > MemoResp.Lines.AddStrings(SL); > finally > SL.Free; > end; > end; > {code} > > -- > Remy Lebeau (TeamB) Edited by: Luiz Oliveira on Feb 10, 2015 2:02 PM
![]() |
-1 |
![]() |
Luiz wrote: > I have a https site with a webservice and I am trying to use Indy HTTP > to post a request without success. I always get "HTTP/1.0 500 Error" That usually means you are posting bad data to the server, causing it to crash or otherwise mismanage the request. 500 is typically used for server-side runtime errors. > I have tested with SOAPUI. I can to do a request post and I get a > correct response. Here is the post with SOAPUI. <snip> > Using Indy, I am trying to do the same request post but I get always > HTTP/1.0 500 Error That is because you are posting the SOAP data using a TStringList. TIdHTTP encodes TStrings data in a manner appropriate for an "application/x-www-form-urlencoded" formatted request (ie, a webform submission), which your server is not expecting, and is going to break you XML. You need to use a TStream instead, so TIdHTTP will post the XML as-is, eg: {code} procedure TForm5.Button3Click(Sender: TObject); var Req, Resp: TStream; SL: TStringList; SSL1 : TIdSSLIOHandlerSocketOpenSSL; begin Resp := TMemoryStream.Create; try Req := TMemoryStream.Create; try WriteStringToStream(Req, Memo1.Text, IndyTextEncoding_UTF8); Req.Position := 0; SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); try SSL1.SSLOptions.Method := sslvSSLv23; IdHTTP1.IOHandler := SSL1; IdHTTP1.Request.ContentType := 'text/xml'; IdHTTP1.Request.Charset := 'UTF-8'; IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', Req, Resp); finally SSl1.Free; end; finally Req.Free; end; MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); SL := TStirngList.Create; try Resp.Position := 0; SL.LoadFromStream(Resp); MemoResp.Lines.AddStrings(SL); finally SL.Free; end; finally Resp.Free; end; end; {code} Alternatively: {code} procedure TForm5.Button3Click(Sender: TObject); var Req: TStream; SL: TStringList; S: String; SSL1 : TIdSSLIOHandlerSocketOpenSSL; begin Req := TStringStream.Create(Memo1.Text, TEncoding.UTF8); try SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); try SSL1.SSLOptions.Method := sslvSSLv23; IdHTTP1.IOHandler := SSL1; IdHTTP1.Request.ContentType := 'text/xml'; IdHTTP1.Request.Charset := 'UTF-8'; S := IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', Req); finally SSl1.Free; end; finally Req.Free; end; MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); SL := TStringList.Create; try SL.Text := S; MemoResp.Lines.AddStrings(SL); finally SL.Free; end; end; {code} -- Remy Lebeau (TeamB)
![]() |
1 |
![]() |
Mr Remy, Very thanks for your help. I have tried your two suggestions, but the result is the same. I still have the same "HTTP/1.0 500 Error" The site has a webservice in "https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento" and I have no certicate installed in windows. Also, I didn´t installed certificate in SOAPUI and it works well. The site administrator said me that certificate is not required. With Indy I am unable to get a correct response. Can you help me to solve it? Best Regards, Luiz > {quote:title=Remy Lebeau (TeamB) wrote:}{quote} > Luiz wrote: > > > I have a https site with a webservice and I am trying to use Indy HTTP > > to post a request without success. I always get "HTTP/1.0 500 Error" > > That usually means you are posting bad data to the server, causing it to > crash or otherwise mismanage the request. 500 is typically used for server-side > runtime errors. > > > I have tested with SOAPUI. I can to do a request post and I get a > > correct response. Here is the post with SOAPUI. > <snip> > > Using Indy, I am trying to do the same request post but I get always > > HTTP/1.0 500 Error > > That is because you are posting the SOAP data using a TStringList. TIdHTTP > encodes TStrings data in a manner appropriate for an "application/x-www-form-urlencoded" > formatted request (ie, a webform submission), which your server is not expecting, > and is going to break you XML. You need to use a TStream instead, so TIdHTTP > will post the XML as-is, eg: > > {code} > procedure TForm5.Button3Click(Sender: TObject); > var > Req, Resp: TStream; > SL: TStringList; > SSL1 : TIdSSLIOHandlerSocketOpenSSL; > begin > Resp := TMemoryStream.Create; > try > Req := TMemoryStream.Create; > try > WriteStringToStream(Req, Memo1.Text, IndyTextEncoding_UTF8); > Req.Position := 0; > > SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); > try > SSL1.SSLOptions.Method := sslvSSLv23; > IdHTTP1.IOHandler := SSL1; > > IdHTTP1.Request.ContentType := 'text/xml'; > IdHTTP1.Request.Charset := 'UTF-8'; > IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', > Req, Resp); > finally > SSl1.Free; > end; > finally > Req.Free; > end; > > MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); > MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); > > SL := TStirngList.Create; > try > Resp.Position := 0; > SL.LoadFromStream(Resp); > MemoResp.Lines.AddStrings(SL); > finally > SL.Free; > end; > finally > Resp.Free; > end; > end; > {code} > > > Alternatively: > > {code} > procedure TForm5.Button3Click(Sender: TObject); > var > Req: TStream; > SL: TStringList; > S: String; > SSL1 : TIdSSLIOHandlerSocketOpenSSL; > begin > Req := TStringStream.Create(Memo1.Text, TEncoding.UTF8); > try > SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); > try > SSL1.SSLOptions.Method := sslvSSLv23; > IdHTTP1.IOHandler := SSL1; > > IdHTTP1.Request.ContentType := 'text/xml'; > IdHTTP1.Request.Charset := 'UTF-8'; > > S := IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', > Req); > finally > SSl1.Free; > end; > finally > Req.Free; > end; > > MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); > MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); > > SL := TStringList.Create; > try > SL.Text := S; > MemoResp.Lines.AddStrings(SL); > finally > SL.Free; > end; > end; > {code} > > -- > Remy Lebeau (TeamB)
![]() |
-1 |
![]() |
Luiz wrote: > I have tried your two suggestions, but the result is the same. I > still have the same "HTTP/1.0 500 Error" Then either your SOAP XML is malformed, or you are not posting everything that the webservice is expecting (for instance, are you setting the SOAP-related HTTP headers anywhere in your code? You did not show that). You could use a debugging proxy, such as Fiddler, to compare the requests of SOAPUI and TIdHTTP to see what is different between them, and then update your TIdHTTP code accordingly. -- Remy Lebeau (TeamB)
![]() |
-1 |
![]() |
Luiz wrote: > I have tried your two suggestions, but the result is the same. I > still have the same "HTTP/1.0 500 Error" Then either your SOAP XML is malformed, or you are not posting everything that the webservice is expecting (for instance, are you setting the SOAP-related HTTP headers anywhere in your code? You did not show that). You could use a debugging proxy, such as Fiddler, to compare the requests of SOAPUI and TIdHTTP to see what is different between them, otherwise have the site admin debug the webservice and find out why it is returning 500, and then update your TIdHTTP code accordingly. -- Remy Lebeau (TeamB)
![]() |
0 |
![]() |
Mr Reny, These are the Headers showing in SOAP. I copied them to IdHttp but the error is the same. {code} POST https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "" Content-Length: 4463 Host: wsp.hom.orizonbrasil.com.br:6214 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.ans.gov.br/padroes/tiss/schemas" xmlns:xd="http://www.w3.org/2000/09/xmldsig#"> <soapenv:Header/> <soapenv:Body> <sch:solicitacaoProcedimentoWS> <sch:cabecalho> <sch:identificacaoTransacao> <sch:tipoTransacao>SOLICITACAO_PROCEDIMENTOS</sch:tipoTransacao> <sch:sequencialTransacao>k1</sch:sequencialTransacao> <sch:dataRegistroTransacao>2015-01-30</sch:dataRegistroTransacao> <sch:horaRegistroTransacao>16:55:00</sch:horaRegistroTransacao> </sch:identificacaoTransacao> <sch:origem> {code} Here is my delphi code: {code} procedure TForm5.Button3Click(Sender: TObject); var Req: TStream; SL: TStringList; S: String; SSL1 : TIdSSLIOHandlerSocketOpenSSL; begin Req := TStringStream.Create(Memo1.Text, TEncoding.UTF8); try SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); try SSL1.SSLOptions.Method := sslvSSLv23; IdHTTP1.IOHandler := SSL1; IdHTTP1.Request.ContentType := 'text/xml'; IdHTTP1.Request.Charset := 'UTF-8'; IdHTTP1.Request.AcceptEncoding:='gzip,deflate'; IdHTTP1.Request.Connection:='Keep-Alive'; IdHTTP1.Request.UserAgent:='Apache-HttpClient/4.1.1 (java 1.5)'; IdHTTP1.Request.RawHeaders.Add('SOAPAction: ""'); S := IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', Req); finally SSl1.Free; end; finally Req.Free; end; MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); SL := TStringList.Create; try SL.Text := S; MemoResp.Lines.AddStrings(SL); finally SL.Free; end; end; {code} > {quote:title=Remy Lebeau (TeamB) wrote:}{quote} > Luiz wrote: > > > I have tried your two suggestions, but the result is the same. I > > still have the same "HTTP/1.0 500 Error" > > Then either your SOAP XML is malformed, or you are not posting everything > that the webservice is expecting (for instance, are you setting the SOAP-related > HTTP headers anywhere in your code? You did not show that). You could use > a debugging proxy, such as Fiddler, to compare the requests of SOAPUI and > TIdHTTP to see what is different between them, otherwise have the site admin > debug the webservice and find out why it is returning 500, and then update your > TIdHTTP code accordingly. > > -- > Remy Lebeau (TeamB)
![]() |
0 |
![]() |
Mr Remy, These are the Headers showing in SOAP. I copied them to IdHttp but the error is the same. {code} POST https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "" Content-Length: 4463 Host: wsp.hom.orizonbrasil.com.br:6214 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.ans.gov.br/padroes/tiss/schemas" xmlns:xd="http://www.w3.org/2000/09/xmldsig#"> <soapenv:Header/> <soapenv:Body> <sch:solicitacaoProcedimentoWS> <sch:cabecalho> <sch:identificacaoTransacao> <sch:tipoTransacao>SOLICITACAO_PROCEDIMENTOS</sch:tipoTransacao> <sch:sequencialTransacao>k1</sch:sequencialTransacao> <sch:dataRegistroTransacao>2015-01-30</sch:dataRegistroTransacao> <sch:horaRegistroTransacao>16:55:00</sch:horaRegistroTransacao> </sch:identificacaoTransacao> <sch:origem> {code} Here is my delphi code: {code} procedure TForm5.Button3Click(Sender: TObject); var Req: TStream; SL: TStringList; S: String; SSL1 : TIdSSLIOHandlerSocketOpenSSL; begin Req := TStringStream.Create(Memo1.Text, TEncoding.UTF8); try SSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil); try SSL1.SSLOptions.Method := sslvSSLv23; IdHTTP1.IOHandler := SSL1; IdHTTP1.Request.ContentType := 'text/xml'; IdHTTP1.Request.Charset := 'UTF-8'; IdHTTP1.Request.AcceptEncoding:='gzip,deflate'; IdHTTP1.Request.Connection:='Keep-Alive'; IdHTTP1.Request.UserAgent:='Apache-HttpClient/4.1.1 (java 1.5)'; IdHTTP1.Request.RawHeaders.Add('SOAPAction: ""'); S := IdHTTP1.Post('https://wsp.hom.orizonbrasil.com.br:6214/tiss/v30200/tissSolicitacaoProcedimento', Req); finally SSl1.Free; end; finally Req.Free; end; MemoResp.Lines.Add(Format('Response Code: %d', [IdHTTP1.ResponseCode])); MemoResp.Lines.Add(Format('Response Text: %s', [IdHTTP1.ResponseText])); SL := TStringList.Create; try SL.Text := S; MemoResp.Lines.AddStrings(SL); finally SL.Free; end; end; {code} > {quote:title=Remy Lebeau (TeamB) wrote:}{quote} > Luiz wrote: > > > I have tried your two suggestions, but the result is the same. I > > still have the same "HTTP/1.0 500 Error" > > Then either your SOAP XML is malformed, or you are not posting everything > that the webservice is expecting (for instance, are you setting the SOAP-related > HTTP headers anywhere in your code? You did not show that). You could use > a debugging proxy, such as Fiddler, to compare the requests of SOAPUI and > TIdHTTP to see what is different between them, otherwise have the site admin > debug the webservice and find out why it is returning 500, and then update your > TIdHTTP code accordingly. > > -- > Remy Lebeau (TeamB) Edited by: Luiz Oliveira on Feb 10, 2015 2:27 PM
![]() |
0 |
![]() |
Luiz wrote: > IdHTTP1.Request.AcceptEncoding:='gzip,deflate'; Don't set those values manually. TIdHTTP manages that internally as needed. If you want to support compression, you have to assign a compressor component to the TIdHTTP.Compressor property, then TIdHTTP will enable gzip and deflate compression. > IdHTTP1.Request.RawHeaders.Add('SOAPAction: ""'); You need to use the CustomHeaders property instead of the RawHeaders property, and you should use the AddValue() method: {code} IdHTTP1.Request.CustomHeaders.AddValue('SOAPAction', '""'); {code} With that said, did you verify that TIdHTTP is transmitting the SOAP XML *exactly* the same way that SOAPUI does? It should be. If you are STILL having the same problem, then this is likely going to turn out to be an SSL problem, not a TIdHTTP problem. The fact that WinInet complains about a missing certificate is suspicious. You really need to have the site admin debug the webservice on the server side and find out exactly what is failing. That should be easy if the server is logging error information. I would also suggest you use Wireshark to debug the SSL handshakes that SOAPUI and TIdHTTP are both sending. You are getting a valid HTTP response, so clearly a secure session is being estalbished, but maybe the webservice is configured to validate client certificates. You have to talk to the site admin about that. -- Remy Lebeau (TeamB)
![]() |
0 |
![]() |
Mr Remy, I was doing copy and past from SOAPUI to TMemo in Delphi. for some reason I still do not know, the copy was corrupted. Now, all is working with idHTTP. I did tests with SOAP units compiled with Indy and all works great. With SOAP WinInet compiled Units, the app always getg error about certificate required. To compile SOAP Units with Indy, I copied soap units from delphi source to local app folder of my app and I edited Soap.SOAPHTTPTrans commenting NEXTGEN as showing here. Could you tell me if this is the right way to do this ? Very thanks for your help. Luiz {code} unit Soap.SOAPHTTPTrans; {$IF CompilerVersion >= 24.0} {$LEGACYIFEND ON} {$IFEND} {$IFDEF POSIX} {$DEFINE USE_INDY} {$ENDIF} {$IFDEF MSWINDOWS} {.$IFDEF NEXTGEN} {$DEFINE USE_INDY} {.$ENDIF} {$ENDIF} {code} > {quote:title=Remy Lebeau (TeamB) wrote:}{quote} > Luiz wrote: > > > IdHTTP1.Request.AcceptEncoding:='gzip,deflate'; > > Don't set those values manually. TIdHTTP manages that internally as needed. > If you want to support compression, you have to assign a compressor component > to the TIdHTTP.Compressor property, then TIdHTTP will enable gzip and deflate > compression. > > > IdHTTP1.Request.RawHeaders.Add('SOAPAction: ""'); > > You need to use the CustomHeaders property instead of the RawHeaders property, > and you should use the AddValue() method: > > {code} > IdHTTP1.Request.CustomHeaders.AddValue('SOAPAction', '""'); > {code} > > With that said, did you verify that TIdHTTP is transmitting the SOAP XML > *exactly* the same way that SOAPUI does? It should be. > > If you are STILL having the same problem, then this is likely going to turn > out to be an SSL problem, not a TIdHTTP problem. The fact that WinInet complains > about a missing certificate is suspicious. You really need to have the site > admin debug the webservice on the server side and find out exactly what is > failing. That should be easy if the server is logging error information. > I would also suggest you use Wireshark to debug the SSL handshakes that > SOAPUI and TIdHTTP are both sending. You are getting a valid HTTP response, > so clearly a secure session is being estalbished, but maybe the webservice > is configured to validate client certificates. You have to talk to the site > admin about that. > > -- > Remy Lebeau (TeamB)
![]() |
0 |
![]() |
Mr Remy, I was doing copy and past from SOAPUI request message to TMemo in Delphi. for some reason I still do not know, the copy was corrupted. Now, all is working with idHTTP. I did tests with SOAP units compiled with Indy and all works great. With SOAP WinInet compiled Units, the app always getg error about certificate required. To compile SOAP Units with Indy, I copied soap units from delphi source to local app folder of my app and I edited Soap.SOAPHTTPTrans commenting NEXTGEN as showing here. Could you tell me if this is the right way to do this ? Very thanks for your help. Luiz {code} unit Soap.SOAPHTTPTrans; {$IF CompilerVersion >= 24.0} {$LEGACYIFEND ON} {$IFEND} {$IFDEF POSIX} {$DEFINE USE_INDY} {$ENDIF} {$IFDEF MSWINDOWS} {.$IFDEF NEXTGEN} {$DEFINE USE_INDY} {.$ENDIF} {$ENDIF} {code} > {quote:title=Remy Lebeau (TeamB) wrote:}{quote} > Luiz wrote: > > > IdHTTP1.Request.AcceptEncoding:='gzip,deflate'; > > Don't set those values manually. TIdHTTP manages that internally as needed. > If you want to support compression, you have to assign a compressor component > to the TIdHTTP.Compressor property, then TIdHTTP will enable gzip and deflate > compression. > > > IdHTTP1.Request.RawHeaders.Add('SOAPAction: ""'); > > You need to use the CustomHeaders property instead of the RawHeaders property, > and you should use the AddValue() method: > > {code} > IdHTTP1.Request.CustomHeaders.AddValue('SOAPAction', '""'); > {code} > > With that said, did you verify that TIdHTTP is transmitting the SOAP XML > *exactly* the same way that SOAPUI does? It should be. > > If you are STILL having the same problem, then this is likely going to turn > out to be an SSL problem, not a TIdHTTP problem. The fact that WinInet complains > about a missing certificate is suspicious. You really need to have the site > admin debug the webservice on the server side and find out exactly what is > failing. That should be easy if the server is logging error information. > I would also suggest you use Wireshark to debug the SSL handshakes that > SOAPUI and TIdHTTP are both sending. You are getting a valid HTTP response, > so clearly a secure session is being estalbished, but maybe the webservice > is configured to validate client certificates. You have to talk to the site > admin about that. > > -- > Remy Lebeau (TeamB) Edited by: Luiz Oliveira on Feb 11, 2015 3:28 PM
![]() |
0 |
![]() |
Mr Remy, I was doing copy and past from SOAPUI request message to TMemo in Delphi. for some reason I still do not know, the copy was corrupted. Now, all is working with idHTTP. I did tests with SOAP units compiled with Indy and all works great. With SOAP WinInet compiled Units, the app always getg error about certificate required. To compile SOAP Units with Indy, I copied soap units from delphi source to local app folder and I edited Soap.SOAPHTTPTrans commenting NEXTGEN as showing here. Could you tell me if this is the right way to do this ? Very thanks for your help. Luiz {code} unit Soap.SOAPHTTPTrans; {$IF CompilerVersion >= 24.0} {$LEGACYIFEND ON} {$IFEND} {$IFDEF POSIX} {$DEFINE USE_INDY} {$ENDIF} {$IFDEF MSWINDOWS} {.$IFDEF NEXTGEN} {$DEFINE USE_INDY} {.$ENDIF} {$ENDIF} {code} > {quote:title=Remy Lebeau (TeamB) wrote:}{quote} > Luiz wrote: > > > IdHTTP1.Request.AcceptEncoding:='gzip,deflate'; > > Don't set those values manually. TIdHTTP manages that internally as needed. > If you want to support compression, you have to assign a compressor component > to the TIdHTTP.Compressor property, then TIdHTTP will enable gzip and deflate > compression. > > > IdHTTP1.Request.RawHeaders.Add('SOAPAction: ""'); > > You need to use the CustomHeaders property instead of the RawHeaders property, > and you should use the AddValue() method: > > {code} > IdHTTP1.Request.CustomHeaders.AddValue('SOAPAction', '""'); > {code} > > With that said, did you verify that TIdHTTP is transmitting the SOAP XML > *exactly* the same way that SOAPUI does? It should be. > > If you are STILL having the same problem, then this is likely going to turn > out to be an SSL problem, not a TIdHTTP problem. The fact that WinInet complains > about a missing certificate is suspicious. You really need to have the site > admin debug the webservice on the server side and find out exactly what is > failing. That should be easy if the server is logging error information. > I would also suggest you use Wireshark to debug the SSL handshakes that > SOAPUI and TIdHTTP are both sending. You are getting a valid HTTP response, > so clearly a secure session is being estalbished, but maybe the webservice > is configured to validate client certificates. You have to talk to the site > admin about that. > > -- > Remy Lebeau (TeamB) Edited by: Luiz Oliveira on Feb 11, 2015 3:28 PM Edited by: Luiz Oliveira on Feb 11, 2015 3:28 PM
![]() |
0 |
![]() |