You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by wo...@apache.org on 2006/02/18 05:53:41 UTC
svn commit: r378688 - in
/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http:
control/gui/WebServiceSamplerGui.java util/WSDLHelper.java
Author: woolfel
Date: Fri Feb 17 20:53:39 2006
New Revision: 378688
URL: http://svn.apache.org/viewcvs?rev=378688&view=rev
Log:
fixing the Webservice sampler so it uses the binding address from the wsdl
peter lin
Modified:
jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java
jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java
Modified: jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java?rev=378688&r1=378687&r2=378688&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java Fri Feb 17 20:53:39 2006
@@ -58,7 +58,9 @@
JLabeledTextField domain = new JLabeledTextField(JMeterUtils.getResString("web_server_domain"));
- JLabeledTextField port = new JLabeledTextField(JMeterUtils.getResString("web_server_port"));
+ JLabeledTextField protocol = new JLabeledTextField(JMeterUtils.getResString("protocol"));
+
+ JLabeledTextField port = new JLabeledTextField(JMeterUtils.getResString("web_server_port"));
JLabeledTextField path = new JLabeledTextField(JMeterUtils.getResString("path"));
@@ -171,6 +173,7 @@
this.configureTestElement(sampler);
sampler.setDomain(domain.getText());
sampler.setProperty(HTTPSamplerBase.PORT,port.getText());
+ sampler.setProtocol(protocol.getText());
sampler.setPath(path.getText());
sampler.setWsdlURL(wsdlField.getText());
sampler.setMethod(HTTPSamplerBase.POST);
@@ -233,6 +236,7 @@
listPanel.add(selectButton);
selectButton.addActionListener(this);
+ mainPanel.add(protocol);
mainPanel.add(domain);
mainPanel.add(port);
mainPanel.add(path);
@@ -279,6 +283,7 @@
super.configure(el);
WebServiceSampler sampler = (WebServiceSampler) el;
wsdlField.setText(sampler.getWsdlURL());
+ protocol.setText(sampler.getProtocol());
domain.setText(sampler.getDomain());
port.setText(sampler.getPropertyAsString(HTTPSamplerBase.PORT));
path.setText(sampler.getPath());
@@ -309,13 +314,14 @@
*/
public void configureFromWSDL() {
if (HELPER.getBinding() != null) {
- this.domain.setText(HELPER.getURL().getHost());
- if (HELPER.getURL().getPort() > 0) {
- this.port.setText(String.valueOf(HELPER.getURL().getPort()));
+ this.protocol.setText(HELPER.getProtocol());
+ this.domain.setText(HELPER.getBindingHost());
+ if (HELPER.getBindingPort() > 0) {
+ this.port.setText(String.valueOf(HELPER.getBindingPort()));
} else {
this.port.setText("80");
}
- this.path.setText(HELPER.getURL().getPath());
+ this.path.setText(HELPER.getBindingPath());
}
this.soapAction.setText(HELPER.getSoapAction(this.wsdlMethods.getText()));
}
Modified: jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java?rev=378688&r1=378687&r2=378688&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java Fri Feb 17 20:53:39 2006
@@ -63,6 +63,8 @@
protected String SOAPBINDING = null;
public String BINDNAME = null;
+
+ protected URL bindingURL = null;
protected Object[] SOAPOPS = null;
@@ -95,6 +97,39 @@
return this.WSDLURL;
}
+ /**
+ * Return the protocol from the URL. this is needed, so that HTTPS works
+ * as expected.
+ * @return
+ */
+ public String getProtocol() {
+ return this.bindingURL.getProtocol();
+ }
+
+ /**
+ * Return the host in the WSDL binding address
+ * @return
+ */
+ public String getBindingHost() {
+ return this.bindingURL.getHost();
+ }
+
+ /**
+ * Return the path in the WSDL for the binding address
+ * @return
+ */
+ public String getBindingPath() {
+ return this.bindingURL.getPath();
+ }
+
+ /**
+ * Return the port for the binding address
+ * @return
+ */
+ public int getBindingPort() {
+ return this.bindingURL.getPort();
+ }
+
/**
* Returns the binding point for the webservice. Right now it naively
* assumes there's only one binding point with numerous soap operations.
@@ -130,6 +165,7 @@
}
Element addr = (Element) servlist.item(0);
this.SOAPBINDING = addr.getAttribute("location");
+ this.bindingURL = new URL(this.SOAPBINDING);
return this.SOAPBINDING;
}
return null;
@@ -355,8 +391,8 @@
WSDLHelper help =
// new WSDLHelper("http://localhost/WSTest/WSTest.asmx?WSDL");
// new WSDLHelper("http://localhost/AxisWSDL.xml");
- // new WSDLHelper("http://localhost/test-setup.xml");
- new WSDLHelper("http://services.bio.ifi.lmu.de:1046/prothesaurus/services/BiologicalNameService?wsdl");
+ new WSDLHelper("http://localhost:8080/ServiceGateway.wsdl");
+ // new WSDLHelper("http://services.bio.ifi.lmu.de:1046/prothesaurus/services/BiologicalNameService?wsdl");
long start = System.currentTimeMillis();
help.parse();
String[] methods = help.getWebMethods();
@@ -365,6 +401,7 @@
System.out.println("method name: " + methods[idx]);
}
System.out.println("service url: " + help.getBinding());
+ System.out.println("protocol: " + help.getProtocol());
System.out.println("port=" + help.getURL().getPort());
} catch (Exception exception) {
System.out.println("main method catch:");
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org