Agreed.

I wouldn't want to sift through the escaped post string with my eyes.
It wouldn't be difficult to write something that unescapes the control
characters though.

I've got log4J running in our web application and I log all the stuff I
need on that end.  

The protocolLogging feature is still useful for debugging issues when
the request is not making to the webserver at all or, as in Kevin's
case, when you're posting to an external server and don't have access to
logs on that end.


If you're on a Unix system the open source packet sniffer tcpflow does a
real nice job of formatting the HTML and headers in a human readable
format by default.  It's much simpler than working with tcpdump if you
only want to see the HTML body and headers.
http://www.owlriver.com/tips/tcpflow-tutorial/

-Ben







On Thu, 2010-04-22 at 11:24 -0400, Graham, Dave wrote:
> I've tried that.  However even at level 10 logging I don't get a concise
> view of what the receiving web server 'sees' in a format that I can go
> to my vendor and say "look at this, isn't that what your documentation
> says?"
> 
> I've used protocolLogging forever in diagnosing socket issues and it was
> my first try - however not being a real HTTP guru, having a recalcitrant
> vendor and using SSL is more than a tiny bit to chew off at one time.
> 
> Our web guys have put together a site I can go to with my data and it
> emails me a dump of all of the variables available to IIS, in an IIS
> (sort of) format so here's hoping that will give me some ammunition to
> deal with the vendor.
> 
> Sure would be nice to have a tool within the UniData environment that
> would return what is about to be sent out of the HTTP(s) port though -
> that 'raw' text would go a long way to settling disputes like this one.
> 
> -F
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Ben Souther
> Sent: Thursday, April 22, 2010 11:15 AM
> To: U2 Users List
> Subject: Re: [U2] Viewing HTTP headers when using UniData
> submitRequest()
> 
> Look at the docs for protocolLogging
> 
> 
> 
> 0155 **********************************************
> 
> 0156 IF DO.LOGGING THEN
> 
> 0157   res=protocolLogging(LOGFILE,"ON",10)
> 
> 0158 END
> 
> 0159 **********************************************
> 
> 
> It's pretty comprehensive.
> Here is the output from one of my calls:
> 
> 
> 04/22/2010 11:11:44 [  760  192 ] createRequest ... 114b68 for Var
> 106df0:
> URL=http://192.168.0.59:8080/hrp53/MailService/SendEmail,method=POST:app
> lication/x-www-form-urlencoded
> 04/22/2010 11:11:44 [  760  192 ] setRequestHeader: standard header
> Content-Type=application/x-www-form-urlencoded
> 04/22/2010 11:11:44 [  760  192 ] new header Content-Type added with
> value application/x-www-form-urlencoded
> 04/22/2010 11:11:44 [  760  192 ] current Request date: Thu, 22 Apr 2010
> 15:11:44 GMT
> 04/22/2010 11:11:44 [  760  192 ] Var entry 106df0 inserted in varlist
> 89ef0
> 
> 04/22/2010 11:11:44 [  760  192 ] setRequestHeader ...
> host=192.168.0.59:8080,header=User-Agent:HRP SendEmail
> 04/22/2010 11:11:44 [  760  192 ] setRequestHeader: standard header
> User-Agent=HRP SendEmail
> 04/22/2010 11:11:44 [  760  192 ] new header User-Agent added with value
> HRP SendEmail
> 
> 04/22/2010 11:11:44 [  760  192 ] setRequestHeader ...
> host=192.168.0.59:8080,header=Content-Type:application/x-www-form-urlenc
> oded
> 04/22/2010 11:11:44 [  760  192 ] setRequestHeader: standard header
> Content-Type=application/x-www-form-urlencoded
> 04/22/2010 11:11:44 [  760  192 ] header Content-Type valued changed
> from  to application/x-www-form-urlencoded
> 
> 04/22/2010 11:11:44 [  760  192 ] submitRequest ... Var 106df0:
> host=192.168.0.59:8080,timeout=12000
> 04/22/2010 11:11:44 [  760  192 ] new header User-Agent added with value
> UniData 7.2.x
> 04/22/2010 11:11:44 [  760  192 ] Assembled Request:
> POST /hrp53/MailService/SendEmail HTTP/1.0
> Date: Thu, 22 Apr 2010 15:11:44 GMT
> User-Agent: HRP SendEmail
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 615
> 
> recipients=bsouther%40fwdco%2Ecom%2Cben%40souther%2Eus&from=admin%
> 40fwdco%2Ecom&subject=Test+Email+from%3A+bsouther&body=This+is++a+test
> +from%3A+bsouther%0AThis+is+a+%0Abroken+line%2E%0AFrom+reed&host=smtp%
> 2Espamarrest%2Ecom&port=25&smtp_user=bsouther%2Efwdco%2Ecom&html_body=%
> 3Chtml%3E+%3Chead%3E+++%3Ctitle%3Etest+message%3C%2Ftitle%3E+%3C%2Fhead%
> 3E+%3Cbody%3E++%3Cp%3EThis+is+the+HTML+version+of+the+message%3C%2Fp%3E
> ++%3Cbr+%2F%3E+Isn%27t+this+%3Cb%3Enifty%3C%2Fb%3E%3F%3Cbr+%2F%3E++%
> 3Cimg+src%3D%27http%3A%2F%2Fwww%2Efwdco%2Ecom%2Ftemplates%2F1%2Fimages%
> 2Ftop%5Flogo%2Egif%27++%2F%3E+%3C%2Fbody%3E%3C%2Fhtml%3E
> 04/22/2010 11:11:44 [  760  192 ] HTTP_START: timeout=12000
> 04/22/2010 11:11:44 [  760  192 ] HTTP_CONNECT
> 04/22/2010 11:11:44 [  760  192 ] new host b1508:192.168.0.59:8080
> allocated (proxy:no)
> 04/22/2010 11:11:44 [  760  192 ] host 192.168.0.59:8080 not found in
> hostList
> 04/22/2010 11:11:49 [  760  192 ] socket 10c658 allocated
> 04/22/2010 11:11:49 [  760  192 ] Non-secure Socket
> 10c658(192.168.0.59:8080) opened
> 04/22/2010 11:11:49 [  760  192 ] HTTP_SEND
> 04/22/2010 11:11:49 [  760  192 ] Socket 10c658: 795 chars sent
> 04/22/2010 11:11:49 [  760  192 ] HTTP_GETSTAT
> 04/22/2010 11:11:49 [  760  192 ] Socket 10c658: 219 chars read
> 04/22/2010 11:11:49 [  760  192 ] HTTP_CHKSTAT
> 04/22/2010 11:11:49 [  760  192 ] Response: Status line: HTTP/1.1 200 OK
> 04/22/2010 11:11:49 [  760  192 ] SubmitRequest: server HTTP version 1.1
> 04/22/2010 11:11:49 [  760  192 ] SubmitRequest: response status 200: OK
> 04/22/2010 11:11:49 [  760  192 ] Response message headers: 
> Server: Apache-Coyote/1.1
> Set-Cookie: JSESSIONID=D70D81C7ED0445A9750B04AFDB06DE87; Path=/hrp53
> Content-Length: 27
> Date: Thu, 22 Apr 2010 15:10:52 GMT
> Connection: close
> 04/22/2010 11:11:49 [  760  192 ] Response message body(may be partial)
> length: 27
> 04/22/2010 11:11:49 [  760  192 ] Response message body: 
> error_code=0&error_message=
> 04/22/2010 11:11:49 [  760  192 ] next field = Server:
> 04/22/2010 11:11:49 [  760  192 ] next field = Apache-Coyote/1.1
> 04/22/2010 11:11:49 [  760  192 ] next field = Set-Cookie:
> 04/22/2010 11:11:49 [  760  192 ] next field =
> JSESSIONID=D70D81C7ED0445A9750B04AFDB06DE87;
> 04/22/2010 11:11:49 [  760  192 ] next field = Path=/hrp53
> 04/22/2010 11:11:49 [  760  192 ] next field = Content-Length:
> 04/22/2010 11:11:49 [  760  192 ] next field = 27
> 04/22/2010 11:11:49 [  760  192 ] next field = Date:
> 04/22/2010 11:11:49 [  760  192 ] next field = Thu,
> 04/22/2010 11:11:49 [  760  192 ] next field = 22
> 04/22/2010 11:11:49 [  760  192 ] next field = Apr
> 04/22/2010 11:11:49 [  760  192 ] next field = 2010
> 04/22/2010 11:11:49 [  760  192 ] next field = 15:10:52
> 04/22/2010 11:11:49 [  760  192 ] next field = GMT
> 04/22/2010 11:11:49 [  760  192 ] next field = Connection:
> 04/22/2010 11:11:49 [  760  192 ] next field = close
> 04/22/2010 11:11:49 [  760  192 ] HTTP_MOREDATA: expecting 0 bytes of
> data
> 04/22/2010 11:11:49 [  760  192 ] HTTP_MOREDATA: data completely read
> 04/22/2010 11:11:49 [  760  192 ] HTTP_FINISH
> 04/22/2010 11:11:49 [  760  192 ] Socket 10c658 closed: 0(No error) 0(No
> error)
> 04/22/2010 11:11:49 [  760  192 ] socket 10c658 freed
> 04/22/2010 11:11:49 [  760  192 ] Host b1508 freed
> 
> 04/22/2010 11:11:49 [  760  192 ] protocolLogging ... name=C:\TEMP
> \SENDMAIL.LOG,action=OFF,level=10
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> On Thu, 2010-04-22 at 10:26 -0400, Graham, Dave wrote:
> > Can anyone tell me how I can look at the 'raw' data that comprises an
> > HTTP header the would normally be sent via the UniData submitRequest()
> > command?
> > 
> >  
> > 
> > I believe that I'm sending the request to our partner correctly but
> they
> > claim its not right (of course they can't tell me what's not right
> about
> > it).
> > 
> >  
> > 
> > I'm hoping that looking at the header as they would receive it will
> give
> > me something to work with.
> > 
> >  
> > 
> > Fred
> > 
> >  
> > 
> > 
> > 
> > _______________________________________________
> > U2-Users mailing list
> > [email protected]
> > http://listserver.u2ug.org/mailman/listinfo/u2-users
> > 
-- 
Ben Souther
Manager, Web and Web Service Development
[email protected] | 508.927.8147
FWDavison & Company, Inc.
10 Cordage Park Circle, Suite 200
Plymouth, MA 02360-7318

CONFIDENTIALITY NOTICE:  This e-mail message, and any accompanying
documents, is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized
review, use, disclosure, distribution or copying is prohibited. If you
are not the intended recipient, please contact our office by e-mail or
by telephone at (508) 747-7261 and immediately destroy all copies of the
original message.

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to