mstover1 2003/06/05 10:33:38
Modified: bin jmeter.properties users.xml
docs/usermanual component_reference.html
src/core/org/apache/jmeter/gui/util FilePanel.java
src/core/org/apache/jmeter/resources messages.properties
messages_de.properties messages_ja.properties
messages_no.properties
src/protocol/http/org/apache/jmeter/junit/protocol/http/parser
HtmlParserTester.java
src/protocol/http/org/apache/jmeter/protocol/http/modifier
AnchorModifier.java URLRewritingModifier.java
src/protocol/http/org/apache/jmeter/protocol/http/sampler
HTTPSampler.java
xdocs/usermanual component_reference.xml
Added: docs/images/screenshots webservice_sampler.png
lib soap.jar
src/protocol/http/org/apache/jmeter/protocol/http/control/gui
WebServiceSamplerGui.java
src/protocol/http/org/apache/jmeter/protocol/http/sampler
WebServiceSampler.java
Log:
New SOAP sampler that uses Apaches Soap library (Peter Lin)
Revision Changes Path
1.75 +2 -2 jakarta-jmeter/bin/jmeter.properties
Index: jmeter.properties
===================================================================
RCS file: /home/cvs/jakarta-jmeter/bin/jmeter.properties,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- jmeter.properties 4 Jun 2003 14:31:42 -0000 1.74
+++ jmeter.properties 5 Jun 2003 17:33:36 -0000 1.75
@@ -72,12 +72,12 @@
#Logging levels for the logging categories in JMeter. Correct values are
FATAL_ERROR, ERROR, WARN, INFO, and DEBUG
log_level.jmeter=WARN
log_level.jmeter.engine=WARN
-log_level.jmeter.gui=WARN
+log_level.jmeter.gui=DEBUG
log_level.jmeter.elements=WARN
log_level.jmeter.util=WARN
log_level.jmeter.util.classfinder=WARN
log_level.jmeter.test=DEBUG
-log_level.jmeter.protocol.http=WARN
+log_level.jmeter.protocol.http=DEBUG
log_level.jmeter.protocol.ftp=WARN
log_level.jmeter.protocol.jdbc=WARN
log_level.jmeter.protocol.java=WARN
1.2 +3 -3 jakarta-jmeter/bin/users.xml
Index: users.xml
===================================================================
RCS file: /home/cvs/jakarta-jmeter/bin/users.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- users.xml 1 May 2002 02:02:19 -0000 1.1
+++ users.xml 5 Jun 2003 17:33:36 -0000 1.2
@@ -7,7 +7,7 @@
<thread>
<parameter>
- <paramname>user_id</paramname>
+ <paramname>username</paramname>
<paramvalue>dduck</paramvalue>
</parameter>
<parameter>
@@ -17,7 +17,7 @@
</thread>
<thread>
<parameter>
- <paramname>user_id</paramname>
+ <paramname>username</paramname>
<paramvalue>mmouse</paramvalue>
</parameter>
<parameter>
@@ -27,7 +27,7 @@
</thread>
<thread>
<parameter>
- <paramname>user_id</paramname>
+ <paramname>username</paramname>
<paramvalue>bbunney</paramvalue>
</parameter>
<parameter>
1.1 jakarta-jmeter/docs/images/screenshots/webservice_sampler.png
<<Binary file>>
1.39 +58 -0 jakarta-jmeter/docs/usermanual/component_reference.html
Index: component_reference.html
===================================================================
RCS file: /home/cvs/jakarta-jmeter/docs/usermanual/component_reference.html,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- component_reference.html 5 Jun 2003 00:24:22 -0000 1.38
+++ component_reference.html 5 Jun 2003 17:33:37 -0000 1.39
@@ -92,6 +92,7 @@
<li><a href="#Java_Request">Java
Request</a></li>
<li><a
href="#SOAP/XML-RPC_Request">SOAP/XML-RPC Request</a></li>
<li><a href="#LDAP_Request">LDAP
Request</a></li>
+ <li><a href="#Webservice_Request">Webservice
Request</a></li>
</ul>
<li><a href="#logic_controllers">13.2 Logic
Controllers</a></li>
<ul>
@@ -842,6 +843,63 @@
</li>
</ol>
</ol>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ </table>
+ <hr>
+
<table
border="0" cellspacing="0" cellpadding="2">
+ <tr><td>
+ <font face="arial,helvetica,sanserif">
+ <a name="Webservice_Request"><h3>13.1.7 Webservice
Request</h3></a>
+ </font>
+ </td></tr>
+ <tr><td>
+
<p
>
+ This sampler has been
tested with IIS Webservice running .NET 1.0. It hasn't been tested with SUN or IBM
webservices providers, but it should work. The sampler uses Apache SOAP driver, to
serialize the message and set the header with the correct SOAPAction. Right now the
sampler doesn't support automatic WSDL handling, since Apache SOAP currently doesn't
provide support for it. Both IBM and SUN provide WSDL drivers.
+ </p>
+
+
+
<p><b>Control Panel</b></p>
+ <div align="center"><img
src="../images/screenshots/webservice_sampler.png"></div>
+
<p>
+ <b>Parameters</b>
+ <table border="1" cellspacing="0" cellpadding="2">
+ <tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
+ <tr>
+ <td>Name</td>
+ <td> Descriptive
name for this sampler
+ that is shown in the tree.
+ </td>
+ <td>
+
No
+ </td>
+ </tr>
+ <tr>
+ <td>URL</td>
+ <td> The URL to
direct the SOAP request to.
+ </td>
+ <td>
+
Yes
+ </td>
+ </tr>
+ <tr>
+ <td>SOAPAction</td>
+ <td> The SOAPAction
defined in the webservice description or WSDL.
+ </td>
+ <td>
+
Yes
+ </td>
+ </tr>
+ <tr>
+ <td>Soap Data</td>
+ <td> The Soap XML
message
+ </td>
+ <td>
+
Yes
+ </td>
+ </tr>
+ </table>
+ </p>
</td></tr>
<tr><td><br/></td></tr>
</table>
1.1 jakarta-jmeter/lib/soap.jar
<<Binary file>>
1.8 +8 -1
jakarta-jmeter/src/core/org/apache/jmeter/gui/util/FilePanel.java
Index: FilePanel.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/util/FilePanel.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FilePanel.java 30 Apr 2003 21:37:30 -0000 1.7
+++ FilePanel.java 5 Jun 2003 17:33:37 -0000 1.8
@@ -88,6 +88,7 @@
JButton browse = new JButton(JMeterUtils.getResString("browse"));
List listeners = new LinkedList();
String title;
+ String filetype;
/**
* Constructor for the FilePanel object
@@ -103,6 +104,12 @@
this.title = title;
init();
}
+
+ public FilePanel(String title, String filetype)
+ {
+ this(title);
+ this.filetype = filetype;
+ }
/**
* Constructor for the FilePanel object
@@ -175,7 +182,7 @@
{
if(e.getActionCommand().equals("browse"))
{
- JFileChooser chooser = FileDialoger.promptToOpenFile(new
String[]{".jtl"});
+ JFileChooser chooser = FileDialoger.promptToOpenFile(new
String[]{filetype});
if(chooser != null && chooser.getSelectedFile() != null)
{
filename.setText(chooser.getSelectedFile().getPath());
1.43 +3 -2
jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties
Index: messages.properties
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- messages.properties 5 Jun 2003 00:13:40 -0000 1.42
+++ messages.properties 5 Jun 2003 17:33:37 -0000 1.43
@@ -353,8 +353,6 @@
throughput_control_perthread_label=Per User
csvread_file_file_name=CSV file to get values from
column_number=Column number of CSV file
-
-
servername=Servername :
user_defined_test=User Defined Test
add_test=Add Test
@@ -369,3 +367,6 @@
test_configuration=Test Configuration
test =Test
ldap_testing_title= LDAP Request
+webservice_sampler_title=WebService (SOAP) Request
+soap_action=Soap Action
+get_xml_from_file=File with SOAP XML Data (overrides above text)
\ No newline at end of file
1.35 +4 -2
jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_de.properties
Index: messages_de.properties
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_de.properties,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- messages_de.properties 5 Jun 2003 00:13:40 -0000 1.34
+++ messages_de.properties 5 Jun 2003 17:33:37 -0000 1.35
@@ -340,7 +340,6 @@
update_per_iter=Update Once Per Iteration
csvread_file_file_name=CSV file to get values from
column_number=Column number of CSV file
-
servername=Servername :
user_defined_test=User Defined Test
add_test=Add Test
@@ -356,4 +355,7 @@
test =Test
ldap_testing_title= LDAP Request
minimum_param=The minimum value allowed for a range of values
-maximum_param=The maximum value allowed for a range of values
\ No newline at end of file
+maximum_param=The maximum value allowed for a range of values
+webservice_sampler_title=WebService (SOAP) Request
+soap_action=Soap Action
+get_xml_from_file=File with SOAP XML Data (overrides above text)
\ No newline at end of file
1.31 +4 -1
jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_ja.properties
Index: messages_ja.properties
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_ja.properties,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- messages_ja.properties 5 Jun 2003 00:13:40 -0000 1.30
+++ messages_ja.properties 5 Jun 2003 17:33:37 -0000 1.31
@@ -350,4 +350,7 @@
test =Test
ldap_testing_title= LDAP Request
minimum_param=The minimum value allowed for a range of values
-maximum_param=The maximum value allowed for a range of values
\ No newline at end of file
+maximum_param=The maximum value allowed for a range of values
+webservice_sampler_title=WebService (SOAP) Request
+soap_action=Soap Action
+get_xml_from_file=File with SOAP XML Data (overrides above text)
\ No newline at end of file
1.31 +4 -1
jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_no.properties
Index: messages_no.properties
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_no.properties,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- messages_no.properties 5 Jun 2003 00:13:40 -0000 1.30
+++ messages_no.properties 5 Jun 2003 17:33:37 -0000 1.31
@@ -342,4 +342,7 @@
test =Test
ldap_testing_title= LDAP Request
minimum_param=The minimum value allowed for a range of values
-maximum_param=The maximum value allowed for a range of values
\ No newline at end of file
+maximum_param=The maximum value allowed for a range of values
+webservice_sampler_title=WebService (SOAP) Request
+soap_action=Soap Action
+get_xml_from_file=File with SOAP XML Data (overrides above text)
\ No newline at end of file
1.5 +9 -9
jakarta-jmeter/src/protocol/http/org/apache/jmeter/junit/protocol/http/parser/HtmlParserTester.java
Index: HtmlParserTester.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/junit/protocol/http/parser/HtmlParserTester.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HtmlParserTester.java 3 May 2003 15:34:34 -0000 1.4
+++ HtmlParserTester.java 5 Jun 2003 17:33:37 -0000 1.5
@@ -52,7 +52,7 @@
result.setSamplerData(context.toString());
JMeterContextService.getContext().setPreviousResult(result);
parser.process();
- assertEquals("http://www.apache.org:80/subdir/index.html",
+ assertEquals("http://www.apache.org/subdir/index.html",
config.getUrl().toString());
}
@@ -71,8 +71,8 @@
JMeterContextService.getContext().setPreviousResult(result);
parser.process();
String newUrl = config.getUrl().toString();
- assertTrue("http://www.apache.org:80/index.html".equals(newUrl)
- ||
"http://www.apache.org:80/subdir/lowerdir/index.html".equals(newUrl));
+ assertTrue("http://www.apache.org/index.html".equals(newUrl)
+ ||
"http://www.apache.org/subdir/lowerdir/index.html".equals(newUrl));
}
@@ -91,7 +91,7 @@
JMeterContextService.getContext().setPreviousResult(result);
parser.process();
String newUrl = config.getUrl().toString();
-
assertEquals("http://www.apache.org:80/home/index.html?param1=value1",newUrl);
+
assertEquals("http://www.apache.org/home/index.html?param1=value1",newUrl);
}
public void testSimpleParse4() throws Exception
@@ -108,7 +108,7 @@
JMeterContextService.getContext().setPreviousResult(result);
parser.process();
String newUrl = config.getUrl().toString();
- assertEquals("http://www.apache.org:80/subdir/index.html",newUrl);
+ assertEquals("http://www.apache.org/subdir/index.html",newUrl);
}
public void testSimpleParse5() throws Exception
@@ -125,7 +125,7 @@
JMeterContextService.getContext().setPreviousResult(result);
parser.process();
String newUrl = config.getUrl().toString();
- assertEquals("http://www.apache.org:80/subdir/index.html",newUrl);
+ assertEquals("http://www.apache.org/subdir/index.html",newUrl);
}
public void testFailSimpleParse1() throws Exception
@@ -175,7 +175,7 @@
JMeterContextService.getContext().setPreviousResult(result);
parser.process();
String newUrl = config.getUrl().toString();
-
assertTrue(!"http://www.apache.org:80/home/index.html?param1=value1".equals(newUrl));
+
assertTrue(!"http://www.apache.org/home/index.html?param1=value1".equals(newUrl));
assertEquals(config.getUrl().toString(),newUrl);
}
@@ -200,7 +200,7 @@
JMeterContextService.getContext().setCurrentSampler(config);
JMeterContextService.getContext().setPreviousResult(result);
parser.process();
- assertEquals("http://www.apache.org:80/subdir/index.html",
+ assertEquals("http://www.apache.org/subdir/index.html",
config.getUrl().toString());
assertEquals("test=goto",config.getQueryString());
}
@@ -226,7 +226,7 @@
JMeterContextService.getContext().setCurrentSampler(config);
JMeterContextService.getContext().setPreviousResult(result);
parser.process();
- assertEquals("http://www.apache.org:80/subdir/index.html",
+ assertEquals("http://www.apache.org/subdir/index.html",
config.getUrl().toString());
assertEquals("te%24st=goto",config.getQueryString());
}
1.1
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java
Index: WebServiceSamplerGui.java
===================================================================
package org.apache.jmeter.protocol.http.control.gui;
import java.awt.Font;
import java.awt.GridLayout;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import org.apache.jmeter.gui.util.FilePanel;
import org.apache.jmeter.gui.util.VerticalPanel;
import org.apache.jmeter.protocol.http.sampler.WebServiceSampler;
import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.gui.JLabeledTextArea;
import org.apache.jorphan.gui.JLabeledTextField;
import org.apache.jorphan.gui.layout.VerticalLayout;
import org.apache.jorphan.io.TextFile;
/**
* @author peter lin
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
*/
public class WebServiceSamplerGui extends AbstractSamplerGui {
// private static final String label =
JMeterUtils.getResString("webservice_sampler_title");
private static final String label =
JMeterUtils.getResString("webservice_sampler_title");
JLabeledTextField urlField = new
JLabeledTextField(JMeterUtils.getResString("url"));
JLabeledTextField soapAction = new
JLabeledTextField(JMeterUtils.getResString("soap_action"));
JLabeledTextArea soapXml = new
JLabeledTextArea(JMeterUtils.getResString("soap_data_title"),null);
FilePanel soapXmlFile = new
FilePanel(JMeterUtils.getResString("get_xml_from_file"),".xml");
public WebServiceSamplerGui()
{
init();
}
/**
* @see JMeterGUIComponent#getStaticLabel()
*/
public String getStaticLabel() {
return label;
}
/**
* @see JMeterGUIComponent#createTestElement()
*/
public TestElement createTestElement() {
WebServiceSampler sampler = new WebServiceSampler();
modifyTestElement(sampler);
return sampler;
}
/**
* init() adds soapAction to the mainPanel. The class
* reuses logic from SOAPSampler, since it is common.
*/
private void init()
{
this.setLayout(new GridLayout(1,1));
// MAIN PANEL
JPanel mainPanel = new VerticalPanel();
Border margin = new EmptyBorder(10, 10, 5, 10);
mainPanel.setBorder(margin);
mainPanel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
// TITLE
JLabel panelTitleLabel = new JLabel(label);
Font curFont = panelTitleLabel.getFont();
int curFontSize = curFont.getSize();
curFontSize += 4;
panelTitleLabel.setFont(new Font(curFont.getFontName(),
curFont.getStyle(), curFontSize));
mainPanel.add(panelTitleLabel);
// NAME
mainPanel.add(getNamePanel());
mainPanel.add(urlField);
mainPanel.add(soapAction);
// OPTIONAL TASKS
mainPanel.add(soapXml);
mainPanel.add(soapXmlFile);
this.add(mainPanel);
}
/**
* the implementation loads the URL and the soap
* action for the request.
*/
public void configure(TestElement el)
{
super.configure(el);
WebServiceSampler sampler = (WebServiceSampler)el;
try {
urlField.setText(sampler.getUrl().toString());
soapAction.setText(sampler.getSoapAction());
} catch(MalformedURLException e) {
}
soapXml.setText(sampler.getXmlData());
soapXmlFile.setFilename(sampler.getXmlFile());
}
/* (non-Javadoc)
* @see
org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(org.apache.jmeter.testelement.TestElement)
*/
public void modifyTestElement(TestElement element)
{
WebServiceSampler sampler = (WebServiceSampler)element;
this.configureTestElement(sampler);
try {
URL url = new URL(urlField.getText());
sampler.setDomain(url.getHost());
sampler.setPort(url.getPort());
sampler.setProtocol(url.getProtocol());
sampler.setMethod(WebServiceSampler.POST);
sampler.setPath(url.getPath());
sampler.setSoapAction(soapAction.getText());
sampler.setXmlData(soapXml.getText());
sampler.setXmlFile(soapXmlFile.getFilename());
} catch(MalformedURLException e) {
}
}
}
1.6 +3 -3
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java
Index: AnchorModifier.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AnchorModifier.java 24 Apr 2003 22:06:12 -0000 1.5
+++ AnchorModifier.java 5 Jun 2003 17:33:38 -0000 1.6
@@ -297,10 +297,10 @@
AnchorModifier modifier = new AnchorModifier();
modifier.process();
assertEquals(
-
"http://nagoya.apache.org:80/bugzilla/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=JMeter&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Reuse+same+sort+as+last+time",
+
"http://nagoya.apache.org/bugzilla/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=JMeter&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Reuse+same+sort+as+last+time",
config.toString());
config.recoverRunningVersion();
-
assertEquals("http://nagoya.apache.org:80/bugzilla/buglist.cgi?bug_status=.*&bug_status=.*&bug_status=.*&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=JMeter&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Reuse+same+sort+as+last+time",
+
assertEquals("http://nagoya.apache.org/bugzilla/buglist.cgi?bug_status=.*&bug_status=.*&bug_status=.*&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=JMeter&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Reuse+same+sort+as+last+time",
config.toString());
}
1.14 +1 -1
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java
Index: URLRewritingModifier.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- URLRewritingModifier.java 8 May 2003 19:24:08 -0000 1.13
+++ URLRewritingModifier.java 5 Jun 2003 17:33:38 -0000 1.14
@@ -151,7 +151,7 @@
mod.process();
Arguments args = sampler.getArguments();
assertEquals("jfdkjdkf jddkfdfjkdjfdf\"", ((Argument)
args.getArguments().get(0).getObjectValue()).getValue());
-
assertEquals("http://server.com:80/index.html?session_id=jfdkjdkf+jddkfdfjkdjfdf%22",
sampler.toString());
+
assertEquals("http://server.com/index.html?session_id=jfdkjdkf+jddkfdfjkdjfdf%22",
sampler.toString());
}
public void testGrabSessionId2() throws Exception
{
1.43 +13 -13
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
Index: HTTPSampler.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- HTTPSampler.java 5 Jun 2003 16:22:22 -0000 1.42
+++ HTTPSampler.java 5 Jun 2003 17:33:38 -0000 1.43
@@ -1092,7 +1092,7 @@
sampler.setMethod(HTTPSampler.GET);
sampler.setPath("/index.html?pear");
sampler.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?pear",
sampler.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?pear",
sampler.getUrl().toString());
}
public void testMakingUrl() throws Exception
@@ -1103,7 +1103,7 @@
config.addArgument("param1", "value1");
config.setPath("/index.html");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?param1=value1",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?param1=value1",
config.getUrl().toString());
}
public void testMakingUrl2() throws Exception
{
@@ -1113,7 +1113,7 @@
config.addArgument("param1", "value1");
config.setPath("/index.html?p1=p2");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?param1=value1&p1=p2",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?param1=value1&p1=p2",
config.getUrl().toString());
}
public void testMakingUrl3() throws Exception
{
@@ -1123,7 +1123,7 @@
config.addArgument("param1", "value1");
config.setPath("/index.html?p1=p2");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?p1=p2",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?p1=p2",
config.getUrl().toString());
}
// test cases for making Url, and exercise method addArgument(String
name,String value,String metadata)
public void testMakingUrl4() throws Exception
@@ -1134,7 +1134,7 @@
config.addArgument("param1", "value1", "=");
config.setPath("/index.html");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?param1=value1",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?param1=value1",
config.getUrl().toString());
}
public void testMakingUrl5() throws Exception
{
@@ -1144,7 +1144,7 @@
config.addArgument("param1", "", "=");
config.setPath("/index.html");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?param1=",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?param1=",
config.getUrl().toString());
}
public void testMakingUrl6() throws Exception
{
@@ -1154,7 +1154,7 @@
config.addArgument("param1", "", "");
config.setPath("/index.html");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?param1",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?param1",
config.getUrl().toString());
}
// test cases for making Url, and exercise method parseArguments(String
queryString)
public void testMakingUrl7() throws Exception
@@ -1165,7 +1165,7 @@
config.parseArguments("param1=value1");
config.setPath("/index.html");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?param1=value1",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?param1=value1",
config.getUrl().toString());
}
public void testMakingUrl8() throws Exception
{
@@ -1175,7 +1175,7 @@
config.parseArguments("param1=");
config.setPath("/index.html");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?param1=",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?param1=",
config.getUrl().toString());
}
public void testMakingUrl9() throws Exception
{
@@ -1185,7 +1185,7 @@
config.parseArguments("param1");
config.setPath("/index.html");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html?param1",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html?param1",
config.getUrl().toString());
}
public void testMakingUrl10() throws Exception
{
@@ -1195,7 +1195,7 @@
config.parseArguments("");
config.setPath("/index.html");
config.setDomain("www.apache.org");
- assertEquals("http://www.apache.org:80/index.html",
config.getUrl().toString());
+ assertEquals("http://www.apache.org/index.html",
config.getUrl().toString());
}
}
}
1.1
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
Index: WebServiceSampler.java
===================================================================
package org.apache.jmeter.protocol.http.sampler;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.xml.parsers.DocumentBuilder;
import org.apache.jmeter.samplers.Entry;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jorphan.io.TextFile;
import org.apache.soap.Envelope;
import org.apache.soap.messaging.Message;
import org.apache.soap.transport.SOAPTransport;
import org.apache.soap.util.xml.XMLParserUtils;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
/**
* Sampler to handle Web Service requests. It uses Apache
* soap drivers to perform the XML generation, connection
* soap encoding and other soap functions.
*
* @author Peter Lin
* @version $Id:
*/
public class WebServiceSampler extends HTTPSampler
{
public static final String XML_DATA = "HTTPSamper.xml_data";
public static final String SOAP_ACTION = "Soap.Action";
public static final String XML_DATA_FILE = "WebServiceSampler.xml_data_file";
public String SOAPACTION = null;
transient SampleResult RESULT = null;
protected Document XMLMSG = null;
/**
* set the XML data
* @param String data
*/
public void setXmlData(String data)
{
setProperty(XML_DATA,data);
}
public void setXmlFile(String filename)
{
setProperty(XML_DATA_FILE,filename);
}
public String getXmlFile()
{
return getPropertyAsString(XML_DATA_FILE);
}
/**
* get the XML data as a string
* @return String data
*/
public String getXmlData()
{
return getPropertyAsString(XML_DATA);
}
/**
* set the soap action which should be in
* the form of an URN
* @param String data
*/
public void setSoapAction(String data){
setProperty(SOAP_ACTION,data);
}
/**
* return the soap action string
* @return
*/
public String getSoapAction() {
System.out.println(getPropertyAsString(SOAP_ACTION));
return getPropertyAsString(SOAP_ACTION);
}
private String retrieveRuntimeXmlData()
{
String file = getXmlFile();
if(file.length() > 0)
{
TextFile contents = new TextFile(file);
if(contents.exists())
{
return contents.getText();
}
}
return getXmlData();
}
/**
* This method uses Apache soap util to create
* the proper DOM elements.
* @return Element
*/
public org.w3c.dom.Element createDocument(){
String xmlData = retrieveRuntimeXmlData();
if (xmlData != null && xmlData.length() > 0){
try {
DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
Document doc = xdb.parse(new InputSource(new
StringReader(xmlData)));
return doc.getDocumentElement();
} catch (Exception ex){
ex.printStackTrace();
return null;
}
} else {
return null;
}
}
public SampleResult sample(Entry e)
{
return sample();
}
public SampleResult sample(){
RESULT = new SampleResult();
sampleWithApache();
return RESULT;
}
public void sampleWithApache() {
try {
Envelope msgEnv = Envelope.unmarshall(createDocument());
// send the message
Message msg = new Message ();
long start = System.currentTimeMillis();
msg.send(this.getUrl(), "http://tempuri.org/doInference",
msgEnv);
RESULT.setTime(System.currentTimeMillis() - start);
SOAPTransport st = msg.getSOAPTransport ();
BufferedReader br = st.receive();
StringBuffer buf = new StringBuffer();
String line;
while((line = br.readLine()) != null){
buf.append(line);
}
RESULT.setResponseMessage(buf.toString());
RESULT.setSuccessful(true);
// this doesn't really apply, since the soap
// driver doesn't provide a resonse code
// RESULT.setResponseCode("200");
} catch (Exception exception){
// exception.printStackTrace();
RESULT.setSuccessful(false);
}
}
/**
* We override this to prevent the wrong encoding
* and provide no implementation. We want to
* reuse the other parts of HTTPSampler, but not
* the connection. The connection is handled by
* the Apache SOAP driver.
*/
public void addEncodedArgument(String name, String value, String metaData)
{
}
/**
* We override this to prevent the wrong encoding
* and provide no implementation. We want to
* reuse the other parts of HTTPSampler, but not
* the connection. The connection is handled by
* the Apache SOAP driver.
*/
protected HttpURLConnection setupConnection(URL u, String method)
throws IOException
{
return null;
}
/**
* We override this to prevent the wrong encoding
* and provide no implementation. We want to
* reuse the other parts of HTTPSampler, but not
* the connection. The connection is handled by
* the Apache SOAP driver.
*/
protected long connect() throws IOException
{
return -1;
}
}
1.37 +15 -0 jakarta-jmeter/xdocs/usermanual/component_reference.xml
Index: component_reference.xml
===================================================================
RCS file: /home/cvs/jakarta-jmeter/xdocs/usermanual/component_reference.xml,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- component_reference.xml 5 Jun 2003 00:24:22 -0000 1.36
+++ component_reference.xml 5 Jun 2003 17:33:38 -0000 1.37
@@ -239,6 +239,21 @@
should be available in the LDAP Server. The execution time is
calculated.</p></li></ol></ol>
</component>
+<component name="Webservice Request" index="13.1.7"
screenshot="../images/screenshots/webservice_sampler.png">
+
+<description><p>This sampler has been tested with IIS Webservice running .NET 1.0.
It hasn't been tested with SUN or IBM webservices providers, but it should work. The
sampler uses Apache SOAP driver, to serialize the message and set the header with the
correct SOAPAction. Right now the sampler doesn't support automatic WSDL handling,
since Apache SOAP currently doesn't provide support for it. Both IBM and SUN provide
WSDL drivers.</p>
+</description>
+
+<properties>
+ <property name="Name" required="No">Descriptive name for this sampler
+ that is shown in the tree.</property>
+ <property name="URL" required="Yes">The URL to direct the SOAP request
to.</property>
+ <property name="SOAPAction" required="Yes">The SOAPAction defined in the
webservice description or WSDL.</property>
+ <property name="Soap Data" required="Yes">The Soap XML message</property>
+ </properties>
+
+</component>
+
</section>
<section name="13.2 Logic Controllers" anchor="logic_controllers">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]