Showing posts with label soapui. Show all posts
Showing posts with label soapui. Show all posts

Tuesday, March 12, 2013

OSB. chunked transfer encoding

Sendin a request to SOAPUI in automated (testrunner) way, we can see:

Accept-Encoding : gzip,deflate 

the response comes back with

Response Headers: Transfer-Encoding : chunked

For explanations, see http://en.wikipedia.org/wiki/HTTP_compression#Client.2FServer_compression_scheme_negotiation

and http://en.wikipedia.org/wiki/Chunked_transfer_encoding 

"HTTP servers sometimes use compression (gzip) or deflate methods to optimize transmission. How both chunked and gzip encoding interact is dictated by the two-staged encoding of HTTP: first the content stream is encoded as (Content-Encoding: gzip), after which the resulting byte stream is encoded for transfer using another encoder (Transfer-Encoding: chunked). This means that in case both compression and chunked encoding are enabled, the chunk encoding itself is not compressed, and the data in each chunk should not be compressed individually. The remote endpoint can decode the incoming stream by first decoding it with the Transfer-Encoding, followed by the specified Content-Encoding."

How can this "chunked" happen?

Is there any HTTP Business Service along the path?
If yes, we should check if it has got Chunked Streaming Mode disabled:

http://docs.oracle.com/cd/E17904_01/doc.1111/e15866/transports.htm

"Use Chunked Streaming Mode Select this option if you want to use HTTP chunked transfer encoding to send messages.

Note: Do not use chunked streaming with if you use the Follow HTTP Redirects option. Redirection and authentication cannot be handled automatically in chunked mode."

Also check that Chunking Threshold is disabled in SOAPUI :
http://www.soapui.org/Working-with-soapUI/preferences.html

More on the topic:

http://blog.ipnweb.com/2012/09/use-chunked-streaming-mode-in-osb-11g.html

Understanding Chunked Streaming 

Oracle documentation states that the Chunked Streaming Mode property should be selected "if you want to use HTTP chunked transfer encoding to send messages." You normally want to enable chunked streaming if possible (with my problem above, it is not possible).

Chunked transfer encoding is an HTTP 1.1 specification, and allows clients to parse dynamic data immediately after the first chunk is read. Note that the Oracle documentation also states not to enable chunked streaming if you use the Follow HTTP Redirects option, as redirection and authentication cannot be handled automatically in chunked mode.





Friday, February 8, 2013

SOAPUI MockServices and Groovy Response

Suppose you have a request like this:


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <IdentifyCustomer>
         <WebIdentification>
            <Email>vernetto@yahoo.com</Email>
            <Password>ciao</Password>
         </WebIdentification>
      </IdentifyCustomer>
   </soapenv:Body>
</soapenv:Envelope>



and you must return this response whenever the email contains "@yahoo.com":

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <IdentifyCustomerResponse>
         <!--You have a CHOICE of the next 2 items at this level-->
         <IdentificationSuccessful>
            <MarketID>2</MarketID>
            <CustomerID>123456</CustomerID>
         </IdentificationSuccessful>
      </IdentifyCustomerResponse>
   </soapenv:Body>
</soapenv:Envelope>   


and this response whenever the email contains "@gmail.com":

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <IdentifyCustomerResponse>
         <IdentificationFailed>
            <ErrorCode>CUSTOMER_NOT_FOUND</ErrorCode>
            <ErrorDescription>we cannot find this customer</ErrorDescription>
         </IdentificationFailed>
      </IdentifyCustomerResponse>
   </soapenv:Body>
</soapenv:Envelope>


You can create a MockService and customize the MockResponse http://www.soapui.org/Getting-Started/mock-services/4-Customizing-a-MockResponse.html

this is the script:


def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( mockRequest.requestContent ) 
def email = holder.getNodeValue("//Email")

if (email.contains("@yahoo.com")) {
 context.setProperty( "myresponse", "<IdentificationSuccessful><MarketID>2</MarketID><CustomerID>123456</CustomerID></IdentificationSuccessful>" )
}
else {
 context.setProperty( "myresponse", "<IdentificationFailed><ErrorCode>CUSTOMER_NOT_FOUND</ErrorCode><ErrorDescription>we cannot find this customer</ErrorDescription></IdentificationFailed>" )
}



and this the Groovy Response


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <IdentifyCustomerResponse>
  ${myresponse}
      </IdentifyCustomerResponse>
   </soapenv:Body>
</soapenv:Envelope>


Thursday, August 9, 2012

SOAPUI: groovy script to choose a different line in a file for each test iteration

We have a Property test step containing 2 properties:
Hostname and linecount
We initialize linecount to 0

At each iteration, this Groovy test step will assign to Hostname the next value from a file C:/pierre/workspace/SSS_AutomatedTests/SOAPUIArtifacts/hostnames.txt
Arrived at the end of the file, it will restart from the first line.

linecount= testRunner.testCase.testSteps["Properties"].getPropertyValue( "linecount" )
linecountInt = linecount.toInteger() + 1
//increment property linecount by one
testRunner.testCase.testSteps["Properties"].setPropertyValue( "linecount", String.valueOf(linecountInt) )

def myhostnamesFile = new File("C:/pierre/workspace/SSS_AutomatedTests/SOAPUIArtifacts/hostnames.txt")

//find number of lines in hostnames file
hostnamesinthefile = 0;
myhostnamesFile.eachLine { hostnamesinthefile++ }
log.info( "hostnames in the file: " + hostnamesinthefile)

//divide modulo
theLineNumber = (linecountInt % hostnamesinthefile) + 1
log.info("theLineNumber to choose=" + theLineNumber)
theHostnameToChoose = ""
//scan all lines, line contains the text and lineNo the line number starting from 1
myhostnamesFile.eachLine() { line, lineNo ->
 if ( lineNo == theLineNumber) 
  theHostnameToChoose = line
}

log.info( "theHostnameToChoose=" + theHostnameToChoose)

testRunner.testCase.testSteps["Properties"].setPropertyValue( "Hostname", theHostnameToChoose )



Wednesday, August 8, 2012

SOAPUI Properties and Groovy Steps

Losing my mind for how a simple thing was turned into a complicated riddle.

See http://www.soapui.org/Functional-Testing/working-with-properties.html

If you do this:

testRunner.testCase.testSuite.setPropertyValue("Hostname", "02B3TEST0004")
log.info( testRunner.testCase.testSuite.getPropertyValue("Hostname"))

you will set a TestSuite level property:



After a lot of trial and error, I found out that if you want to get/set properties defined in a Properties Test Step, you must do this:

testRunner.testCase.testSteps["Properties"].setPropertyValue( "Hostname", "fanculo" )

log.info( testRunner.testCase.testSteps["Properties"].getPropertyValue( "Hostname" ))






very properly undocumented, thank you SmartBear... if this Bear is smart, I wonder the dummy ones...

So now we are ready to implement the DataSources in Groovy by reading a file and setting a property in a GroovyStep

Thursday, August 2, 2012

soapui: browser component is disabled

http://www.eviware.com/forum/viewtopic.php?f=2&t=7797&hilit=disabled+browser


apparently if you want to use the SOAPUI embedded browser you must use the 32 bit JDK.

Just install a Java 7 32 bit, then put this in your soapui.bat:


@echo off

set SOAPUI_HOME=C:\pierre\SmartBear\soapUI-4.5.0\bin\

set JAVA=c:\pierre\jre32\bin\java

rem init classpath

set CLASSPATH=%SOAPUI_HOME%soapui-4.5.0.jar;%SOAPUI_HOME%..\lib\*;

rem JVM parameters, modify as appropriate
set JAVA_OPTS=-Xms128m -Xmx1024m -Dsoapui.properties=soapui.properties -Dsoapui.home=%SOAPUI_HOME%

if "%SOAPUI_HOME%" == "" goto START
    set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.libraries="%SOAPUI_HOME%ext"
    set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.listeners="%SOAPUI_HOME%listeners"
    set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.ext.actions="%SOAPUI_HOME%actions"
                set JAVA_OPTS=%JAVA_OPTS% -Djava.library.path="%SOAPUI_HOME%\"
                set JAVA_OPTS=%JAVA_OPTS% -Dwsi.dir="%SOAPUI_HOME%..\wsi-test-tools"
rem uncomment to disable browser component
rem    set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.jxbrowser.disable="true"

:START

rem ********* run soapui ***********

"%JAVA%" %JAVA_OPTS% com.eviware.soapui.SoapUI %*




where c:\pierre\jre32\bin\java is the location of your 32 bit JRE

Monday, July 30, 2012

SOAPUI and Web Test automation

you can do automated testcases in SOAPUI wor Web Application, by automatically recording a web experience (using the internal SOAPUI browser) and later adding assertions.
http://www.soapui.org/Web-and-HTTP/getting-started.html

This is how to add assertions once you have recorded the web session









Monday, July 23, 2012

SOAPUI, setting dynamic properties with Groovy

I have a project POCO
and a Test Suite with a TestCase POCOTest

In the TestCase I create a Groovy Script step:


def project = context.testCase.testSuite.project
def tc = context.testCase
log.info project.name
log.info tc.name








see also:

http://www.soapui.org/Scripting-Properties/tips-a-tricks.html


Now, if I want to set a property, I have a choice of TestCase, TestSuite, Project or Global properties.

For instance, to set a new OrderID per each request:

import static java.util.UUID.randomUUID
def tc = context.testCase
uuid = randomUUID().toString()
testRunner.testCase.setPropertyValue( "OrderID", uuid )
log.info testRunner.testCase.getPropertyValue("OrderID")


After execution of this code (click the Run button in the Groovy Step editir), you have:





now you can add other steps AFTER the Groovy Step, and in the XML requests you can put

<ret:OrderUUID>${#TestCase#OrderID}</ret:OrderUUID>


All the Steps will share the same value of OrderID.



Thursday, July 12, 2012

SOAPUI and Groovy

Here the official doc, specifically the Property Expansion scripts.




your first script can be:
testRunner.runTestStepByName( "FindDescription" )


This PPT contains useful examples

Tuesday, July 10, 2012

Bamboo and SOAPUI integration

Install SOAPUI 4.5:

zip soapUI-x32-4_5_0.sh into soapUI-x32-4_5_0.zip (transferring .sh file got corrupted, need to set binary mode)

unzip soapUI-x32-4_5_0.zip on target /home/soa

chmod 755 soapUI-x32-4_5_0.sh
./soapUI-x32-4_5_0.sh

run in non-graphic mode, install to /home/soa/SmartBear/soapUI-4.5.0/

the installer will install also a Java 7 JRE into /home/soa/SmartBear/soapUI-4.5.0/jre, rename this directory to /home/soa/SmartBear/soapUI-4.5.0/jreORI so that SOAPUI will use the default java installation ( with Java 7 I had problems with this error:
[SoapUITestCaseRunner] java.lang.UnsatisfiedLinkError: /home/soa/SmartBear/soapUI-4.5.0/jre/lib/i386/xawt/libmawt.so: libXrender.so.1: cannot open shared object file: No such file or directory)

cd /home/soa/SmartBear/soapUI-4.5.0/bin

copy here your SOAPUI shop.xml test

./testrunner.sh -s"Configuration Service TestSuite" -c"Get terminal configuration" -j "shop.xml"

the -j option will generate a TEST-Configuration_Service_TestSuite.xml file in JUnit format, with the result of the test. The file name comes from 'testSuite name="Configuration Service TestSuite"'

Create a Bamboo plan

choose a "Script" task
you must choose to run a script https://confluence.atlassian.com/display/BAMBOO/Script

Script body= ./testrunner.sh -s"Configuration Service TestSuite" -c"Get terminal configuration" -j "shop.xml"

Working Sub Directory= /home/soa/SmartBear/soapUI-4.5.0/bin

then we add a JUnit Parse task:
Specify custom results directory=/home/soa/SmartBear/soapUI-4.5.0/bin/TEST-*.xml

Enable the project in dashboard
Run it

It fails saying "Could not find test result reports in the /home/soa/bamboohome/xml-data/build-dir/SOAPUITEST-SOAPUITEST-JOB1 "

in fact the /home/soa/bamboohome/xml-data/build-dir/SOAPUITEST-SOAPUITEST-JOB1/ was created, but only build-number.txt is there.

SoapUITestCaseRunner must be told WHERE to write the blessed JUnit TEST-bla.xml result.

The SoapUITestCaseRunner code says:

SoapUIOptions options = new SoapUIOptions( "testrunner" );
options.addOption( "e", true, "Sets the endpoint" );
options.addOption( "s", true, "Sets the testsuite" );
options.addOption( "c", true, "Sets the testcase" );
options.addOption( "u", true, "Sets the username" );
options.addOption( "p", true, "Sets the password" );
options.addOption( "w", true, "Sets the WSS password type, either 'Text' or 'Digest'" );
options.addOption( "i", false, "Enables Swing UI for scripts" );
options.addOption( "d", true, "Sets the domain" );
options.addOption( "h", true, "Sets the host" );
options.addOption( "r", false, "Prints a small summary report" );
options.addOption( "M", false, "Creates a Test Run Log Report in XML format" );
options.addOption( "f", true, "Sets the output folder to export results to" );
options.addOption( "j", false, "Sets the output to include JUnit XML reports" );
options.addOption( "m", false, "Sets the maximum number of TestStep errors to save for each testcase" );
options.addOption( "a", false, "Turns on exporting of all results" );
options.addOption( "A", false, "Turns on exporting of all results using folders instead of long filenames" );
options.addOption( "t", true, "Sets the soapui-settings.xml file to use" );
options.addOption( "x", true, "Sets project password for decryption if project is encrypted" );
options.addOption( "v", true, "Sets password for soapui-settings.xml file" );
options.addOption( "D", true, "Sets system property with name=value" );
options.addOption( "G", true, "Sets global property with name=value" );
options.addOption( "P", true, "Sets or overrides project property with name=value" );
options.addOption( "I", false, "Do not stop if error occurs, ignore them" );
options.addOption( "S", false, "Saves the project after running the tests" );



so I do

/home/soa/SmartBear/soapUI-4.5.0/bin/testrunner.sh -s"Configuration Service TestSuite" -c"Get terminal configuration" -j "/home/soa/SmartBear/soapUI-4.5.0/bin/shop.xml" -f/home/soa/bamboohome/xml-data/build-dir/SOAPUITEST-SOAPUITEST-JOB1/


and the result is written in /home/soa/bamboohome/xml-data/build-dir/SOAPUITEST-SOAPUITEST-JOB1/

the second step is simply
parse junit
Specify custom results directory=**/TEST*.xml


where the meaning of -s and -c parameters are:

<con:entry key="TestSuite" value="Configuration Service TestSuite"/>
<con:entry key="TestCase" value="Get terminal configuration"/>

-s = suite
-c = case


____________________________



Integrating also SVN checkout:

Put your SOAPUI project in SVN

For instance:

https://nessvn1.acme.com/svn/pippov2/PPP_AutomatedTests/SOAPUIArtifacts/shop-conf-soapui-project.xml
Create Bamboo Plan

Name SOAPUITEST
Create SVN repository

Source Repository= Subversion

Display Name = pippo2_SoapUI

Repository URL = https://nessvn1.acme.com/svn/pippov2/PPP_AutomatedTests/SOAPUIArtifacts/

Username= avernetto Password=bla
Create SOAPUI checkout task

Repository = pippo2_SoapUI
Create Script task

Task Description=Testrunner

Script Location=Inline

Script body=/home/soa/SmartBear/soapUI-4.5.0/bin/testrunner.sh -s"Configuration Service TestSuite" -j "/home/soa/bamboohome/xml-data/build-dir/SOAPUITEST-SOAPUITEST-JOB1/shop-conf-soapui-project.xml" -f/home/soa/bamboohome/xml-data/build-dir/SOAPUITEST-SOAPUITEST-JOB1/
Create JUnit Parser task

Task description=parse junit

Specify custom results directories=*/TEST.xml
Run the plan

Examine the content of /home/soa/bamboohome/xml-data/build-dir/SOAPUITEST-SOAPUITEST-JOB1/ folder for all artifacts being generated

Saturday, May 12, 2012

SOAPUI, OSB, WSDL and FrontEnd address and port

(guest post, thanks Luis Verge (vergegon pisellon!) Gonzales for this)

Yesterday while using SOAPUI for defining some projects for testing I saw that if I try to use the dynamic?WSDL address I got an error as described below:


1st. Open the Internet explorer and type the address of your WSDL:

http://10.56.5.192:8105/SSS_GetUsers/ProxyServices/GetUsers_PS?wsdl

Then you will see the wsdl and the soap address (HINT: where does that 9980 port come from???):







If you create a SOAPUI project and you use the dynamic address:



(notice: port is 8105, not 9980!)

Your process will  remain  running trying to solve the address:


(notice again the 9980!)

If you see the previous image you will notice something estrange, the port you were using 8105 is now 9980. Your first question is why?



The response is given in the weblogic configuration, in the cluster configuration and to be more precise: in the HTTP cluster configuration (see image below)


it't the FRONTEND HTTP PORT!!!


If you read the explanation in oracle documentation:



http://docs.oracle.com/cd/E12840_01/wls/docs103/webserv/setenv.html#wp220521



and in middleware magic:

http://middlewaremagic.com/weblogic/?p=1938



You will understand how it works.

Apparently, in our current configuration (with network proxies) when we try to use a dynamic address , we don’t get it because is redirecting it to the frontend port and address defined in the cluster.

Normally in that part of the weblogic configuration we should have the loadbalancer address, but unfortunately we have none in dev.

I was wondering on using as the default port in the frontend configuration in the cluster the port 8105, so every request not solved will be redirected to 8105.

That change will require a restart.

Tuesday, April 10, 2012

OSB load test on AnyXML interface with SOAPUI

Open SOAPUI
File/ New Project
Enter a project name (eg PIPPOLoadTest) and leave everything else empty

create project

right click on project
New REST Service - leave checked the "Open dialog to create a REST Resource"

Resource name - enter MyTest1, and enter endpoint URI for your Proxy Service

New Rest Method - choose HTTP Method = POST

You will get this window - in the bottom left you can paste your XML payload (it's NOT a SOAP message, so you should not have the soap:envelope nor soap:body tags)


Test the service with the payload. If it works, then we are ready to create the TestSuite.

Right click on project, "Generate Test Suite", select resources (the above created MyTest1), select "generate a default LoadTest for each created TestCase"

This creates the TestSuite. You can open the LoadTest and change parameters (Threads, delay...)


On your OSB project, select your Proxy Service, Operational Parameters, enable monitoring with 1 minute aggregation level, Action level.

Start your SOAPUI Load Test.

Go to Operations, Service Health, Action Metrics and you will have a detailed analysis of average time taken by action.

Wednesday, March 16, 2011

java.net.MalformedURLException: no protocol: Files/eviware/soapUI-3.6.1/hermesJMS/lib/hermes-imq.jar

java.net.MalformedURLException: no protocol: Files/eviware/soapUI-3.6.1/hermesJMS/lib/hermes-imq.jar


if you get this error, most likely you have installed SoapUI in "C:/Program Files/eviware"....

the problem is the space between Program and Files.
Just reinstall it in "C:/Programs",
and I personally think that the idiot that has invented a system folder name with a space in it should be castrated, hoping he has not already made children.



Ok I am a bad mood today, the Planet is sinking because some idiot wanted to save some money on security measures on a nuclear plant in Fukushima... either you do your job properly, or stay at home watching TV.

Saturday, September 4, 2010

com.eviware.soapui.tools.SoapUILoadTestRunner

If you install SoapUI3.5.1 you get a
loadtestrunner.sh

================================
=
= SOAPUI_HOME = /maerskwas/tools/soapui-3.5.1
=
================================
soapUI 3.5.1 LoadTest Runner
usage: loadtestrunner [options]
-v Sets password for soapui-settings.xml file
-t Sets the soapui-settings.xml file to use
-D Sets system property with name=value
-G Sets global property with name=value
-P Sets or overrides project property with name=value
-S Saves the project after running the tests
-c Sets the testcase
-d Sets the domain
-e Sets the endpoint
-f Sets the output folder to export to
-h Sets the host
-l Sets the loadtest
-m Overrides the LoadTest Limit
-n Overrides the LoadTest ThreadCount
-p Sets the password
-r Exports statistics and testlogs for each LoadTest run
-s Sets the testsuite
-u Sets the username
-w Sets the WSS password type, either 'Text' or 'Digest'
-x Sets project password for decryption if project is encrypted
Missing soapUI project file..


run as:

./loadtestrunner.sh -r -f/home/tstuser/pierre/ /home/tstuser/pierre/TSTStressTest-soapui-project.xml



After some time the load test finishes and you can find statistics in
LoadTest_1-log.txt
and
LoadTest_1-statistics.txt


Cool!

A more complete syntax with -s -l -c options:
C:\pierre\SmartBear\soapUI-4.5.0\bin\loadtestrunner.bat -s"TerminalSetupServicePortBinding TestSuite" -c"GetUsers TestCase" -l"LoadTest 1" C:\pierre\workspace\SSS_AutomatedTests\SOAPUIArtifacts\MachineSetupService-soapui-project.xml

Sunday, July 4, 2010

SOAPUI, JUnit and functional tests

Lovely tutorials by Meera Subbarao on SOAP-UI for functional tests:

http://soa.dzone.com/articles/functional-web-services-1

http://soa.dzone.com/articles/draft-functional-web-services--0

http://soa.dzone.com/articles/functional-web-services-testin-1


More here
http://www.soapui.org/Getting-Started/functional-testing.html

and with Maven:

http://technology.amis.nl/blog/7408/automatic-testing-oracle-service-bus-using-hudson-maven-and-soapui



On running SOAPUI tests from JUnit (Hudson):

where every SOAPUI project is executed in its own JUnit test, to make it easier to identify problems:

package dk.acme.dmr.service.test.integration;

import java.io.File;
import java.io.FilenameFilter;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import com.eviware.soapui.tools.SoapUITestCaseRunner;

/**
 * Run SOAPUI project files as test cases.
 * 
 * @author Acme A/S
 * @version 1.0
 * @since 1.0
 */
@RunWith(value = Parameterized.class)
public class SoapUITest {
  // The folder must be relative to this project
  private final static String SOAPUI_PROJECT_DIR = "src/test/resources/";

  private final static String ENDPOINT_VAR       = "endpoint";

  private final String        soapUiFileName;

  public SoapUITest(String soapUiFileName) {
    this.soapUiFileName = soapUiFileName;
  }

  @Parameterized.Parameters
  public static Collection<Object[]> soapUIprojectFiles() {
    File folder = new File(SOAPUI_PROJECT_DIR);
    OnlyExt onlyXml = new OnlyExt(".xml");
    String[] soapuiProjs = folder.list(onlyXml);
    List<Object[]> ret = new ArrayList<Object[]>();
    for (String s : soapuiProjs) {
      ret.add(new Object[] { s });
    }
    return ret;

  }

  @Test
  public void soapUITest() throws Exception {

    SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
    runner.setProjectProperties(new String[] { new String(ENDPOINT_VAR + "=http://myserver:9001") });
    runner.setOutputFolder(System.getProperty("user.dir") + "/soapui-errors");
    runner.setProjectFile(SOAPUI_PROJECT_DIR + "/" + soapUiFileName);

    runner.run();

  }

  static class OnlyExt implements FilenameFilter {
    private final String ext;

    public OnlyExt(String _ext) {
      ext = _ext;
    }

    public boolean accept(File dir, String name) {

      return name.endsWith(ext);
    }
  }

}







I am still NOT persuaded that using SOAPUI for functional tests is better than using JUnit and Java stubs. If you go beyond the basics, SOAPUI and Groovy can be even more complex than the Java solution. I simply cannot accept writing complex code in a language that cannot be compiled and easily refactored.

Sunday, June 13, 2010

JMeter and testing Web Services

I add a Sampler "WebService(SOAP) Request", enter a perfectly working WSDL url (tested also in the browser)... click on "Load WSDL"... nothing happens, the Web Methods drop down doesn't get populated and nothing is logged on the JMeter console.

http://jakarta.apache.org/jmeter/usermanual/build-ws-test-plan.html

If the WSDL file was loaded correctly, the "Web Methods" drop down should be populated. If the drop down remains blank, it means there was a problem getting the WSDL. 

Pardon me for being so old fashioned, but in the old days programmers used to LOG what the problem was... I look also in the jmeter.log file in the bin directory (a log file in the bin directory????) and nothing...

JMeter would be a great tool if only it had been better coded....

So I am using SOAPUI (great great tool):
http://soapui.com/Functional-Testing/structuring-and-running-tests.html

an forget JMeter, its UI anyway is pretty bad, they need someone who knows how to do Swing.


Monday, March 15, 2010

SOAP UI and WS-Security

http://www.soapui.org/userguide/projects/wss.html

in SOAPUI, right click on project, and "show project view"

"security configurations" tab

"keystores/certificates"

add your keystore and specify keystore password, default alias and alias password (should match store password)

then go to "Outgoing WS-Security Configurations" and create a profile (e.g. "signed") putting the default alias and password.
Then in the same tab add "WSS entry" for signature (I know, the UI really sucks), select keystore, alias etc

Now CLOSE AND REOPEN SOAPUI (little bug here), then open the Request and look for a tiny "Aut" tab on the bottom (as I said, the UI really sucks). In "outgoing WSS" choose the configuration you have created.


If you get this:

Unable to decode certificate: java.security.cert.CertificateException: Unable to initialize, java.io.IOException: DerInputStream.getLength(): lengthTag=127, too big

then it means you have survived so far to this terrible horrible mess which is WS-Security.