BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get the raw soap message?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WebServices SOAP
View previous topic :: View next topic  
Author Message
Will Honor
Guest





PostPosted: Fri Mar 09, 2007 1:36 am    Post subject: How to get the raw soap message? Reply with quote



Hello,
I am trying to get at the raw response soap packet for a win32
application using HTTPRIO. Usually I use the OnAfterExecute event but
in this case I think the server has got into trouble and returned some
html. That leads to the following error and the OnAfterExecute does not
fire

Received Content of Invalid Content-Type setting: text/html - SOAP
expects "text/xml"


How do I trap the raw data returned to me?

Thanks,
Will.
--
Back to top
Jean-Marie Babet
Guest





PostPosted: Fri Mar 09, 2007 1:40 am    Post subject: Re: How to get the raw soap message? Reply with quote



"Will Honor" <will24@(No Spam at all)Orange.net> wrote in message
news:45f065a1$1 (AT) newsgroups (DOT) borland.com...
Quote:

Hello,
I am trying to get at the raw response soap packet for a win32
application using HTTPRIO. Usually I use the OnAfterExecute event but
in this case I think the server has got into trouble and returned some
html. That leads to the following error and the OnAfterExecute does not
fire

Received Content of Invalid Content-Type setting: text/html - SOAP
expects "text/xml"


How do I trap the raw data returned to me?

Thanks,
Will.
--
Back to top
Jean-Marie Babet
Guest





PostPosted: Fri Mar 09, 2007 1:51 am    Post subject: Re: How to get the raw soap message? Reply with quote



Hello Will,

The message you are seeing is at the transport level - THTTPReqResp object -
used by the RIO. So the data has not made it back to the RIO yet. There's an
event - OnReceivingData - on the THTTPReqResp object but it does not give
access to the data... rather it gives access to the each successful read
stat (it's used to display progress).

The simplest approach would be to add a copy of SOAPHTTPTrans.pas to your
project and set a breakpoint at the end of THTTPReqRes.Receive. The very
last thing we do is call CheckContentType - the very method that's
generating the message you're seeing. Just before this call, the 'Resp'
TStream contains the data sent back to by WebService.

I've never thought of *seeing* the data before it's confirmed to be XML but
I can see how it would be useful in your case. However, typically this
indicates a setup failure because even in the case where the service could
not understand whatever we sent, it's required to send back XML - a SOAP
fault. I've only seen services sent back HTML (or some other non-XML
content-type) when I accidentally misconfigured the URL to the service.

Anyway... let me know if the above does not help and we'll work out some
other approach.

Cheers,

Bruneau.
Back to top
Will Honor
Guest





PostPosted: Fri Mar 09, 2007 5:05 am    Post subject: Re: How to get the raw soap message? Reply with quote

Quote:
Anyway... let me know if the above does not help and we'll work out
some other approach.


Thanks,
Your suggestion will be fine. I am having huge problems with the
company that has written the web service. I just need to trap the html
that is coming back in order to draw their attention to it.

Regards,
Will.

--
Back to top
Luis A.
Guest





PostPosted: Fri Mar 09, 2007 10:19 pm    Post subject: Re: How to get the raw soap message? Reply with quote

Quote:


How do I trap the raw data returned to me?

Thanks,
Will.
--


Hello Will:

Something that i tried was this:
http://qc.codegear.com/wc/qcmain.aspx?d=21935
and it worked, i received the unseen message.

Luis A.
Back to top
Schalk Versteeg
Guest





PostPosted: Tue Mar 27, 2007 7:27 pm    Post subject: Re: How to get the raw soap message? Reply with quote

Hi Will,
Something I did while I used SOAP a lot was to load the SOAPrequest into a
memo in the before execute and use this data with a plain http post using a
indy client to the service. Catching the http response in a memo.
I used this method extensively to debug a PHP webservices, that I was
developing.

procedure TForm5.HTTPRIO1BeforeExecute(const MethodName: string;
var SOAPRequest: WideString);
begin
Memo2.Lines.Append(SOAPRequest );
end;


Dave

"Will Honor" <will24@(No Spam at all)Orange.net> wrote in message
news:45f065a1$1 (AT) newsgroups (DOT) borland.com...
Quote:

Hello,
I am trying to get at the raw response soap packet for a win32
application using HTTPRIO. Usually I use the OnAfterExecute event but
in this case I think the server has got into trouble and returned some
html. That leads to the following error and the OnAfterExecute does not
fire

Received Content of Invalid Content-Type setting: text/html - SOAP
expects "text/xml"


How do I trap the raw data returned to me?

Thanks,
Will.
--
Back to top
Schalk Versteeg
Guest





PostPosted: Tue Mar 27, 2007 7:29 pm    Post subject: Re: How to get the raw soap message? Reply with quote

Bruneau,
Seeing the SOAP packets is very handy to debug webservices built with PHP,
especially where they don't return the expected result yet.

Dave

"Jean-Marie Babet" <bbabet (AT) borland (DOT) com> wrote in message
news:45f06936$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hello Will,

The message you are seeing is at the transport level - THTTPReqResp
object -
used by the RIO. So the data has not made it back to the RIO yet. There's
an
event - OnReceivingData - on the THTTPReqResp object but it does not give
access to the data... rather it gives access to the each successful read
stat (it's used to display progress).

The simplest approach would be to add a copy of SOAPHTTPTrans.pas to your
project and set a breakpoint at the end of THTTPReqRes.Receive. The very
last thing we do is call CheckContentType - the very method that's
generating the message you're seeing. Just before this call, the 'Resp'
TStream contains the data sent back to by WebService.

I've never thought of *seeing* the data before it's confirmed to be XML
but
I can see how it would be useful in your case. However, typically this
indicates a setup failure because even in the case where the service could
not understand whatever we sent, it's required to send back XML - a SOAP
fault. I've only seen services sent back HTML (or some other non-XML
content-type) when I accidentally misconfigured the URL to the service.

Anyway... let me know if the above does not help and we'll work out some
other approach.

Cheers,

Bruneau.

Back to top
Jean-Marie Babet
Guest





PostPosted: Tue Mar 27, 2007 9:47 pm    Post subject: Re: How to get the raw soap message? Reply with quote

Hello,

Quote:
memo in the before execute and use this data with a plain http post using
a
indy client to the service. Catching the http response in a memo.
I used this method extensively to debug a PHP webservices, that I was
developing.



I did that a lot too when I was doing interop testing. I had a little App
that has two memos (etc) to display the request/response. One day the QA
person saw this and he tweaked it (i.e. made it look nice:) and added it to
the shipping sample. It's called PostSOAP and it probably still included
although I have not checked recently (this goes back to 2002).

Unfortunately, because PostSOAP uses a THTTPReqResp, it enforces
content-type of 'text/xml' too :(

Cheers,

Bruneau.
Back to top
Jean-Marie Babet
Guest





PostPosted: Tue Mar 27, 2007 9:52 pm    Post subject: Re: How to get the raw soap message? Reply with quote

Hello,

Quote:
Seeing the SOAP packets is very handy to debug webservices built with PHP,
especially where they don't return the expected result yet.

Yes, agreed! And I am considering changing that logic as per the request [so
the event fires first]... I just need to make time for when I can write some
tests as none of our regular unit-test cover that particular aspect [i.e.
handling of non 'text/xml' data coming back].

Cheers,

Bruneau.

PS: Also, I regularly use proxyTrace -
http://www.pocketsoap.com/tcptrace/pt.aspx. It's particularly useful when
I'm using other SOAP libraries (say Axis/.NET/etc) and can't figure out the
equivalent of 'OnBefore/AfterExecute'.
Back to top
Schalk Versteeg
Guest





PostPosted: Thu Mar 29, 2007 1:17 pm    Post subject: Re: How to get the raw soap message? Reply with quote

Never
"Jean-Marie Babet" <bbabet (AT) borland (DOT) com> wrote in message
news:46094a94$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hello,

memo in the before execute and use this data with a plain http post using
a
indy client to the service. Catching the http response in a memo.
I used this method extensively to debug a PHP webservices, that I was
developing.



I did that a lot too when I was doing interop testing. I had a little App
that has two memos (etc) to display the request/response. One day the QA
person saw this and he tweaked it (i.e. made it look nice:) and added it
to
the shipping sample. It's called PostSOAP and it probably still included
although I have not checked recently (this goes back to 2002).

Unfortunately, because PostSOAP uses a THTTPReqResp, it enforces
content-type of 'text/xml' too Sad

Never even saw it there, could've saved me days trying to figure out how to
debug the service in the first place.
Pretty nice as a basis for a testing app, just add your own complex types,
etc

Cheers
Dave
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WebServices SOAP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.