You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2005/07/11 17:49:55 UTC
svn commit: r210150 [16/35] - in /webservices/axis/trunk/java: ./ etc/
modules/addressing/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/
modules/addressing/test/org/apache/axis2/handlers/addressing/ mod...
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/QueueManager.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/QueueManager.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/QueueManager.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/QueueManager.java Mon Jul 11 08:49:30 2005
@@ -20,10 +20,11 @@
*
*
*/
+
public class QueueManager {
private static String key = null;
- static{
+ static {
Class clazz = new Object().getClass();
InputStream stream = clazz.getResourceAsStream("/sample/amazon/common/conf/key.properties");
Properties properties = new Properties();
@@ -40,7 +41,7 @@
return key;
}
- public synchronized static void setKey(String tkey){
+ public synchronized static void setKey(String tkey) {
key = tkey;
}
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java Mon Jul 11 08:49:30 2005
@@ -47,17 +47,15 @@
public void run() {
if (this.createQueue.isEditable()) {
- OMElement createQueueElement = OMElementCreator.creatQueueElement(
- this.createQueue.getText(),getKey());
+ OMElement createQueueElement = OMElementCreator.creatQueueElement(this.createQueue.getText(), getKey());
this.axis2EngineRuns("CreateQueue", createQueueElement,
- new SimpleQueueCreateQueueCallbackHandler(this.createQueue, this.queueCode,
- this.enqueue, this.result));
+ new SimpleQueueCreateQueueCallbackHandler(this.createQueue, this.queueCode,
+ this.enqueue, this.result));
}
if (this.enqueue.isEditable()) {
OMElement enqueueElement = OMElementCreator.enqueueElement(this.enqueue.getText(),
- this.queueCode.getText(),getKey());
- this.axis2EngineRuns("Enqueue", enqueueElement, new SimpleQueueEnqueueCallbackHandler(
- this.createQueue, this.queueCode, this.enqueue, this.result));
+ this.queueCode.getText(), getKey());
+ this.axis2EngineRuns("Enqueue", enqueueElement, new SimpleQueueEnqueueCallbackHandler(this.createQueue, this.queueCode, this.enqueue, this.result));
}
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java Mon Jul 11 08:49:30 2005
@@ -48,9 +48,9 @@
}
public void run() {
- OMElement deleteQueueElement = OMElementCreator.deleteQueueElement(this.createQueue.getText(),getKey());
+ OMElement deleteQueueElement = OMElementCreator.deleteQueueElement(this.createQueue.getText(), getKey());
this.axis2EngineRuns("DeleteQueue", deleteQueueElement,
- new SimpleQueueDeleteQueueCallbackHandler(this.result, this.button));
+ new SimpleQueueDeleteQueueCallbackHandler(this.result, this.button));
}
private void axis2EngineRuns(String operation, OMElement element,
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java Mon Jul 11 08:49:30 2005
@@ -50,8 +50,8 @@
public void run() {
OMElement listMyQueuesElement = OMElementCreator.queueListElement(getKey());
this.axis2EngineRuns("ListMyQueues", listMyQueuesElement,
- new SimpleQueueListMyQueuesCallbackHandler(this.createQueue, this.queueCode,
- this.read, this.result, this.button));
+ new SimpleQueueListMyQueuesCallbackHandler(this.createQueue, this.queueCode,
+ this.read, this.result, this.button));
}
private void axis2EngineRuns(String operation, OMElement element,
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java Mon Jul 11 08:49:30 2005
@@ -46,9 +46,9 @@
}
public void run() {
- OMElement readQueueElement = OMElementCreator.read(this.createQueue.getText(),getKey());
+ OMElement readQueueElement = OMElementCreator.read(this.createQueue.getText(), getKey());
this.axis2EngineRuns("Read", readQueueElement,
- new SimpleQueueReadCallbackHandler(this.queueCode, this.result));
+ new SimpleQueueReadCallbackHandler(this.queueCode, this.result));
}
private void axis2EngineRuns(String operation, OMElement element,
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueCreateQueueCallbackHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueCreateQueueCallbackHandler.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueCreateQueueCallbackHandler.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueCreateQueueCallbackHandler.java Mon Jul 11 08:49:30 2005
@@ -23,6 +23,7 @@
import javax.swing.*;
import java.util.Iterator;
+
/**
* Callback class which deals with the outcome of the operation
*
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueDeleteQueueCallbackHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueDeleteQueueCallbackHandler.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueDeleteQueueCallbackHandler.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueDeleteQueueCallbackHandler.java Mon Jul 11 08:49:30 2005
@@ -23,29 +23,36 @@
import javax.swing.*;
import java.util.Iterator;
+
/**
* Callback class which deals with the outcome of the operation
- * @author Saminda Abeyruwan <sa...@opensource.lk>
*
+ * @author Saminda Abeyruwan <sa...@opensource.lk>
*/
public class SimpleQueueDeleteQueueCallbackHandler extends Callback {
private String returnString = "";
JTextArea results;
JButton button;
- public SimpleQueueDeleteQueueCallbackHandler(){}//defalut handler
- public SimpleQueueDeleteQueueCallbackHandler(JTextArea results,JButton button){
+
+ public SimpleQueueDeleteQueueCallbackHandler() {
+ }//defalut handler
+
+ public SimpleQueueDeleteQueueCallbackHandler(JTextArea results, JButton button) {
super();
this.results = results;
this.button = button;
}
+
public void onComplete(AsyncResult result) {
SOAPBody body = result.getResponseEnvelope().getBody();
this.getQueueDeleteStatus(body);
this.button.setText("Delete Queue");
}
+
public void reportError(Exception e) {
}
+
private void getQueueDeleteStatus(OMElement element) {
Iterator iterator = element.getChildren();
while (iterator.hasNext()) {
@@ -54,18 +61,18 @@
OMElement omElement = (OMElement) omNode;
if (omElement.getLocalName().equals("Status")) {
this.readTheQueue(omElement);
- }else{
+ } else {
getQueueDeleteStatus(omElement);
}
}
}
}
+
private void readTheQueue(OMElement element) {
if (element.getText().equals("Errors")) {
returnString += "Queue can't be deleted, it has to be dequeued first" + "\n";
- }
- else{
- returnString += "Queue is deleted" + "\n";
+ } else {
+ returnString += "Queue is deleted" + "\n";
}
this.results.setText(returnString + "\n");
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueReadCallbackHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueReadCallbackHandler.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueReadCallbackHandler.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/SimpleQueueReadCallbackHandler.java Mon Jul 11 08:49:30 2005
@@ -23,28 +23,35 @@
import javax.swing.*;
import java.util.Iterator;
+
/**
* Callback class which deals with the outcome of the operation
- * @author Saminda Abeyruwan <sa...@opensource.lk>
*
+ * @author Saminda Abeyruwan <sa...@opensource.lk>
*/
public class SimpleQueueReadCallbackHandler extends Callback {
private String returnString = "";
JTextField queueCode;
JTextArea results;
- public SimpleQueueReadCallbackHandler(){}//defalut handler
- public SimpleQueueReadCallbackHandler(JTextField queueCode, JTextArea results){
+
+ public SimpleQueueReadCallbackHandler() {
+ }//defalut handler
+
+ public SimpleQueueReadCallbackHandler(JTextField queueCode, JTextArea results) {
super();
this.queueCode = queueCode;
this.results = results;
}
+
public void onComplete(AsyncResult result) {
SOAPBody body = result.getResponseEnvelope().getBody();
this.getQueueEntryBody(body);
}
+
public void reportError(Exception e) {
}
+
private void getQueueEntryBody(OMElement element) {
Iterator iterator = element.getChildren();
while (iterator.hasNext()) {
@@ -53,12 +60,13 @@
OMElement omElement = (OMElement) omNode;
if (omElement.getLocalName().equals("QueueEntryBody")) {
this.readTheQueue(omElement);
- }else{
+ } else {
getQueueEntryBody(omElement);
}
}
}
}
+
private void readTheQueue(OMElement element) {
returnString = returnString + element.getText() + "\n";
this.results.setText(returnString + "\n");
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java Mon Jul 11 08:49:30 2005
@@ -92,7 +92,7 @@
try {
String workingDir = System.getProperty("user.dir");
propertyFile = new File(workingDir + File.separator + "samples" + File.separator +
- "key.properties");
+ "key.properties");
propertyFile.createNewFile();
prop.load(new FileInputStream(propertyFile));
amazonkey = prop.getProperty("amazonKey");
@@ -155,8 +155,8 @@
System.out.println("Sending the Async message ....");
- OMOutput omOutput = new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter
- (System.out));
+ OMOutput omOutput = new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter
+ (System.out));
requestContext.getEnvelope().serialize(omOutput);
omOutput.flush();
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/ClientCallbackHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/ClientCallbackHandler.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/ClientCallbackHandler.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/ClientCallbackHandler.java Mon Jul 11 08:49:30 2005
@@ -65,7 +65,7 @@
* @param result
*/
public void onComplete(AsyncResult result) {
- System.out.println("Responce message received to the ClientCallbackHandler ...");
+ System.out.println("Responce message received to the ClientCallbackHandler ...");
try {
OMOutput omOutput = new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out));
result.getResponseEnvelope().serialize(omOutput);
@@ -128,7 +128,7 @@
System.out.println("Got Alexa");
elem = elem.getFirstElement(); //elem -> websearch
System.out.println("Should be WebSearch " +
- elem.getLocalName());
+ elem.getLocalName());
iterator2 = elem.getChildren();
while (iterator2.hasNext()) {
node = (OMNode) iterator2.next();
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/ClientUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/ClientUtil.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/ClientUtil.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/ClientUtil.java Mon Jul 11 08:49:30 2005
@@ -47,29 +47,29 @@
* @return msgContext
*/
public static MessageContext getMessageContext() {
- OMNamespace namespace,nulNS;
- OMElement operation,value1,value2;
- OMElement subValue1,subValue2,subValue3,subValue4,subValue5;
+ OMNamespace namespace, nulNS;
+ OMElement operation, value1, value2;
+ OMElement subValue1, subValue2, subValue3, subValue4, subValue5;
SOAPFactory omFactory = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope reqEnv = omFactory.getDefaultEnvelope();
namespace = reqEnv.declareNamespace("http://schemas.xmlsoap.org/soap/envelope/",
- "SOAP-ENV");
+ "SOAP-ENV");
namespace = reqEnv.declareNamespace("http://schemas.xmlsoap.org/soap/encoding/",
- "SOAP-ENC");
+ "SOAP-ENC");
namespace = reqEnv.declareNamespace("http://www.w3.org/1999/XMLSchema-instance/", "xsi");
namespace = reqEnv.declareNamespace("http://www.w3.org/2001/XMLSchema", "xsd");
namespace = reqEnv.declareNamespace("http://schemas.xmlsoap.org/wsdl/soap/",
- "soap");
+ "soap");
namespace = reqEnv.declareNamespace("http://schemas.xmlsoap.org/wsdl/",
- "wsdl");
+ "wsdl");
namespace = reqEnv.declareNamespace("http://webservices.amazon.com/AWSAlexa/2005-02-01",
- "tns");
+ "tns");
nulNS = omFactory.createOMNamespace("", "");
operation = omFactory.createOMElement("Search",
- "http://webservices.amazon.com/AWSAlexa/2005-02-01", "ns1");
+ "http://webservices.amazon.com/AWSAlexa/2005-02-01", "ns1");
reqEnv.getBody().addChild(operation);
operation.addAttribute("encordingStyle", "http://schemas.xmlsoap.org/soap/encoding/", null);
@@ -80,7 +80,7 @@
value2 = omFactory.createOMElement("Request", nulNS);
- subValue1= omFactory.createOMElement("ResponseGroup", nulNS);
+ subValue1 = omFactory.createOMElement("ResponseGroup", nulNS);
subValue1.addChild(omFactory.createText("Web"));
subValue2 = omFactory.createOMElement("Query", nulNS);
Modified: webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/GUIHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/GUIHandler.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/GUIHandler.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/amazon/search/GUIHandler.java Mon Jul 11 08:49:30 2005
@@ -65,7 +65,7 @@
SpringLayout layout;
JMenuBar menuBar;
JMenu setMenu;
- Spring hSpring,wSpring,xSpring,ySpring;
+ Spring hSpring, wSpring, xSpring, ySpring;
frame = new JFrame("Amazon Web Search");
layout = new SpringLayout();
@@ -91,7 +91,7 @@
Dimension wndSize = theKit.getScreenSize(); // Get screen size
// Set the position to screen center and appropriate size
frame.setBounds(wndSize.width / 6, wndSize.height / 10, // Position
- wndSize.width * 3 / 5, wndSize.height * 3 / 4); // Size
+ wndSize.width * 3 / 5, wndSize.height * 3 / 4); // Size
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
text = new JEditorPane();
@@ -100,7 +100,7 @@
text.addHyperlinkListener(new LinkFollower());
JScrollPane scroll = new JScrollPane(text, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
- JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+ JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
pane.add(scroll);
textBox = new JTextField();
@@ -154,7 +154,7 @@
try {
String workingDir = System.getProperty("user.dir");
File propertyFile = new File(workingDir + File.separator + "samples" + File.separator +
- "/key.properties");
+ "/key.properties");
propOut = new FileOutputStream(propertyFile);
AsynchronousClient.prop.setProperty("amazonKey", AsynchronousClient.amazonkey);
@@ -196,6 +196,7 @@
/**
* method actionPerformed
* Detects menu click events
+ *
* @param e
*/
public void actionPerformed(ActionEvent e) {
@@ -204,7 +205,7 @@
System.out.println("come to the place");
AsynchronousClient.maxResults =
JOptionPane.showInputDialog(null,
- "Enter the number of maximum results per page (Maximum allowed is 1000)");
+ "Enter the number of maximum results per page (Maximum allowed is 1000)");
//JOptionPane.get
} while (Integer.parseInt(AsynchronousClient.maxResults) > 1000 ||
Modified: webservices/axis/trunk/java/modules/samples/src/sample/axisversion/META-INF/service.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/axisversion/META-INF/service.xml?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/axisversion/META-INF/service.xml (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/axisversion/META-INF/service.xml Mon Jul 11 08:49:30 2005
@@ -5,4 +5,4 @@
<parameter name="ServiceClass" locked="xsd:false">sample.axisversion.Version</parameter>
<operation name="getVersion">
</operation>
- </service>
\ No newline at end of file
+</service>
\ No newline at end of file
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/common/util/PropertyLoader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/common/util/PropertyLoader.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/common/util/PropertyLoader.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/common/util/PropertyLoader.java Mon Jul 11 08:49:30 2005
@@ -21,13 +21,14 @@
*
*
*/
+
public class PropertyLoader {
private static String googleKey;
private static String googleEndpointURL;
private static String googleEndpointServiceName;
- static{
+ static {
try {
Properties prop = new Properties();
Class clazz = new Object().getClass();
@@ -43,6 +44,7 @@
}
}
+
public static String getGoogleKey() {
return googleKey;
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/search/AsynchronousClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/search/AsynchronousClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/search/AsynchronousClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/search/AsynchronousClient.java Mon Jul 11 08:49:30 2005
@@ -1,4 +1,3 @@
-
package sample.google.search;
import org.apache.axis2.Constants;
@@ -53,15 +52,15 @@
*/
protected String key;
- /** maximum results per page */
+ /**
+ * maximum results per page
+ */
protected String maxResults = String.valueOf(10);
private GUIHandler gui;
-
-
public static void main(String[] args) {
new AsynchronousClient();
}
@@ -86,8 +85,8 @@
Call call = new Call();
URL url = null;
try {
- url = new URL("http", "api.google.com", "/search/beta2");
- // url = new URL("http://127.0.0.1:8080/axis2/services/axisversion/viewVersion");
+ url = new URL("http", "api.google.com", "/search/beta2");
+ // url = new URL("http://127.0.0.1:8080/axis2/services/axisversion/viewVersion");
} catch (MalformedURLException e) {
e.printStackTrace();
System.exit(0);
@@ -100,7 +99,7 @@
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
OperationDescription opdesc = new OperationDescription(opName);
- // OperationDescription opdesc = new OperationDescription(new QName("viewVersion"));
+ // OperationDescription opdesc = new OperationDescription(new QName("viewVersion"));
call.invokeNonBlocking(opdesc, requestContext, new ClientCallbackHandler(this.gui));
} catch (AxisFault e1) {
@@ -127,7 +126,6 @@
public String getMaxResults() {
return maxResults;
}
-
public void setSearch(String search) {
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/search/ClientCallbackHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/search/ClientCallbackHandler.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/search/ClientCallbackHandler.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/search/ClientCallbackHandler.java Mon Jul 11 08:49:30 2005
@@ -66,12 +66,12 @@
public ClientCallbackHandler(GUIHandler handler) {
this.handler = handler;
}
-
+
/**
- * method onComplete
- *
- * @param result
- */
+ * method onComplete
+ *
+ * @param result
+ */
public void onComplete(AsyncResult result) {
AsyncResult myResult = result;
@@ -87,7 +87,7 @@
* @param result
*/
private void extractDetails(AsyncResult result) {
- Iterator iterator,iterator2;
+ Iterator iterator, iterator2;
OMNode node;
SOAPBody body;
OMElement operation, elem;
@@ -111,7 +111,7 @@
resEnvelope = result.getResponseEnvelope();
body = resEnvelope.getBody();
operation = body.getFirstElement();
- if (body.hasFault()){
+ if (body.hasFault()) {
snippet =
snippet +
"A Fault message recieved, Check your Licence key. Else you have reached the" +
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/search/ClientUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/search/ClientUtil.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/search/ClientUtil.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/search/ClientUtil.java Mon Jul 11 08:49:30 2005
@@ -60,12 +60,12 @@
envelope.declareNamespace("http://schemas.xmlsoap.org/soap/encoding/", "SOAP-ENC");
envelope.declareNamespace("http://www.w3.org/1999/XMLSchema-instance/", "xsi");
envelope.declareNamespace("http://www.w3.org/1999/XMLSchema",
- "xsd");
+ "xsd");
operation = omFactory.createOMElement("doGoogleSearch", "urn:GoogleSearch", "ns1");
envelope.getBody().addChild(operation);
operation.addAttribute("SOAP-ENV:encordingStyle",
- "http://schemas.xmlsoap.org/soap/encoding/", null);
+ "http://schemas.xmlsoap.org/soap/encoding/", null);
operation.addChild(getOMElement(omFactory, defNs, "key", "xsd:string", asyncClient.getKey()));
operation.addChild(getOMElement(omFactory, defNs, "q", "xsd:string", asyncClient.getSearch()));
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/search/GUIHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/search/GUIHandler.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/search/GUIHandler.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/search/GUIHandler.java Mon Jul 11 08:49:30 2005
@@ -46,7 +46,7 @@
/**
* Query parameters typed here
- * */
+ */
private JTextField textBox;
/**
@@ -58,7 +58,7 @@
* Menu commands to set the key and maximum no of results per page
*/
private JMenuItem keyMenuItem, maxResultsMenuItem;
- private AsynchronousClient asyncClient ;
+ private AsynchronousClient asyncClient;
public GUIHandler(AsynchronousClient asyncClient) {
this.asyncClient = asyncClient;
@@ -88,7 +88,7 @@
menuBar.add(settingsMenu);
keyMenuItem = new JMenuItem("Key");
- keyMenuItem.addActionListener(new ActionListener(){
+ keyMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setKey();
}
@@ -96,7 +96,7 @@
settingsMenu.add(keyMenuItem);
maxResultsMenuItem = new JMenuItem("Result per page");
- maxResultsMenuItem.addActionListener(new ActionListener(){
+ maxResultsMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setMaxResults();
}
@@ -119,12 +119,12 @@
Dimension wndSize = theKit.getScreenSize(); // Get screen size
// Set the position to screen center & size to half screen size
frame.setBounds(wndSize.width / 6, wndSize.height / 10, // Position
- wndSize.width * 3 / 5, wndSize.height * 3 / 4); // Size
+ wndSize.width * 3 / 5, wndSize.height * 3 / 4); // Size
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
nextButton = new JButton("More Results");
pane.add(nextButton);
- nextButton.addActionListener(new ActionListener(){
+ nextButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
processNextButton();
}
@@ -133,7 +133,7 @@
backButton = new JButton("Previous Page");
backButton.setVisible(false);
pane.add(backButton);
- backButton.addActionListener(new ActionListener(){
+ backButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
processBackButton();
}
@@ -144,16 +144,18 @@
textEditorPane.setContentType("text/html");
textEditorPane.addHyperlinkListener(new LinkFollower());
JScrollPane scroll = new JScrollPane(textEditorPane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
- JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+ JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
pane.add(scroll);
+ textBox = new JTextField();
+ textBox.addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ }
+ public void keyReleased(KeyEvent e) {
+ }
- textBox = new JTextField();
- textBox.addKeyListener(new KeyListener(){
- public void keyPressed(KeyEvent e) {}
- public void keyReleased(KeyEvent e) {}
public void keyTyped(KeyEvent e) {
processKeyEvent(e.getKeyChar());
}
@@ -164,7 +166,7 @@
SpringLayout.Constraints textBoxConstraints = layout.getConstraints(textBox);
xSpring = Spring.constant(0); // Spring well use for X
ySpring = Spring.constant(0); // Spring well use for Y
- wSpring = Spring.constant(frame.getBounds().width-8); // Spring well use for width
+ wSpring = Spring.constant(frame.getBounds().width - 8); // Spring well use for width
hSpring = Spring.constant(30); // Strut well use for height
textBoxConstraints.setWidth(wSpring); // Set component width constraint
textBoxConstraints.setHeight(hSpring);
@@ -175,7 +177,7 @@
// SpringLayout.Constraints scrollConstraints = layout.getConstraints(textEditorPane);
xSpring = Spring.constant(0); // Spring well use for X
ySpring = Spring.constant(30); // Spring well use for Y
- wSpring = Spring.constant(frame.getBounds().width-8); // Spring well use for width
+ wSpring = Spring.constant(frame.getBounds().width - 8); // Spring well use for width
hSpring = Spring.constant(450); // Strut well use for height
scrollConstraints.setWidth(wSpring); // Set component width constraint
scrollConstraints.setHeight(hSpring);
@@ -220,13 +222,13 @@
* store it in the properties file
*/
protected void setKey() {
- String key = JOptionPane.showInputDialog(null,"Set the Google Key",PropertyLoader.getGoogleKey());
- if (key!=null && !key.trim().equals("")){
+ String key = JOptionPane.showInputDialog(null, "Set the Google Key", PropertyLoader.getGoogleKey());
+ if (key != null && !key.trim().equals("")) {
PropertyLoader.setGoogleKey(key);
}
}
- private void processBackButton(){
+ private void processBackButton() {
if (asyncClient.getStartIndex() != 0) {
int i = Integer.parseInt(asyncClient.getMaxResults());
asyncClient.setStartIndex(asyncClient.getStartIndex() - i);
@@ -236,6 +238,7 @@
doSearch();
}
}
+
/**
* method keyTyped
* fires when user typing in TextField textBox
@@ -257,15 +260,15 @@
*/
private void showHelp() {
- JFrame frame= new JFrame();
+ JFrame frame = new JFrame();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- frame.setLocation(screenSize.width/5,
- screenSize.height/5);
- frame.setSize(screenSize.width/2,screenSize.height/2);
+ frame.setLocation(screenSize.width / 5,
+ screenSize.height / 5);
+ frame.setSize(screenSize.width / 2, screenSize.height / 2);
BorderLayout layout = new BorderLayout();
- JScrollPane jsp ;
+ JScrollPane jsp;
JEditorPane jep;
jep = new JEditorPane();
@@ -278,12 +281,12 @@
Container contentPane = frame.getContentPane();
contentPane.setLayout(layout);
contentPane.add(jsp, BorderLayout.CENTER);
- String helpDoc = System.getProperty("user.dir")+HELP_FILE_NAME;
+ String helpDoc = System.getProperty("user.dir") + HELP_FILE_NAME;
try {
jep.setPage(new File(helpDoc).toURL());
} catch (IOException e) {
- JOptionPane.showMessageDialog(null,"Help file not detected","Help file error",JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null, "Help file not detected", "Help file error", JOptionPane.ERROR_MESSAGE);
return;
}
frame.setVisible(true);
@@ -300,12 +303,12 @@
private void setMaxResults() {
String maxResults =
JOptionPane.showInputDialog(null,
- "Enter the number of maximum results per page (Maximum allowed is 10)",asyncClient.getMaxResults());
- if (maxResults==null){
+ "Enter the number of maximum results per page (Maximum allowed is 10)", asyncClient.getMaxResults());
+ if (maxResults == null) {
return;
- }else{
+ } else {
try {
- asyncClient.setMaxResults(Integer.parseInt(maxResults) +"");
+ asyncClient.setMaxResults(Integer.parseInt(maxResults) + "");
asyncClient.setPrevSearch("");
} catch (NumberFormatException e) {
return;
@@ -316,12 +319,12 @@
}
- private void doSearch(){
+ private void doSearch() {
new ClientThread().run();
}
- private class ClientThread implements Runnable{
+ private class ClientThread implements Runnable {
/**
* method run
* check the flag doSearch
@@ -330,7 +333,7 @@
public void run() {
if (!asyncClient.getSearch().equals(asyncClient.getPrevSearch())) {
asyncClient.setStartIndex(0);
- // return;
+ // return;
}
try {
asyncClient.sendMsg();
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/AsyncPanel.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/AsyncPanel.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/AsyncPanel.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/AsyncPanel.java Mon Jul 11 08:49:30 2005
@@ -1,35 +1,30 @@
package sample.google.spellcheck;
-import java.awt.Color;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
+import javax.swing.*;
+import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
/**
- * class sample.google.spellcheck.AsyncPanel
+ * class sample.google.spellcheck.AsyncPanel
* This Impements its own GUI of the Asynchronous Client and it updates the string after getting the response to textarea
- * @author Nadana Gunarathna
*
+ * @author Nadana Gunarathna
*/
-public class AsyncPanel extends javax.swing.JPanel implements Observer,KeyListener{
+public class AsyncPanel extends javax.swing.JPanel implements Observer, KeyListener {
FormModel formModel;
JTextArea writingTextArea;
JTextArea displayTextArea;
JTextField errorMessageField;
- public AsyncPanel()
- {
+
+ public AsyncPanel() {
GridBagLayout gbLayout = new GridBagLayout();
GridBagConstraints constraint = new GridBagConstraints();
this.setLayout(gbLayout);
- formModel = new FormModel(this);
+ formModel = new FormModel(this);
- writingTextArea = new JTextArea();
+ writingTextArea = new JTextArea();
writingTextArea.setLineWrap(true);
displayTextArea = new JTextArea();
@@ -48,22 +43,21 @@
writingTextArea.addKeyListener(this);
constraint.fill = GridBagConstraints.BOTH;
- constraint.gridx=0;
- constraint.weightx=1;
- constraint.weighty=8;
- gbLayout.setConstraints(scrollPaneGet,constraint);
+ constraint.gridx = 0;
+ constraint.weightx = 1;
+ constraint.weighty = 8;
+ gbLayout.setConstraints(scrollPaneGet, constraint);
this.add(scrollPaneGet);
- gbLayout.setConstraints(scrollPaneSet,constraint);
+ gbLayout.setConstraints(scrollPaneSet, constraint);
this.add(scrollPaneSet);
- constraint.weighty=1;
- gbLayout.setConstraints(errorMessageField,constraint);
+ constraint.weighty = 1;
+ gbLayout.setConstraints(errorMessageField, constraint);
this.add(errorMessageField);
}
- public void update(String message)
- {
+ public void update(String message) {
displayTextArea.setText(displayTextArea.getText() + " " + message);
}
@@ -74,11 +68,11 @@
public void keyPressed(KeyEvent e) {
- int key=e.getKeyChar();
- if((key==KeyEvent.VK_SPACE)||(key==KeyEvent.VK_ENTER)){
- String[] words=writingTextArea.getText().split("\\s");
+ int key = e.getKeyChar();
+ if ((key == KeyEvent.VK_SPACE) || (key == KeyEvent.VK_ENTER)) {
+ String[] words = writingTextArea.getText().split("\\s");
if (words.length > 0)
- formModel.doAsyncSpellingSuggestion(words[words.length-1]);
+ formModel.doAsyncSpellingSuggestion(words[words.length - 1]);
}
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java Mon Jul 11 08:49:30 2005
@@ -1,10 +1,5 @@
package sample.google.spellcheck;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.clientapi.AsyncResult;
@@ -17,50 +12,52 @@
import org.apache.axis2.soap.SOAPBody;
import org.apache.axis2.soap.SOAPEnvelope;
import org.apache.axis2.soap.SOAPFactory;
-
import sample.google.common.util.PropertyLoader;
+import javax.xml.namespace.QName;
+import java.net.MalformedURLException;
+import java.net.URL;
+
/**
- * class sample.google.spellcheck.FormModel
+ * class sample.google.spellcheck.FormModel
* This is the Impementation of the Asynchronous Client
- * @author Nadana Gunarathna
*
+ * @author Nadana Gunarathna
*/
public class FormModel {
Observer observer;
private static final String PROTOCOL = "http";
- public FormModel(Observer observer)
- {
+ public FormModel(Observer observer) {
this.observer = observer;
}
- private OMElement getElement(String word){
- SOAPFactory omfactory=OMAbstractFactory.getSOAP11Factory();
- OMNamespace opN = omfactory.createOMNamespace("urn:GoogleSearch","ns1");
- OMNamespace emptyNs=omfactory.createOMNamespace("", null);
+ private OMElement getElement(String word) {
+ SOAPFactory omfactory = OMAbstractFactory.getSOAP11Factory();
+ OMNamespace opN = omfactory.createOMNamespace("urn:GoogleSearch", "ns1");
+ OMNamespace emptyNs = omfactory.createOMNamespace("", null);
OMElement method = omfactory.createOMElement("doSpellingSuggestion", opN);
- method.declareNamespace("http://www.w3.org/1999/XMLSchema-instance","xsi");
- method.declareNamespace("http://www.w3.org/1999/XMLSchema","xsd");
+ method.declareNamespace("http://www.w3.org/1999/XMLSchema-instance", "xsi");
+ method.declareNamespace("http://www.w3.org/1999/XMLSchema", "xsd");
//reqEnv.getBody().addChild(method);
- method.addAttribute("soapenv:encodingStyle","http://schemas.xmlsoap.org/soap/encoding/",null);
- OMElement value1 = omfactory.createOMElement("key",emptyNs);
- OMElement value2=omfactory.createOMElement("phrase",emptyNs);
- value1.addAttribute("xsi:type","xsd:string",null);
- value2.addAttribute("xsi:type","xsd:string",null);
- value1.addChild(omfactory.createText(value1,PropertyLoader.getGoogleKey() ));
- value2.addChild(omfactory.createText(value2,word));
+ method.addAttribute("soapenv:encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/", null);
+ OMElement value1 = omfactory.createOMElement("key", emptyNs);
+ OMElement value2 = omfactory.createOMElement("phrase", emptyNs);
+ value1.addAttribute("xsi:type", "xsd:string", null);
+ value2.addAttribute("xsi:type", "xsd:string", null);
+ value1.addChild(omfactory.createText(value1, PropertyLoader.getGoogleKey()));
+ value2.addChild(omfactory.createText(value2, word));
- method.addChild(value1);method.addChild(value2);
+ method.addChild(value1);
+ method.addChild(value2);
return method;
}
- public void doAsyncSpellingSuggestion(String word)
- {
+ public void doAsyncSpellingSuggestion(String word) {
OMElement requestElement = getElement(word);
Call call = null;
try {
@@ -70,23 +67,24 @@
}
URL url = null;
try {
- url = new URL(PROTOCOL,PropertyLoader.getGoogleEndpointURL(),PropertyLoader.getGoogleEndpointServiceName());
+ url = new URL(PROTOCOL, PropertyLoader.getGoogleEndpointURL(), PropertyLoader.getGoogleEndpointServiceName());
//url=new URL( "http","127.0.0.1",7070,"/search/beta2");
} catch (MalformedURLException e) {
- observer.updateError(e.getMessage());;
+ observer.updateError(e.getMessage());
+ ;
}
call.setTo(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
try {
- call.invokeNonBlocking("doGoogleSpellingSugg",requestElement,new GoogleCallBack(word));
+ call.invokeNonBlocking("doGoogleSpellingSugg", requestElement, new GoogleCallBack(word));
} catch (AxisFault axisFault) {
observer.updateError(axisFault.getMessage());
}
}
- public void doSyncSpellingSuggestion(String word)
- {
- OMElement responseElement=null;
+
+ public void doSyncSpellingSuggestion(String word) {
+ OMElement responseElement = null;
OMElement requestElement = getElement(word);
Call call = null;
try {
@@ -96,7 +94,7 @@
}
URL url = null;
try {
- url = new URL(PROTOCOL,PropertyLoader.getGoogleEndpointURL(),PropertyLoader.getGoogleEndpointServiceName());
+ url = new URL(PROTOCOL, PropertyLoader.getGoogleEndpointURL(), PropertyLoader.getGoogleEndpointServiceName());
//url=new URL( "http","127.0.0.1",7070,"/search/beta2");
} catch (MalformedURLException e) {
observer.updateError(e.getMessage());
@@ -104,7 +102,7 @@
call.setTo(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
try {
- responseElement=(OMElement)call.invokeBlocking("doGoogleSpellingSugg",requestElement);
+ responseElement = (OMElement) call.invokeBlocking("doGoogleSpellingSugg", requestElement);
} catch (AxisFault axisFault) {
observer.updateError(axisFault.getMessage());
}
@@ -113,7 +111,7 @@
this.getResponseFromElement(responseElement);
}
- public String getResponseFromElement(OMElement responseElement){
+ public String getResponseFromElement(OMElement responseElement) {
OMElement val = responseElement.getFirstElement();
String sugession = val.getText();
@@ -122,48 +120,49 @@
}
- public String getResponse(SOAPEnvelope responseEnvelope){
+ public String getResponse(SOAPEnvelope responseEnvelope) {
QName qName1 = new QName("urn:GoogleSearch", "doSpellingSuggestionResponse");
QName qName2 = new QName("urn:GoogleSearch", "return");
-
+
SOAPBody body = responseEnvelope.getBody();
if (body.hasFault()) {
observer.updateError(body.getFault().getException().getMessage());
- return null;
- } else{
+ return null;
+ } else {
OMElement root = body.getFirstChildWithName(qName1);
- OMElement val =null;
- if (root!=null){
+ OMElement val = null;
+ if (root != null) {
// val = root.getFirstChildWithName(qName2);
val = root.getFirstElement();
- }else{
+ } else {
observer.updateError("Correct response not received!");
- return null;
+ return null;
}
String sugession = val.getText();
- if ((sugession==null) ||(sugession.trim().equals(""))){
+ if ((sugession == null) || (sugession.trim().equals(""))) {
return null;
- }else{
+ } else {
return sugession;
}
}
}
- private class GoogleCallBack extends Callback{
+ private class GoogleCallBack extends Callback {
private String originalWord;
+
public GoogleCallBack(String originalWord) {
this.originalWord = originalWord;
}
public void onComplete(AsyncResult result) {
String suggestion = getResponse(result.getResponseEnvelope());
- if (suggestion==null){
+ if (suggestion == null) {
observer.update(originalWord);
- observer.updateError("No suggestions found for "+originalWord);
- }else{
+ observer.updateError("No suggestions found for " + originalWord);
+ } else {
observer.update(suggestion);
}
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/Observer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/Observer.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/Observer.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/Observer.java Mon Jul 11 08:49:30 2005
@@ -2,9 +2,9 @@
/**
- * interface sample.google.spellcheck.Observer
- * @author Nadana Gunarathna
+ * interface sample.google.spellcheck.Observer
*
+ * @author Nadana Gunarathna
*/
public interface Observer {
// updates the message to the main test display area
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/SuggestionForm.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/SuggestionForm.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/SuggestionForm.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/SuggestionForm.java Mon Jul 11 08:49:30 2005
@@ -1,31 +1,17 @@
package sample.google.spellcheck;
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.awt.HeadlessException;
-import java.awt.Toolkit;
+import sample.google.common.util.PropertyLoader;
+
+import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.IOException;
-import javax.swing.JEditorPane;
-import javax.swing.JFrame;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.JScrollPane;
-import javax.swing.KeyStroke;
-import javax.swing.WindowConstants;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-
-import sample.google.common.util.PropertyLoader;
-
/**
* class sample.google.spellcheck.SuggestionForm
* This is the implementation of the GUI
@@ -119,7 +105,7 @@
SuggestionForm form = new SuggestionForm();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
form.setLocation(screenSize.width / 4,
- screenSize.height / 4);
+ screenSize.height / 4);
form.setSize(screenSize.width / 2, screenSize.height / 2);
form.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
//form.setResizable(false);
@@ -150,7 +136,7 @@
private void setKey() {
String key = JOptionPane.showInputDialog(this, "Set the Google Key",
- PropertyLoader.getGoogleKey());
+ PropertyLoader.getGoogleKey());
if (key != null && !key.trim().equals("")) {
PropertyLoader.setGoogleKey(key);
}
@@ -164,7 +150,7 @@
JFrame frame = new JFrame();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation(screenSize.width / 5,
- screenSize.height / 5);
+ screenSize.height / 5);
frame.setSize(screenSize.width / 2, screenSize.height / 2);
BorderLayout layout = new BorderLayout();
@@ -188,7 +174,7 @@
helpDisplayPane.setPage(new File(helpDoc).toURL());
} catch (IOException e) {
JOptionPane.showMessageDialog(this, "Help file not detected", "Help file error",
- JOptionPane.ERROR_MESSAGE);
+ JOptionPane.ERROR_MESSAGE);
return;
}
frame.setVisible(true);
@@ -203,7 +189,7 @@
//
} catch (Exception err) {
JOptionPane.showMessageDialog(this, "Help file not detected", err.getMessage(),
- JOptionPane.ERROR_MESSAGE);
+ JOptionPane.ERROR_MESSAGE);
return;
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/SyncPanel.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/SyncPanel.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/SyncPanel.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/google/spellcheck/SyncPanel.java Mon Jul 11 08:49:30 2005
@@ -1,31 +1,24 @@
package sample.google.spellcheck;
-import java.awt.Color;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
+import javax.swing.*;
+import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import javax.swing.JButton;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
/**
- * class sample.google.spellcheck.SyncPanel
+ * class sample.google.spellcheck.SyncPanel
* This Impements its own GUI of the Synchronous Client and it send the SOAP request after the mouse event.
- * @author Nadana Gunarathna
*
+ * @author Nadana Gunarathna
*/
-public class SyncPanel extends javax.swing.JPanel implements Observer, ActionListener{
+public class SyncPanel extends javax.swing.JPanel implements Observer, ActionListener {
FormModel formModel;
JTextArea writingTextArea;
JTextArea displayTextArea;
JTextField errorMessageField;
JButton sendButton;
- public SyncPanel()
- {
+ public SyncPanel() {
GridBagLayout gbLayout = new GridBagLayout();
GridBagConstraints constraint = new GridBagConstraints();
@@ -34,7 +27,7 @@
// layout.setRows(3);
this.setLayout(gbLayout);
- formModel = new FormModel(this);
+ formModel = new FormModel(this);
writingTextArea = new javax.swing.JTextArea();
writingTextArea.setLineWrap(true);
@@ -47,40 +40,40 @@
errorMessageField.setBackground(Color.LIGHT_GRAY);
errorMessageField.setForeground(Color.RED);
- sendButton=new javax.swing.JButton("Send");
+ sendButton = new javax.swing.JButton("Send");
JScrollPane scrollPaneget = new JScrollPane(writingTextArea);
JScrollPane scrollPaneset = new JScrollPane(displayTextArea);
writingTextArea.setText("Enter a String");
constraint.fill = GridBagConstraints.BOTH;
- constraint.gridx=0;
- constraint.weightx=1;
- constraint.weighty=8;
- gbLayout.setConstraints(scrollPaneget,constraint);
+ constraint.gridx = 0;
+ constraint.weightx = 1;
+ constraint.weighty = 8;
+ gbLayout.setConstraints(scrollPaneget, constraint);
this.add(scrollPaneget);
- gbLayout.setConstraints(scrollPaneset,constraint);
+ gbLayout.setConstraints(scrollPaneset, constraint);
this.add(scrollPaneset);
- constraint.weighty=1;
- gbLayout.setConstraints(sendButton,constraint);
+ constraint.weighty = 1;
+ gbLayout.setConstraints(sendButton, constraint);
this.add(sendButton);
- gbLayout.setConstraints(errorMessageField,constraint);
+ gbLayout.setConstraints(errorMessageField, constraint);
this.add(errorMessageField);
sendButton.addActionListener(this);
}
- public void update(String suggestion)
- {
+
+ public void update(String suggestion) {
displayTextArea.setText(suggestion);
}
//updates the error message to the error message display area
public void updateError(String message) {
- errorMessageField.setText(message);
+ errorMessageField.setText(message);
}
public void actionPerformed(ActionEvent e) {
- String str=writingTextArea.getText().trim();
+ String str = writingTextArea.getText().trim();
formModel.doSyncSpellingSuggestion(str);
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/mtom/MTOMService.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/mtom/MTOMService.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/mtom/MTOMService.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/mtom/MTOMService.java Mon Jul 11 08:49:30 2005
@@ -15,41 +15,37 @@
*/
package sample.mtom;
-import java.awt.Image;
-import java.io.FileOutputStream;
+import org.apache.axis2.attachments.JDK13IO;
+import org.apache.axis2.om.*;
import javax.activation.DataHandler;
+import java.awt.*;
+import java.io.FileOutputStream;
-import org.apache.axis2.attachments.JDK13IO;
-import org.apache.axis2.om.OMAbstractFactory;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMFactory;
-import org.apache.axis2.om.OMNamespace;
-import org.apache.axis2.om.OMText;
/**
* @author <a href="mailto:thilina@opensource.lk">Thilina Gunarathne </a>
*/
public class MTOMService {
- public OMElement mtomSample(OMElement element) throws Exception {
- OMElement imageEle = element.getFirstElement();
- System.out.println(imageEle.getLocalName());
- OMElement imageName = (OMElement) imageEle.getNextSibling();
- System.out.println(imageName.getLocalName());
- OMText binaryNode = (OMText) imageEle.getFirstChild();
- String fileName = imageName.getText();
- //Extracting the data and saving
- DataHandler actualDH;
- actualDH = binaryNode.getDataHandler();
- Image actualObject = new JDK13IO().loadImage(actualDH.getDataSource()
- .getInputStream());
- FileOutputStream imageOutStream = new FileOutputStream(fileName);
- new JDK13IO().saveImage("image/jpeg", actualObject, imageOutStream);
-
- //setting response
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMNamespace ns = fac.createOMNamespace("urn://fakenamespace", "ns");
- OMElement ele = fac.createOMElement("response", ns);
- ele.setText("Image Saved");
- return ele;
- }
+ public OMElement mtomSample(OMElement element) throws Exception {
+ OMElement imageEle = element.getFirstElement();
+ System.out.println(imageEle.getLocalName());
+ OMElement imageName = (OMElement) imageEle.getNextSibling();
+ System.out.println(imageName.getLocalName());
+ OMText binaryNode = (OMText) imageEle.getFirstChild();
+ String fileName = imageName.getText();
+ //Extracting the data and saving
+ DataHandler actualDH;
+ actualDH = binaryNode.getDataHandler();
+ Image actualObject = new JDK13IO().loadImage(actualDH.getDataSource()
+ .getInputStream());
+ FileOutputStream imageOutStream = new FileOutputStream(fileName);
+ new JDK13IO().saveImage("image/jpeg", actualObject, imageOutStream);
+
+ //setting response
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = fac.createOMNamespace("urn://fakenamespace", "ns");
+ OMElement ele = fac.createOMElement("response", ns);
+ ele.setText("Image Saved");
+ return ele;
+ }
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/MTOMClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/MTOMClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/MTOMClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/MTOMClient.java Mon Jul 11 08:49:30 2005
@@ -15,14 +15,10 @@
*/
package sample.mtom.client;
-import java.awt.Dimension;
-import java.awt.HeadlessException;
-import java.awt.Toolkit;
+import javax.swing.*;
+import java.awt.*;
-import javax.swing.JFrame;
-import javax.swing.WindowConstants;
-
-public class MTOMClient extends JFrame{
+public class MTOMClient extends JFrame {
public MTOMClient(String title) throws HeadlessException {
super(title);
@@ -35,7 +31,7 @@
MTOMClient form = new MTOMClient("MTOM Sample Client");
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
form.setLocation(screenSize.width / 4 - 20,
- screenSize.height / 4);
+ screenSize.height / 4);
form.setSize(screenSize.width / 2 - 80, screenSize.height / 2);
form.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
form.show();
Modified: webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/MTOMClientModel.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/MTOMClientModel.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/MTOMClientModel.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/MTOMClientModel.java Mon Jul 11 08:49:30 2005
@@ -22,7 +22,6 @@
import org.apache.axis2.attachments.JDK13IO;
import org.apache.axis2.clientapi.Call;
import org.apache.axis2.om.*;
-import org.apache.axis2.om.impl.llom.OMTextImpl;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
@@ -35,7 +34,7 @@
private File inputFile = null;
private EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis2/services/MyService");
+ "http://127.0.0.1:8080/axis2/services/MyService");
private QName operationName = new QName("mtomSample");
@@ -57,7 +56,7 @@
.loadImage(new FileInputStream(inputFile));
ImageDataSource dataSource = new ImageDataSource("test.jpg",
- expectedImage);
+ expectedImage);
expectedDH = new DataHandler(dataSource);
OMText textData = fac.createText(expectedDH, true);
image.addChild(textData);
@@ -82,9 +81,9 @@
// enabling MTOM in the client side
call.set(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
call.setTransportInfo(Constants.TRANSPORT_HTTP,
- Constants.TRANSPORT_HTTP, false);
+ Constants.TRANSPORT_HTTP, false);
OMElement result = (OMElement) call.invokeBlocking(operationName
- .getLocalPart(), payload);
+ .getLocalPart(), payload);
return result;
}
@@ -92,7 +91,7 @@
public void setTargetEPR(String targetEPR) {
this.targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
- targetEPR);
+ targetEPR);
}
Modified: webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/UserInterface.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/UserInterface.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/UserInterface.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/sample/mtom/client/UserInterface.java Mon Jul 11 08:49:30 2005
@@ -26,178 +26,178 @@
public class UserInterface extends JPanel implements ActionListener {
- JButton browse;
+ JButton browse;
- JButton send;
+ JButton send;
- JTextArea jTextArea;
+ JTextArea jTextArea;
- JFileChooser jFileChooser;
+ JFileChooser jFileChooser;
- File file = null;
+ File file = null;
- JTextField EPR;
+ JTextField EPR;
- JTextField fileName;
+ JTextField fileName;
- JTextField fileFeild;
+ JTextField fileFeild;
- JLabel label;
+ JLabel label;
- JLabel savefile;
+ JLabel savefile;
- private String deriredFileName = null;
+ private String deriredFileName = null;
- private String EPRName = null;
+ private String EPRName = null;
- private MTOMClient parent;
+ private MTOMClient parent;
- public UserInterface(MTOMClient parent) {
- this.parent = parent;
- EPR = new JTextField();
- fileFeild = new JTextField();
- fileName = new JTextField();
- label = new JLabel("END Point:");
- savefile = new JLabel("Desired File Name:");
- jTextArea = new JTextArea(5, 5);
- jTextArea.setPreferredSize(new Dimension(200, 100));
+ public UserInterface(MTOMClient parent) {
+ this.parent = parent;
+ EPR = new JTextField();
+ fileFeild = new JTextField();
+ fileName = new JTextField();
+ label = new JLabel("END Point:");
+ savefile = new JLabel("Desired File Name:");
+ jTextArea = new JTextArea(5, 5);
+ jTextArea.setPreferredSize(new Dimension(200, 100));
- jFileChooser = new JFileChooser();
- jFileChooser.addChoosableFileFilter(new ImageFilter());
- jFileChooser.setAcceptAllFileFilterUsed(false);
- jFileChooser.setName("Image Chosser");
- this.browse = new JButton("Browse");
- this.send = new JButton("Send The Image");
- fileFeild.setBounds(20, 20, 270, 20);
- browse.setBounds(300, 20, 120, 20);
- savefile.setBounds(20, 60, 200, 20);
- fileName.setBounds(150, 60, 270, 20);
+ jFileChooser = new JFileChooser();
+ jFileChooser.addChoosableFileFilter(new ImageFilter());
+ jFileChooser.setAcceptAllFileFilterUsed(false);
+ jFileChooser.setName("Image Chosser");
+ this.browse = new JButton("Browse");
+ this.send = new JButton("Send The Image");
+ fileFeild.setBounds(20, 20, 270, 20);
+ browse.setBounds(300, 20, 120, 20);
+ savefile.setBounds(20, 60, 200, 20);
+ fileName.setBounds(150, 60, 270, 20);
- label.setBounds(20, 90, 200, 20);
- EPR.setBounds(150, 90, 270, 20);
+ label.setBounds(20, 90, 200, 20);
+ EPR.setBounds(150, 90, 270, 20);
- EPR.setText("http://127.0.0.1:8080/axis2/services/MTOMService");
+ EPR.setText("http://127.0.0.1:8080/axis2/services/MTOMService");
- send.setBounds(140, 120, 150, 20);
+ send.setBounds(140, 120, 150, 20);
- jTextArea.setBounds(20, 150, 400, 180);
+ jTextArea.setBounds(20, 150, 400, 180);
- browse.addActionListener(this);
- send.addActionListener(this);
+ browse.addActionListener(this);
+ send.addActionListener(this);
- Container pane = parent.getContentPane();
- this.setLayout(null);
+ Container pane = parent.getContentPane();
+ this.setLayout(null);
- pane.add(browse);
+ pane.add(browse);
- pane.add(send);
- pane.add(jTextArea);
- pane.add(EPR);
- pane.add(fileFeild);
- pane.add(label);
- pane.add(savefile);
- pane.add(fileName);
+ pane.add(send);
+ pane.add(jTextArea);
+ pane.add(EPR);
+ pane.add(fileFeild);
+ pane.add(label);
+ pane.add(savefile);
+ pane.add(fileName);
- }
+ }
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(ActionEvent e) {
- if (e.getSource() == browse) {
+ if (e.getSource() == browse) {
- int returnVal = jFileChooser.showDialog(this, "Choose the Image to Send");
+ int returnVal = jFileChooser.showDialog(this, "Choose the Image to Send");
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- file = jFileChooser.getSelectedFile();
- if (file.getAbsolutePath() != null) {
- fileFeild.setText(file.getAbsolutePath());
- }
- } else {
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ file = jFileChooser.getSelectedFile();
+ if (file.getAbsolutePath() != null) {
+ fileFeild.setText(file.getAbsolutePath());
+ }
+ } else {
- }
+ }
- jFileChooser.setSelectedFile(null);
+ jFileChooser.setSelectedFile(null);
- }
- if (e.getSource() == send) {
- if (fileName.getText() != null) {
- deriredFileName = fileName.getText();
- }
- if (file == null) {
- JOptionPane.showMessageDialog(parent,
- "Attachments should not be null.", " error",
- JOptionPane.ERROR_MESSAGE);
+ }
+ if (e.getSource() == send) {
+ if (fileName.getText() != null) {
+ deriredFileName = fileName.getText();
+ }
+ if (file == null) {
+ JOptionPane.showMessageDialog(parent,
+ "Attachments should not be null.", " error",
+ JOptionPane.ERROR_MESSAGE);
- } else if (("").equals(EPR.getText())) {
- JOptionPane.showMessageDialog(parent, "END Point null",
- " error", JOptionPane.ERROR_MESSAGE);
+ } else if (("").equals(EPR.getText())) {
+ JOptionPane.showMessageDialog(parent, "END Point null",
+ " error", JOptionPane.ERROR_MESSAGE);
- } else {
- EPRName = EPR.getText();
- this.send(deriredFileName);
- }
+ } else {
+ EPRName = EPR.getText();
+ this.send(deriredFileName);
+ }
- }
- }
+ }
+ }
- public void send(String fileName) {
+ public void send(String fileName) {
- MTOMClientModel mtomTest = new MTOMClientModel();
+ MTOMClientModel mtomTest = new MTOMClientModel();
- try {
- mtomTest.setInputFile(file);
- mtomTest.setTargetEPR(EPRName);
- OMElement result = (OMElement) mtomTest.testEchoXMLSync(fileName);
- jTextArea.setText(result.toString());
- JOptionPane.showMessageDialog(parent, "Sent & saved Image Succesfully",
- " Success", JOptionPane.PLAIN_MESSAGE);
- } catch (Exception e) {
- e.printStackTrace(); //To change body of catch statement use File |
- // Settings | File Templates.
- }
+ try {
+ mtomTest.setInputFile(file);
+ mtomTest.setTargetEPR(EPRName);
+ OMElement result = (OMElement) mtomTest.testEchoXMLSync(fileName);
+ jTextArea.setText(result.toString());
+ JOptionPane.showMessageDialog(parent, "Sent & saved Image Succesfully",
+ " Success", JOptionPane.PLAIN_MESSAGE);
+ } catch (Exception e) {
+ e.printStackTrace(); //To change body of catch statement use File |
+ // Settings | File Templates.
+ }
- }
+ }
- class ImageFilter extends FileFilter {
+ class ImageFilter extends FileFilter {
- //Accept all directories and all gif, jpg, tiff, or png files.
- public boolean accept(File f) {
- if (f.isDirectory()) {
- return true;
- }
+ //Accept all directories and all gif, jpg, tiff, or png files.
+ public boolean accept(File f) {
+ if (f.isDirectory()) {
+ return true;
+ }
- String extension = getExtension(f);
- if (extension != null) {
- if (extension.equals("jpg") || extension.equals("JPEG"))
- return true;
- else {
- return false;
- }
- }
+ String extension = getExtension(f);
+ if (extension != null) {
+ if (extension.equals("jpg") || extension.equals("JPEG"))
+ return true;
+ else {
+ return false;
+ }
+ }
- return false;
- }
+ return false;
+ }
- public String getDescription() {
- return null; //To change body of implemented methods use File |
- // Settings | File Templates.
- }
+ public String getDescription() {
+ return null; //To change body of implemented methods use File |
+ // Settings | File Templates.
+ }
- private String getExtension(File f) {
- String ext = null;
- String s = f.getName();
- int i = s.lastIndexOf('.');
+ private String getExtension(File f) {
+ String ext = null;
+ String s = f.getName();
+ int i = s.lastIndexOf('.');
- if (i > 0 && i < s.length() - 1) {
- ext = s.substring(i + 1).toLowerCase();
- }
- return ext;
- }
+ if (i > 0 && i < s.length() - 1) {
+ ext = s.substring(i + 1).toLowerCase();
+ }
+ return ext;
+ }
- }
+ }
- //The description of this filter
- public String getDescription() {
- return "Just Images";
- }
+ //The description of this filter
+ public String getDescription() {
+ return "Just Images";
+ }
}
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java Mon Jul 11 08:49:30 2005
@@ -30,7 +30,7 @@
public class ClientForWebServiceWithModule {
private static EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis2/services/MyServiceWithModule/echo");
+ "http://127.0.0.1:8080/axis2/services/MyServiceWithModule/echo");
public static void main(String[] args) {
try {
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/clients/ClientUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/clients/ClientUtil.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/clients/ClientUtil.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/clients/ClientUtil.java Mon Jul 11 08:49:30 2005
@@ -1,4 +1,3 @@
-
package userguide.clients;
import org.apache.axis2.om.OMAbstractFactory;
@@ -25,8 +24,8 @@
public class ClientUtil {
- public static OMElement getEchoOMElement(){
- OMFactory fac = OMAbstractFactory.getOMFactory();
+ public static OMElement getEchoOMElement() {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://example1.org/example1", "example1");
OMElement method = fac.createOMElement("echo", omNs);
OMElement value = fac.createOMElement("Text", omNs);
@@ -34,8 +33,9 @@
method.addChild(value);
return method;
- }
- public static OMElement getPingOMElement(){
+ }
+
+ public static OMElement getPingOMElement() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://example1.org/example1", "example1");
OMElement method = fac.createOMElement("ping", omNs);
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java Mon Jul 11 08:49:30 2005
@@ -30,7 +30,7 @@
public class EchoBlockingClient {
private static EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis2/services/MyService/echo");
+ "http://127.0.0.1:8080/axis2/services/MyService/echo");
public static void main(String[] args) {
try {
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java Mon Jul 11 08:49:30 2005
@@ -20,7 +20,7 @@
*/
public class EchoBlockingDualClient {
private static EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis2/services/MyService/echo");
+ "http://127.0.0.1:8080/axis2/services/MyService/echo");
public static void main(String[] args) {
try {
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java Mon Jul 11 08:49:30 2005
@@ -22,7 +22,7 @@
*/
public class EchoNonBlockingClient {
private static EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis2/services/MyService/echo");
+ "http://127.0.0.1:8080/axis2/services/MyService/echo");
public static void main(String[] args) {
try {
@@ -37,8 +37,7 @@
public void onComplete(AsyncResult result) {
try {
StringWriter writer = new StringWriter();
- result.getResponseEnvelope().serializeWithCache(new OMOutput(
- XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
+ result.getResponseEnvelope().serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
writer.flush();
System.out.println(writer.toString());
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java Mon Jul 11 08:49:30 2005
@@ -23,7 +23,7 @@
*/
public class EchoNonBlockingDualClient {
private static EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis2/services/MyService/echo");
+ "http://127.0.0.1:8080/axis2/services/MyService/echo");
public static void main(String[] args) {
try {
@@ -42,8 +42,7 @@
public void onComplete(AsyncResult result) {
try {
StringWriter writer = new StringWriter();
- result.getResponseEnvelope().serializeWithCache(
- new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
+ result.getResponseEnvelope().serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
writer.flush();
System.out.println(writer.toString());
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/clients/MailClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/clients/MailClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/clients/MailClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/clients/MailClient.java Mon Jul 11 08:49:30 2005
@@ -26,7 +26,7 @@
import org.apache.axis2.om.OMNamespace;
/**
- * This is a Client progam that accesses 'MyService' web service in Axis2 samples
+ * This is a Client progam that accesses 'MyService' web service in Axis2 samples
*/
public class MailClient {
Modified: webservices/axis/trunk/java/modules/samples/src/userguide/clients/PingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/userguide/clients/PingClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/userguide/clients/PingClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/userguide/clients/PingClient.java Mon Jul 11 08:49:30 2005
@@ -15,7 +15,7 @@
*/
public class PingClient {
private static EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:8080/axis2/services/MyService/ping");
+ "http://127.0.0.1:8080/axis2/services/MyService/ping");
public static void main(String[] args) {
try {