Thursday, September 2, 2010

Free WCF / ASMX Test Trace tool. SoapUI and TCPTrace

I’ve always write a lot C# code to do some simple WCF testing. Until I find SoapUI, one Powerful wsdl stack test tool. It has the free Version which covers pretty all the test features I need. Let me show you a quick Tutorial.

SOAPUI is based ON http protocol mostly. so you might need to add one basicHttpBinding to you configuration. then we can enable the test on the http transport channel.

  Given a very basic Service.

image

when run the host application, you should be able to access the WSDL.

image

 

Now Just download the free version of soapUI from http://sourceforge.net/projects/soapui/files/ , there are different versions. I just select the 3.5.1 version.

SoapUI is based on Standard JAVA and javafx, so make sure you have the jdk ready . if javafx is not there, the installer will access internet and download the bits for you.

Run the soapui Utility.

image

Right click the project, Add one New project , you may specify a meaningful name.  you don't have to specify the initial wsdl , we will add it later on.


image

Right Click the new created Project , and chose Add WSDL

 image

Enter or Browse the WSDL url, I will put http://localhost:22276/Service1.svc?wsdl here. Click OK. Then you will see the Operation get listed in the project panel.

image

Double Click the Request 1 under GetData.  the SOAP request template has been generated for you, replace the ? with you value. and Click green Arrow button to submit the request.

image

for complexes object,  it’s there too. 
 image

 

Is it sweet? I think so.

Click the raw Tab. you can see the raw data there. there are some buttons that enable you to change the URL, Add customized Header. etc. (if you use the professional version. you will get more features like json view of the data.)

image

Further more, you can add it as a test case. Click the + button in the toolbar

image

 

then you can click the run the test .

image


also you can add more success criteria by click the add assertion button.

image

So here is all about SOAP. if you want to see the raw Http traffic, you can use the TCpTrace, also it’s free.

basically, change you service client to point a New port that TCPtrace is listening on, and TCPtrace will forward the request to the Service Port.

image

image

Please note. for those wsHttpBinding. you may have to Add one service behavior that allow server to process the request that has a different port(endpoint action), AddressFilterMode

image 
 

Also for the WCF client, you may just put one ClientViaBehavior to the endpoint, the client runtime will do the forwarding for you.

  


  more related articles.

Free WCF / ASMX Test Trace tool. SOAPbox by vordel

1 comment:

Anonymous said...

I would like to exchange links with your site androidyou.blogspot.com
Is this possible?

 
Locations of visitors to this page