When debugging a web services application, it is extremely important to be able to view the SOAP requests and responses being sent across the wire. And, while there do exist some really cool commercial products out there to satisfy this need, like
SOAPscope, there also exist some freebies that are more than capable of getting the job done. I personally have been developing NetSuite specific web services applications for close to three years, and up until Celigo's recent conversion to Mindreef's SOAPscope server, tcpmon and stunnel played a vital role in keeping my applications alive and healthy.
Tcpmon is a great way to view http traffic if you know the ports your traffic is being routed through. Launching the application couldn't be easier. Simply specify a 'Listen Port #', 'Target Port #', 'Target Hostname', and click on Add. Point the url of your web services client to the localhost port you have just setup and watch the SOAP fly on by.
Stunnel provides the ability to encrypt and decrypt data being sent to a server. Working with NetSuite, it is a required component, unless you have the magical ability to decifer data sent across the https connection NetSuite requries. Launching the application entails configuring the config file titled stunnel.conf and double clicking an executable startup script.
So I guess the best way to explain these two tools is to explain how I typically use them in conjunction to view the SOAP I send to NetSuite. First I set the url of my web services client to point to 'http://localhost:5050/services/NetSuitePort_2_5' . Then I launch tcpmon and set my listening port to be 5050, my target hostname to be localhost, and my target port to be 1515. I then load up my stunnel.conf file and make sure the following config is in place:
client=yes
verify=0
[psuedo-https]
accept = 1515
connect = webservices.netsuite.com:443
TIMEOUTclose = 0
I then start stunnel by clicking on the executable in my stunnel directory. My connection is now setup. My web services client sends SOAP to tcpmon and it shows me the SOAP. Tcpmon then forwards the SOAP to stunnel which in turn excrypts the SOAP and sends it to NetSuite's https endpoint. When NetSuite sends a response back, stunnel decrypts the response and forwards the decrypted SOAP to tcpmon, which of course allows me to view what has been returned.
I hope this information is helpful. These tools have been a huge help to me.
--Scott
Hi Scott,
Can you please temme how exactly to bypass STunnel and only use TCPMon to pass my SOAPs?
---Thanks
Janet
Thank you so much for your informative post; it was helpful to see how you orchestrate this process, but even more helpful to know that other people have accomplished such elegant integration. Thanks again.
Hi Scott,
I also found this very helpful. I did have to fiddle with stunnel.conf for a while though. I am using the Windows pre-compiled version.
To get it working, my stunnel.conf file needed to contain ONLY what you posted. Some other options were enabled by default in the pre-generated version of the config file. I needed to comment out these defaults before it worked properly.
Example:
;this line is a comment
;these two lines would be ignored
Thanks!
-Clinton