Testing web applications and web services

AID: 308
  • Status: Published

3590 points

  • Byshalomc
  • TypeGeneral
  • Posted on2008-11-25 at 03:29:14
Quite often, your web application, web site, AJAX code or web service does not work in the way you expect it to.
In these cases, it may be necessary to "look under the hood" of the http protocol and to look at either client requests, server replies or both.
You also need the ability to resend some requests over and over again, especially when dealing with AJAX and web services.

The explanations assume some knowledge of XML, HTML, and HTTP, as well as scripting skills.

1

Web Services


Debugging web services can be a major pain in the backside. Lucky for us, there is a set of tools and techniques that can help us simulate and trace web services and AJAX requests.
These tools are described as test tools, but I've successfully used them in production environments as a way to invoke web services and web server side actions from custom scripts.

Conventions used in all of the tool usage descriptions:
* <action> = the web service action to initiate
* <xmlfile> = a [[XML]] file with the entire SOAP envelope and payload
* <outputfile> = where you want to save the results
* <SOAPUrl> = the web service address URL

====Testing using curl====
curl is a command line tool that supports all URL protocols. It is availble for multiple platforms and can be found here: http://curl.haxx.se/ .
It can be easily used for regular web sites, and works well with SOAP and WS.

 

curl --request POST --header "SOAPAction: <action>" --header "Content-type: text/xml" --data @<xmlfile> -o <outputfile> <SOAPUrl>

                                    
1:

Select allOpen in new window



====Testing using SOAPClient4XG (SOAP client For XML Geeks)====
See IBM DeveloperWorks web site at http://www-128.ibm.com/developerworks/xml/library/x-soapcl/
A light Java SOAP client.

 
java -cp . SOAPClient4XG <SOAPUrl> <xmlfile> <action>  > <outputfile>
                                    
1:
2:

Select allOpen in new window




 
2

Reverse proxies



====Using the Apache SOAP TCP Tunnel====
This used to be a part of the original Apache SOAP project distribution. It is no longer available from the Apache web site, but if you still use the SOAP distribution you may find it useful.
The tool opens a panel that traces the HTTP transport details.

Usage:
 

 
 java -cp lib/soap.jar org.apache.soap.util.net.TcpTunnelGui <localPort> <remoteHost> <remotePort>
 

                                    
1:
2:
3:

Select allOpen in new window




====Using the Axis TCPMonitor====
Available as part of the Axis distribution, this utility replaces the Apache SOAP TCP tunnel.
The tool opens a panel that traces the HTTP transport details.  
You can modify the request and resend, so it is excellent also for web applications debugging and auditing.

Multiple connections can be defined on different ports, and the utility can be used both as a regular proxy and as a reverse proxy.

http://ws.apache.org/axis/java/user-guide.html#AppendixUsingTheAxisTCPMonitorTcpmon Axis documentation

Get the Axis distribution here http://www.apache.org/dyn/closer.cgi/ws/axis/


====Using stunnel to trace https sessions====
Some tools like the TCPMonitor support only standard http sessions, and can't be used with https over ssl. A utility like stunnel can be used to enable https support.

http://www.stunnel.org/

Example: We have a web server called intranet.us.mycorp.corp that requires a https connection. In stunnel, define the configuration file like this
<embed=snippet 197418>
Start stunnel, Start TCPMonitor and set it to listen to port 80 and forward to localhost on port 88.


 
3

1337 h4x0rs


These are tools usually used in penetration testing, and are often very helpful when debugging web applications and web services.

=====Burp=====
A Java proxy for PT
http://www.portswigger.net/proxy/

=====Paros=====
A Java proxy for PT
http://www.parosproxy.org

=====Achilles=====
An old-timer proxy but still useful.
http://www.mavensecurity.com/achilles


 
4

Client side tracing


=====Tamper Data firefox add-on=====
https://addons.mozilla.org/en-US/firefox/addon/966

=====Fiddler=====
http://www.fiddlertool.com/fiddler/

=====IBM page detailer=====
http://www.alphaworks.ibm.com/tech/pagedetailer

 client = yes
 
 [https]
 accept  = 88
 connect = intranet.us.mycorp.corp:443
                                    
1:
2:
3:
4:
5:

Select allOpen in new window

Asked On
2008-11-25 at 03:29:14ID308
Tags

wsdl

,

proxy

,

http

,

web service

,

soap

Topic

WebApplications

Views
2931

Comments

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top Web Applications Experts

  1. jason1178

    4,800

    0 points yesterday

    Profile
    Rank: Genius
  2. sudaraka

    2,800

    0 points yesterday

    Profile
    Rank: Sage
  3. feridun

    2,800

    0 points yesterday

    Profile
    Rank: Genius
  4. MlandaT

    2,800

    0 points yesterday

    Profile
    Rank: Genius
  5. CRAK

    2,100

    0 points yesterday

    Profile
    Rank: Wizard
  6. maclema

    2,000

    0 points yesterday

    Profile
    Rank: Master
  7. bikramraut

    2,000

    0 points yesterday

    Profile
  8. chrisP4D

    2,000

    0 points yesterday

    Profile
  9. acbxyz

    2,000

    0 points yesterday

    Profile
    Rank: Master
  10. Merete

    1,800

    0 points yesterday

    Profile
    Rank: Genius
  11. allen-davis

    1,500

    0 points yesterday

    Profile
    Rank: Master
  12. ve3ofa

    1,400

    0 points yesterday

    Profile
    Rank: Genius
  13. Ray_Paseur

    1,400

    0 points yesterday

    Profile
    Rank: Savant
  14. SSupreme

    1,350

    0 points yesterday

    Profile
    Rank: Wizard
  15. quizengine

    1,000

    0 points yesterday

    Profile
    Rank: Sage
  16. robertark

    1,000

    0 points yesterday

    Profile
    Rank: Master
  17. bathla_kamal

    1,000

    0 points yesterday

    Profile
  18. Bardobrave

    1,000

    0 points yesterday

    Profile
    Rank: Sage
  19. d4durvesh

    1,000

    0 points yesterday

    Profile
    Rank: Master
  20. ganeshtvm

    860

    10 points yesterday

    Profile
  21. perezjos

    750

    0 points yesterday

    Profile
  22. vigilparikh

    750

    0 points yesterday

    Profile
    Rank: Master
  23. srivenky

    740

    20 points yesterday

    Profile
  24. shalomc

    670

    0 points yesterday

    Profile
    Rank: Genius
  25. bglodde

    500

    0 points yesterday

    Profile
    Rank: Wizard

Hall Of Fame