index
int64
0
0
repo_id
stringlengths
9
205
file_path
stringlengths
31
246
content
stringlengths
1
12.2M
__index_level_0__
int64
0
10k
0
Create_ds/heap-dump-tool/src/main/java/com/paypal/heapdumptool
Create_ds/heap-dump-tool/src/main/java/com/paypal/heapdumptool/cli/CliCommand.java
package com.paypal.heapdumptool.cli; import java.util.concurrent.Callable; public interface CliCommand extends Callable<Boolean> { @Override default Boolean call() throws Exception { return CliBootstrap.runCommand(this); } Class<? extends CliCommandProcessor> getProcessorClass(); }
6,400
0
Create_ds/heap-dump-tool/src/main/java/com/paypal/heapdumptool
Create_ds/heap-dump-tool/src/main/java/com/paypal/heapdumptool/cli/CliCommandProcessor.java
package com.paypal.heapdumptool.cli; public interface CliCommandProcessor { void process() throws Exception; }
6,401
0
Create_ds/axis-axis1-java/axis-testutils/src/main/java
Create_ds/axis-axis1-java/axis-testutils/src/main/java/test/AxisTestBase.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test; import org.custommonkey.xmlunit.XMLTestCase; /** * base test class for Axis test cases. * @author steve loughran */ public abstract class AxisTestBase extends XMLTestCase { public AxisTestBase(String s) { super(s); } /** * probe for a property being set in ant terms. * @param propertyname * @return true if the system property is set and set to true or yes */ public static boolean isPropertyTrue(String propertyname) { String setting = System.getProperty(propertyname); return "true".equalsIgnoreCase(setting) || "yes".equalsIgnoreCase(setting); } /** * test for the online tests being enabled * @return true if 'online' tests are allowed. */ public static boolean isOnline() { return isPropertyTrue("test.functional.online"); } }
6,402
0
Create_ds/axis-axis1-java/axis-testutils/src/main/java
Create_ds/axis-axis1-java/axis-testutils/src/main/java/test/AxisFileGenTestBase.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test; import java.io.File; import java.io.IOException; import java.util.Set; import java.util.HashSet; import java.util.Arrays; import java.util.Vector; /** * base class for Axis FileGen test cases. */ public abstract class AxisFileGenTestBase extends AxisTestBase { public AxisFileGenTestBase(String s) { super(s); } protected String getPrefix(String parent) { if (parent == null || parent.length() == 0) { return ""; } else { return parent + File.separator; } } /** * List of files which may or may not be generated. May be overridden by * subclasses. */ protected Set mayExist() { HashSet set = new HashSet(); return set; } abstract protected String rootDir(); abstract protected Set shouldExist(); /** This method returns a array of String file paths, located within the * supplied root directory. The string values are created relative to the * specified parent so that the names get returned in the form of * "file.java", "dir/file.java", "dir/dir/file.java", etc. This feature * asslows the various file specs to include files in sub-directories as * well as the root directory. */ protected String[] getPaths(File root, String parent) { File files[] = root.listFiles(); if (files == null) fail("Unable to get a list of files from " + root.getPath()); Set filePaths = new HashSet(); for(int i=0; i<files.length; i++) { if (files[i].isDirectory()) { String children[] = getPaths(files[i], getPrefix(parent) + files[i].getName()); filePaths.addAll(Arrays.asList(children)); } else { filePaths.add(getPrefix(parent) + files[i].getName()); } } String paths[] = new String[filePaths.size()]; return (String[]) filePaths.toArray(paths); } public void testFileGen() throws IOException { String rootDir = rootDir(); Set shouldExist = shouldExist(); Set mayExist = mayExist(); // open up the output directory and check what files exist. File outputDir = new File(rootDir); String[] files = getPaths(outputDir, null); Vector shouldNotExist = new Vector(); for (int i = 0; i < files.length; ++i) { if (shouldExist.contains(files[i])) { shouldExist.remove(files[i]); } else if (mayExist.contains(files[i])) { mayExist.remove(files[i]); } else { shouldNotExist.add(files[i]); } } if (shouldExist.size() > 0) { fail("The following files should exist in " + rootDir + ", but do not: " + shouldExist); } if (shouldNotExist.size() > 0) { fail("The following files should NOT exist in " + rootDir + ", but do: " + shouldNotExist); } } }
6,403
0
Create_ds/axis-axis1-java/soapmonitor-client/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/soapmonitor-client/src/main/java/org/apache/axis/utils/SOAPMonitor.java
/* * Copyright 2001,2004 The Apache Software Foundation. * * Licensed under the Apache Liusercense, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.axis.utils; import org.apache.axis.client.AdminClient; import org.apache.axis.monitor.SOAPMonitorConstants; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JProgressBar; import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.ListSelectionModel; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.WindowConstants; import javax.swing.border.BevelBorder; import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.AbstractTableModel; import javax.swing.event.ChangeListener; import javax.xml.parsers.ParserConfigurationException; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.lang.reflect.InvocationTargetException; import java.net.Socket; import java.net.URL; import java.net.MalformedURLException; import java.text.DateFormat; import java.util.Collection; import java.util.Date; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.Vector; /** * This is a SOAP Monitor Application class. This class provides * the user interface for deploying the SOAP monitor service and * displaying data from the service. * * @author Toshiyuki Kimura (toshi@apache.org) * @author Brian Price (pricebe@us.ibm.com) */ public class SOAPMonitor extends JFrame implements ActionListener, ChangeListener { /** * Private data */ private JPanel main_panel = null; /** * Field tabbed_pane */ private JTabbedPane tabbed_pane = null; /** * Field top_pane */ private JTabbedPane top_pane = null; /** * Field port */ private int port = 5001; /** * Field axisHost */ private String axisHost = "localhost"; /** * Field axisPort */ private int axisPort = 8080; /** * Field axisURL */ private String axisURL = null; /** * Field pages */ private Vector pages = null; /** * Field titleStr */ private final String titleStr = "SOAP Monitor Administration"; /** * Field set_panel */ private JPanel set_panel = null; /** * Field titleLabel */ private JLabel titleLabel = null; /** * Field add_btn */ private JButton add_btn = null; /** * Field del_btn */ private JButton del_btn = null; /** * Field save_btn */ private JButton save_btn = null; /** * Field login_btn */ private JButton login_btn = null; /** * Field model1 */ private DefaultListModel model1 = null; /** * Field model2 */ private DefaultListModel model2 = null; /** * Field list1 */ private JList list1 = null; /** * Field list2 */ private JList list2 = null; /** * Field serviceMap */ private HashMap serviceMap = null; /** * Field originalDoc */ private Document originalDoc = null; /** * Field axisUser */ private static String axisUser = null; /** * Field axisPass */ private static String axisPass = null; /** * Field adminClient */ private AdminClient adminClient = new AdminClient(); /** * Main method for this class * * @param args * @throws Exception */ public static void main(String args[]) throws Exception { SOAPMonitor soapMonitor = null; Options opts = new Options(args); if (opts.isFlagSet('?') > 0) { System.out.println( "Usage: SOAPMonitor [-l<url>] [-u<user>] [-w<password>] [-?]"); System.exit(0); } // Create an instance soapMonitor = new SOAPMonitor(); // GET Axis URL. // The default is "http://localhost:8080/axis/servlet/AxisServlet" soapMonitor.axisURL = opts.getURL(); URL url = new URL(soapMonitor.axisURL); soapMonitor.axisHost = url.getHost(); // GET User name & Password axisUser = opts.getUser(); axisPass = opts.getPassword(); // Login and start application soapMonitor.doLogin(); } /** * Constructor */ public SOAPMonitor() { setTitle("SOAP Monitor Application"); Dimension d = getToolkit().getScreenSize(); setSize(640, 480); setLocation((d.width - getWidth()) / 2, (d.height - getHeight()) / 2); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); addWindowListener(new MyWindowAdapter()); // Try to use the system look and feel try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } // Create main panel to hold notebook main_panel = new JPanel(); main_panel.setBackground(Color.white); main_panel.setLayout(new BorderLayout()); top_pane = new JTabbedPane(); set_panel = new JPanel(); // label for NORTH panel to display the pain title titleLabel = new JLabel(titleStr); titleLabel.setFont(new Font("Serif", Font.BOLD, 18)); // list control for WEST panel to list NOT monitored services model1 = new DefaultListModel(); list1 = new JList(model1); list1.setFixedCellWidth(250); JScrollPane scroll1 = new JScrollPane(list1); // list control for EAST panel to list monitored services model2 = new DefaultListModel(); list2 = new JList(model2); list2.setFixedCellWidth(250); JScrollPane scroll2 = new JScrollPane(list2); // buttons for CENTER panel to chage the monitoring state add_btn = new JButton("Turn On [ >> ]"); del_btn = new JButton("[ << ] Turn Off"); JPanel center_panel = new JPanel(); GridBagLayout layout = new GridBagLayout(); center_panel.setLayout(layout); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.insets = new Insets(10, 10, 10, 10); layout.setConstraints(add_btn, c); center_panel.add(add_btn); c.gridx = 0; c.gridy = 1; c.insets = new Insets(10, 10, 10, 10); layout.setConstraints(del_btn, c); center_panel.add(del_btn); // buttons for SOUTH panel save_btn = new JButton("Save changes"); login_btn = new JButton("Change server"); JPanel south_panel = new JPanel(); layout = new GridBagLayout(); c.gridx = 0; c.gridy = 0; c.insets = new Insets(10, 10, 10, 10); layout.setConstraints(save_btn, c); south_panel.add(save_btn); c.gridx = 1; c.gridy = 0; c.insets = new Insets(10, 10, 10, 10); layout.setConstraints(login_btn, c); south_panel.add(login_btn); // set all controls to the border layout set_panel.setLayout(new BorderLayout(5, 5)); set_panel.add(titleLabel, BorderLayout.NORTH); set_panel.add(south_panel, BorderLayout.SOUTH); set_panel.add(scroll1, BorderLayout.WEST); set_panel.add(scroll2, BorderLayout.EAST); set_panel.add(center_panel, BorderLayout.CENTER); // register the Action Listener add_btn.addActionListener(this); del_btn.addActionListener(this); save_btn.addActionListener(this); login_btn.addActionListener(this); // set default button state as 'false' add_btn.setEnabled(false); del_btn.setEnabled(false); save_btn.setEnabled(false); login_btn.setEnabled(false); top_pane.add("Setting", set_panel); top_pane.add("Monitoring", main_panel); getContentPane().add(top_pane); // Create the notebook tabbed_pane = new JTabbedPane(JTabbedPane.TOP); main_panel.add(tabbed_pane, BorderLayout.CENTER); top_pane.addChangeListener(this); top_pane.setEnabled(false); setVisible(true); } /** * Do login process * * @return */ private boolean doLogin() { Dimension d = null; // Login LoginDlg login = new LoginDlg(); login.show(); if (!login.isLogin()) { login_btn.setEnabled(true); return false; } login.dispose(); save_btn.setEnabled(false); login_btn.setEnabled(false); // Get the axisHost & axisPort to be used String url_str = login.getURL(); try { URL url = new URL(url_str); axisHost = url.getHost(); axisPort = url.getPort(); if (axisPort == -1) { axisPort = 8080; } String axisPath = url.getPath(); axisURL = "http://" + axisHost + ":" + axisPort + axisPath; } catch (MalformedURLException e) { JOptionPane pane = new JOptionPane(); String msg = e.toString(); pane.setMessageType(JOptionPane.WARNING_MESSAGE); pane.setMessage(msg); pane.setOptions(new String[]{"OK"}); JDialog dlg = pane.createDialog(null, "Login status"); dlg.setVisible(true); login_btn.setEnabled(true); return false; } titleLabel.setText(titleStr + " for [" + axisHost + ":" + axisPort + "]"); final JProgressBar progressBar = new JProgressBar(0, 100); BarThread stepper = new BarThread(progressBar); stepper.start(); JFrame progress = new JFrame(); d = new Dimension(250, 50); progress.setSize(d); d = getToolkit().getScreenSize(); progress.getContentPane().add(progressBar); progress.setTitle("Now loading data ..."); progress.setLocation((d.width - progress.getWidth()) / 2, (d.height - progress.getHeight()) / 2); progress.show(); // Add notebook page for default host connection pages = new Vector(); addPage(new SOAPMonitorPage(axisHost)); serviceMap = new HashMap(); originalDoc = getServerWSDD(); model1.clear(); model2.clear(); if (originalDoc != null) { String ret = null; NodeList nl = originalDoc.getElementsByTagName("service"); for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); NamedNodeMap map = node.getAttributes(); ret = map.getNamedItem("name").getNodeValue(); serviceMap.put(ret, node); if (!isMonitored(node)) { model1.addElement((String) ret); } else { model2.addElement((String) ret); } } if (model1.size() > 0) { add_btn.setEnabled(true); } if (model2.size() > 0) { del_btn.setEnabled(true); } progress.dispose(); save_btn.setEnabled(true); login_btn.setEnabled(true); top_pane.setEnabled(true); return true; } else { progress.dispose(); login_btn.setEnabled(true); return false; } } /** * This class is a thred for a JProgressBar. */ class BarThread extends Thread { /** * Field wait */ private int wait = 100; /** * Field progressBar */ JProgressBar progressBar = null; /** * Constructor BarThread * * @param bar */ public BarThread(JProgressBar bar) { progressBar = bar; } /** * Method run */ public void run() { int min = progressBar.getMinimum(); int max = progressBar.getMaximum(); Runnable runner = new Runnable() { public void run() { int val = progressBar.getValue(); progressBar.setValue(val + 1); } }; for (int i = min; i < max; i++) { try { SwingUtilities.invokeAndWait(runner); Thread.sleep(wait); } catch (InterruptedException ignoredException) { } catch (InvocationTargetException ignoredException) { } } } } /** * Get the server-config.wsdd as a document to retrieve deployed services * * @return */ private Document getServerWSDD() { Document doc = null; try { String[] param = new String[]{"-u" + axisUser, "-w" + axisPass, "-l " + axisURL, "list"}; String ret = adminClient.process(param); doc = XMLUtils.newDocument( new ByteArrayInputStream(ret.getBytes())); } catch (Exception e) { JOptionPane pane = new JOptionPane(); String msg = e.toString(); pane.setMessageType(JOptionPane.WARNING_MESSAGE); pane.setMessage(msg); pane.setOptions(new String[]{"OK"}); JDialog dlg = pane.createDialog(null, "Login status"); dlg.setVisible(true); } return doc; } /** * Deploy the specified wsdd to change the monitoring state * * @param wsdd * @return */ private boolean doDeploy(Document wsdd) { String deploy = null; Options opt = null; deploy = XMLUtils.DocumentToString(wsdd); try { String[] param = new String[]{"-u" + axisUser, "-w" + axisPass, "-l " + axisURL, ""}; opt = new Options(param); adminClient.process(opt, new ByteArrayInputStream(deploy.getBytes())); } catch (Exception e) { return false; } return true; } /** * Get a new document which has the specified node as the document root * * @param target * @return */ private Document getNewDocumentAsNode(Node target) { Document doc = null; Node node = null; try { doc = XMLUtils.newDocument(); } catch (ParserConfigurationException e) { e.printStackTrace(); } node = doc.importNode(target, true); doc.appendChild(node); return doc; } /** * Add needed nodes for monitoring to the specified node * <p/> * TODO: support JAX-RPC type definition (i.e. <handlerInfoChain/>) * * @param target * @return */ private Node addMonitor(Node target) { Document doc = null; Node node = null; Node newNode = null; String ret = null; NodeList nl = null; final String reqFlow = "requestFlow"; final String resFlow = "responseFlow"; final String monitor = "soapmonitor"; final String handler = "handler"; final String type = "type"; doc = getNewDocumentAsNode(target); // Add "responseFlow node nl = doc.getElementsByTagName(resFlow); if (nl.getLength() == 0) { node = doc.getDocumentElement().getFirstChild(); newNode = doc.createElement(resFlow); doc.getDocumentElement().insertBefore(newNode, node); } // Add "requestFlow" node nl = doc.getElementsByTagName(reqFlow); if (nl.getLength() == 0) { node = doc.getDocumentElement().getFirstChild(); newNode = doc.createElement(reqFlow); doc.getDocumentElement().insertBefore(newNode, node); } // Add "handler" node and "soapmonitor" attribute for "requestFlow" nl = doc.getElementsByTagName(reqFlow); node = nl.item(0).getFirstChild(); newNode = doc.createElement(handler); ((Element) newNode).setAttribute(type, monitor); nl.item(0).insertBefore(newNode, node); // Add "handler" node and "soapmonitor" attribute for "responseFlow" nl = doc.getElementsByTagName(resFlow); node = nl.item(0).getFirstChild(); newNode = doc.createElement(handler); ((Element) newNode).setAttribute(type, monitor); nl.item(0).insertBefore(newNode, node); return (Node) doc.getDocumentElement(); } /** * Remove a few nodes for stoping monitor from the specified node * <p/> * TODO: support JAX-RPC type definition (i.e. <handlerInfoChain/>) * * @param target * @return */ private Node delMonitor(Node target) { Document doc = null; Node node = null; Node newNode = null; String ret = null; NodeList nl = null; final String reqFlow = "requestFlow"; final String resFlow = "responseFlow"; final String monitor = "soapmonitor"; final String handler = "handler"; final String type = "type"; doc = getNewDocumentAsNode(target); nl = doc.getElementsByTagName(handler); int size; size = nl.getLength(); Node[] removeNode = new Node[size]; if (size > 0) { newNode = nl.item(0).getParentNode(); } for (int i = 0; i < size; i++) { node = nl.item(i); NamedNodeMap map = node.getAttributes(); ret = map.getNamedItem(type).getNodeValue(); if (ret.equals(monitor)) { removeNode[i] = node; } } for (int i = 0; i < size; i++) { Node child = removeNode[i]; if (child != null) { child.getParentNode().removeChild(child); } } return (Node) doc.getDocumentElement(); } /** * Get a boolean value whether the specified node is monitoring or not * * @param target * @return */ private boolean isMonitored(Node target) { Document doc = null; Node node = null; String ret = null; NodeList nl = null; final String monitor = "soapmonitor"; final String handler = "handler"; final String type = "type"; doc = getNewDocumentAsNode(target); nl = doc.getElementsByTagName(handler); for (int i = 0; i < nl.getLength(); i++) { node = nl.item(i); NamedNodeMap map = node.getAttributes(); ret = map.getNamedItem(type).getNodeValue(); if (ret.equals(monitor)) { return true; } else { return false; } } return false; } /** * Add a few nodes for authentification * <p/> * TODO: support JAX-RPC type definition (i.e. <handlerInfoChain/>) * * @param target * @return */ private Node addAuthenticate(Node target) { Document doc = null; Node node = null; Node newNode = null; String ret = null; NodeList nl = null; final String reqFlow = "requestFlow"; final String handler = "handler"; final String type = "type"; final String authentication = "java:org.apache.axis.handlers.SimpleAuthenticationHandler"; final String authorization = "java:org.apache.axis.handlers.SimpleAuthorizationHandler"; final String param = "parameter"; final String name = "name"; final String role = "allowedRoles"; final String value = "value"; final String admin = "admin"; boolean authNode = false; boolean roleNode = false; doc = getNewDocumentAsNode(target); // Add "requestFlow" node nl = doc.getElementsByTagName(reqFlow); if (nl.getLength() == 0) { node = doc.getDocumentElement().getFirstChild(); newNode = doc.createElement(reqFlow); doc.getDocumentElement().insertBefore(newNode, node); } // Add "SimpleAuthorizationHandler" // (i.e. <handler type="java:org.apache.axis.handlers.SimpleAuthorizationHandler"/>) nl = doc.getElementsByTagName(handler); for (int i = 0; i < nl.getLength(); i++) { node = nl.item(i); NamedNodeMap map = node.getAttributes(); ret = map.getNamedItem(type).getNodeValue(); if (ret.equals(authorization)) { authNode = true; break; } } if (!authNode) { nl = doc.getElementsByTagName(reqFlow); node = nl.item(0).getFirstChild(); newNode = doc.createElement(handler); ((Element) newNode).setAttribute(type, authorization); nl.item(0).insertBefore(newNode, node); } // Add "SimpleAuthenticationHandler" // (i.e. <handler type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>) authNode = false; nl = doc.getElementsByTagName(handler); for (int i = 0; i < nl.getLength(); i++) { node = nl.item(i); NamedNodeMap map = node.getAttributes(); ret = map.getNamedItem(type).getNodeValue(); if (ret.equals(authentication)) { authNode = true; break; } } if (!authNode) { nl = doc.getElementsByTagName(reqFlow); node = nl.item(0).getFirstChild(); newNode = doc.createElement(handler); ((Element) newNode).setAttribute(type, authentication); nl.item(0).insertBefore(newNode, node); } // Add "allowedRoles" (i.e. <parameter name="allowedRoles" value="admin"/> ) nl = doc.getElementsByTagName(param); for (int i = 0; i < nl.getLength(); i++) { node = nl.item(i); NamedNodeMap map = node.getAttributes(); node = map.getNamedItem(name); if (node != null) { ret = node.getNodeValue(); if (ret.equals(role)) { roleNode = true; break; } } } if (!roleNode) { nl = doc.getElementsByTagName(param); newNode = doc.createElement(param); ((Element) newNode).setAttribute(name, role); ((Element) newNode).setAttribute(value, admin); doc.getDocumentElement().insertBefore(newNode, nl.item(0)); } return (Node) doc.getDocumentElement(); } /** * Handle the window close event */ class MyWindowAdapter extends WindowAdapter { /** * Method windowClosing * * @param e */ public void windowClosing(WindowEvent e) { System.exit(0); } } /** * Add a page to the notebook * * @param pg */ private void addPage(SOAPMonitorPage pg) { tabbed_pane.addTab(" " + pg.getHost() + " ", pg); pages.addElement(pg); } /** * Del all pages to the notebook */ private void delPage() { tabbed_pane.removeAll(); pages.removeAllElements(); } /** * Frame is being displayed */ public void start() { // Tell all pages to start talking to the server Enumeration e = pages.elements(); while (e.hasMoreElements()) { SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement(); if (pg != null) { pg.start(); } } } /* * Frame is no longer displayed */ /** * Method stop */ public void stop() { // Tell all pages to stop talking to the server Enumeration e = pages.elements(); while (e.hasMoreElements()) { SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement(); if (pg != null) { pg.stop(); } } } /** * This class is for the Login Dialog */ class LoginDlg extends JDialog implements ActionListener { /** * Field ok_button */ private JButton ok_button = null; /** * Field cancel_button */ private JButton cancel_button = null; /** * Field user */ private JTextField user = new JTextField(20); /** * Field pass */ private JPasswordField pass = new JPasswordField(20); /** * Field url */ private JTextField url = new JTextField(20); /** * Field loginState */ private boolean loginState = false; /** * Constructor (create and layout page) */ public LoginDlg() { setTitle("SOAP Monitor Login"); UIManager.put("Label.font", new Font("Dialog", Font.BOLD, 12)); JPanel panel = new JPanel(); ok_button = new JButton("OK"); ok_button.addActionListener(this); cancel_button = new JButton("Cancel"); cancel_button.addActionListener(this); // default URL for AxisServlet url.setText(axisURL); JLabel userLabel = new JLabel("User:"); JLabel passLabel = new JLabel("Password:"); JLabel urlLabel = new JLabel("Axis URL:"); userLabel.setHorizontalAlignment(JTextField.RIGHT); passLabel.setHorizontalAlignment(JTextField.RIGHT); urlLabel.setHorizontalAlignment(JTextField.RIGHT); panel.add(userLabel); panel.add(user); panel.add(passLabel); panel.add(pass); panel.add(urlLabel); panel.add(url); panel.add(ok_button); panel.add(cancel_button); setContentPane(panel); user.setText(SOAPMonitor.axisUser); pass.setText(SOAPMonitor.axisPass); GridLayout layout = new GridLayout(4, 2); layout.setHgap(15); layout.setVgap(5); panel.setLayout(layout); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); setModal(true); pack(); Dimension d = getToolkit().getScreenSize(); setLocation((d.width - getWidth()) / 2, (d.height - getHeight()) / 2); } /** * Listener to handle button actions * * @param e */ public void actionPerformed(ActionEvent e) { // Check if the user pressed the OK button if (e.getSource() == ok_button) { loginState = true; SOAPMonitor.axisUser = user.getText(); SOAPMonitor.axisPass = new String(pass.getPassword()); this.hide(); } else if (e.getSource() == cancel_button) { this.dispose(); } } /** * Get the URL of the AxisServlet we are using * * @return */ public String getURL() { return url.getText(); } /** * Get the login status as a boolean * * @return */ public boolean isLogin() { return loginState; } } /** * This class provides the contents of a notebook page * representing a server connection. */ class SOAPMonitorPage extends JPanel implements Runnable, ListSelectionListener, ActionListener { /** * Status Strings */ private final String STATUS_ACTIVE = "The SOAP Monitor is started."; /** * Field STATUS_STOPPED */ private final String STATUS_STOPPED = "The SOAP Monitor is stopped."; /** * Field STATUS_CLOSED */ private final String STATUS_CLOSED = "The server communication has been terminated."; /** * Field STATUS_NOCONNECT */ private final String STATUS_NOCONNECT = "The SOAP Monitor is unable to communcate with the server."; /** * Private data */ private String host = null; /** * Field socket */ private Socket socket = null; /** * Field in */ private ObjectInputStream in = null; /** * Field out */ private ObjectOutputStream out = null; /** * Field model */ private SOAPMonitorTableModel model = null; /** * Field table */ private JTable table = null; /** * Field scroll */ private JScrollPane scroll = null; /** * Field list_panel */ private JPanel list_panel = null; /** * Field list_buttons */ private JPanel list_buttons = null; /** * Field remove_button */ private JButton remove_button = null; /** * Field remove_all_button */ private JButton remove_all_button = null; /** * Field filter_button */ private JButton filter_button = null; /** * Field details_panel */ private JPanel details_panel = null; /** * Field details_header */ private JPanel details_header = null; /** * Field details_soap */ private JSplitPane details_soap = null; /** * Field details_buttons */ private JPanel details_buttons = null; /** * Field details_time */ private JLabel details_time = null; /** * Field details_target */ private JLabel details_target = null; /** * Field details_status */ private JLabel details_status = null; /** * Field details_time_value */ private JLabel details_time_value = null; /** * Field details_target_value */ private JLabel details_target_value = null; /** * Field details_status_value */ private JLabel details_status_value = null; /** * Field empty_border */ private EmptyBorder empty_border = null; /** * Field etched_border */ private EtchedBorder etched_border = null; /** * Field request_panel */ private JPanel request_panel = null; /** * Field response_panel */ private JPanel response_panel = null; /** * Field request_label */ private JLabel request_label = null; /** * Field response_label */ private JLabel response_label = null; /** * Field request_text */ private SOAPMonitorTextArea request_text = null; /** * Field response_text */ private SOAPMonitorTextArea response_text = null; /** * Field request_scroll */ private JScrollPane request_scroll = null; /** * Field response_scroll */ private JScrollPane response_scroll = null; /** * Field layout_button */ private JButton layout_button = null; /** * Field split */ private JSplitPane split = null; /** * Field status_area */ private JPanel status_area = null; /** * Field status_buttons */ private JPanel status_buttons = null; /** * Field start_button */ private JButton start_button = null; /** * Field stop_button */ private JButton stop_button = null; /** * Field status_text */ private JLabel status_text = null; /** * Field status_text_panel */ private JPanel status_text_panel = null; /** * Field filter */ private SOAPMonitorFilter filter = null; /** * Field details_header_layout */ private GridBagLayout details_header_layout = null; /** * Field details_header_constraints */ private GridBagConstraints details_header_constraints = null; /** * Field reflow_xml */ private JCheckBox reflow_xml = null; /** * Constructor (create and layout page) * * @param host_name */ public SOAPMonitorPage(String host_name) { host = host_name; // Set up default filter (show all messages) filter = new SOAPMonitorFilter(); // Use borders to help improve appearance etched_border = new EtchedBorder(); // Build top portion of split (list panel) model = new SOAPMonitorTableModel(); table = new JTable(model); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setRowSelectionInterval(0, 0); table.setPreferredScrollableViewportSize(new Dimension(600, 96)); table.getSelectionModel().addListSelectionListener(this); scroll = new JScrollPane(table); remove_button = new JButton("Remove"); remove_button.addActionListener(this); remove_button.setEnabled(false); remove_all_button = new JButton("Remove All"); remove_all_button.addActionListener(this); filter_button = new JButton("Filter ..."); filter_button.addActionListener(this); list_buttons = new JPanel(); list_buttons.setLayout(new FlowLayout()); list_buttons.add(remove_button); list_buttons.add(remove_all_button); list_buttons.add(filter_button); list_panel = new JPanel(); list_panel.setLayout(new BorderLayout()); list_panel.add(scroll, BorderLayout.CENTER); list_panel.add(list_buttons, BorderLayout.SOUTH); list_panel.setBorder(empty_border); // Build bottom portion of split (message details) details_time = new JLabel("Time: ", SwingConstants.RIGHT); details_target = new JLabel("Target Service: ", SwingConstants.RIGHT); details_status = new JLabel("Status: ", SwingConstants.RIGHT); details_time_value = new JLabel(); details_target_value = new JLabel(); details_status_value = new JLabel(); Dimension preferred_size = details_time.getPreferredSize(); preferred_size.width = 1; details_time.setPreferredSize(preferred_size); details_target.setPreferredSize(preferred_size); details_status.setPreferredSize(preferred_size); details_time_value.setPreferredSize(preferred_size); details_target_value.setPreferredSize(preferred_size); details_status_value.setPreferredSize(preferred_size); details_header = new JPanel(); details_header_layout = new GridBagLayout(); details_header.setLayout(details_header_layout); details_header_constraints = new GridBagConstraints(); details_header_constraints.fill = GridBagConstraints.BOTH; details_header_constraints.weightx = 0.5; details_header_layout.setConstraints(details_time, details_header_constraints); details_header.add(details_time); details_header_layout.setConstraints(details_time_value, details_header_constraints); details_header.add(details_time_value); details_header_layout.setConstraints(details_target, details_header_constraints); details_header.add(details_target); details_header_constraints.weightx = 1.0; details_header_layout.setConstraints(details_target_value, details_header_constraints); details_header.add(details_target_value); details_header_constraints.weightx = .5; details_header_layout.setConstraints(details_status, details_header_constraints); details_header.add(details_status); details_header_layout.setConstraints(details_status_value, details_header_constraints); details_header.add(details_status_value); details_header.setBorder(etched_border); request_label = new JLabel("SOAP Request", SwingConstants.CENTER); request_text = new SOAPMonitorTextArea(); request_text.setEditable(false); request_scroll = new JScrollPane(request_text); request_panel = new JPanel(); request_panel.setLayout(new BorderLayout()); request_panel.add(request_label, BorderLayout.NORTH); request_panel.add(request_scroll, BorderLayout.CENTER); response_label = new JLabel("SOAP Response", SwingConstants.CENTER); response_text = new SOAPMonitorTextArea(); response_text.setEditable(false); response_scroll = new JScrollPane(response_text); response_panel = new JPanel(); response_panel.setLayout(new BorderLayout()); response_panel.add(response_label, BorderLayout.NORTH); response_panel.add(response_scroll, BorderLayout.CENTER); details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); details_soap.setTopComponent(request_panel); details_soap.setRightComponent(response_panel); details_soap.setResizeWeight(.5); details_panel = new JPanel(); layout_button = new JButton("Switch Layout"); layout_button.addActionListener(this); reflow_xml = new JCheckBox("Reflow XML text"); reflow_xml.addActionListener(this); details_buttons = new JPanel(); details_buttons.setLayout(new FlowLayout()); details_buttons.add(reflow_xml); details_buttons.add(layout_button); details_panel.setLayout(new BorderLayout()); details_panel.add(details_header, BorderLayout.NORTH); details_panel.add(details_soap, BorderLayout.CENTER); details_panel.add(details_buttons, BorderLayout.SOUTH); details_panel.setBorder(empty_border); // Add the two parts to the age split pane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT); split.setTopComponent(list_panel); split.setRightComponent(details_panel); // Build status area start_button = new JButton("Start"); start_button.addActionListener(this); stop_button = new JButton("Stop"); stop_button.addActionListener(this); status_buttons = new JPanel(); status_buttons.setLayout(new FlowLayout()); status_buttons.add(start_button); status_buttons.add(stop_button); status_text = new JLabel(); status_text.setBorder(new BevelBorder(BevelBorder.LOWERED)); status_text_panel = new JPanel(); status_text_panel.setLayout(new BorderLayout()); status_text_panel.add(status_text, BorderLayout.CENTER); status_text_panel.setBorder(empty_border); status_area = new JPanel(); status_area.setLayout(new BorderLayout()); status_area.add(status_buttons, BorderLayout.WEST); status_area.add(status_text_panel, BorderLayout.CENTER); status_area.setBorder(etched_border); // Add the split and status area to page setLayout(new BorderLayout()); add(split, BorderLayout.CENTER); add(status_area, BorderLayout.SOUTH); } /** * Get the name of the host we are displaying * * @return */ public String getHost() { return host; } /** * Set the status text * * @param txt */ public void setStatus(String txt) { status_text.setForeground(Color.black); status_text.setText(" " + txt); } /** * Set the status text to an error * * @param txt */ public void setErrorStatus(String txt) { status_text.setForeground(Color.red); status_text.setText(" " + txt); } /** * Start talking to the server */ public void start() { String codehost = axisHost; if (socket == null) { try { // Open the socket to the server socket = new Socket(codehost, port); // Create output stream out = new ObjectOutputStream(socket.getOutputStream()); out.flush(); // Create input stream and start background // thread to read data from the server in = new ObjectInputStream(socket.getInputStream()); new Thread(this).start(); } catch (Exception e) { // Exceptions here are unexpected, but we can't // really do anything (so just write it to stdout // in case someone cares and then ignore it) e.printStackTrace(); setErrorStatus(STATUS_NOCONNECT); socket = null; } } else { // Already started } if (socket != null) { // Make sure the right buttons are enabled start_button.setEnabled(false); stop_button.setEnabled(true); setStatus(STATUS_ACTIVE); } } /** * Stop talking to the server */ public void stop() { if (socket != null) { // Close all the streams and socket if (out != null) { try { out.close(); } catch (IOException ioe) { } out = null; } if (in != null) { try { in.close(); } catch (IOException ioe) { } in = null; } if (socket != null) { try { socket.close(); } catch (IOException ioe) { } socket = null; } } else { // Already stopped } // Make sure the right buttons are enabled start_button.setEnabled(true); stop_button.setEnabled(false); setStatus(STATUS_STOPPED); } /** * Background thread used to receive data from * the server. */ public void run() { Long id; Integer message_type; String target; String soap; SOAPMonitorData data; int selected; int row; boolean update_needed; while (socket != null) { try { // Get the data from the server message_type = (Integer) in.readObject(); // Process the data depending on its type switch (message_type.intValue()) { case SOAPMonitorConstants.SOAP_MONITOR_REQUEST: // Get the id, target and soap info id = (Long) in.readObject(); target = (String) in.readObject(); soap = (String) in.readObject(); // Add new request data to the table data = new SOAPMonitorData(id, target, soap); model.addData(data); // If "most recent" selected then update // the details area if needed selected = table.getSelectedRow(); if ((selected == 0) && model.filterMatch(data)) { valueChanged(null); } break; case SOAPMonitorConstants.SOAP_MONITOR_RESPONSE: // Get the id and soap info id = (Long) in.readObject(); soap = (String) in.readObject(); data = model.findData(id); if (data != null) { update_needed = false; // Get the selected row selected = table.getSelectedRow(); // If "most recent", then always // update details area if (selected == 0) { update_needed = true; } // If the data being updated is // selected then update details row = model.findRow(data); if ((row != -1) && (row == selected)) { update_needed = true; } // Set the response and update table data.setSOAPResponse(soap); model.updateData(data); // Refresh details area (if needed) if (update_needed) { valueChanged(null); } } break; } } catch (Exception e) { // Exceptions are expected here when the // server communication has been terminated. if (stop_button.isEnabled()) { stop(); setErrorStatus(STATUS_CLOSED); } } } } /** * Listener to handle table selection changes * * @param e */ public void valueChanged(ListSelectionEvent e) { int row = table.getSelectedRow(); // Check if they selected a specific row if (row > 0) { remove_button.setEnabled(true); } else { remove_button.setEnabled(false); } // Check for "most recent" selection if (row == 0) { row = model.getRowCount() - 1; if (row == 0) { row = -1; } } if (row == -1) { // Clear the details panel details_time_value.setText(""); details_target_value.setText(""); details_status_value.setText(""); request_text.setText(""); response_text.setText(""); } else { // Show the details for the row SOAPMonitorData soap = model.getData(row); details_time_value.setText(soap.getTime()); details_target_value.setText(soap.getTargetService()); details_status_value.setText(soap.getStatus()); if (soap.getSOAPRequest() == null) { request_text.setText(""); } else { request_text.setText(soap.getSOAPRequest()); request_text.setCaretPosition(0); } if (soap.getSOAPResponse() == null) { response_text.setText(""); } else { response_text.setText(soap.getSOAPResponse()); response_text.setCaretPosition(0); } } } /** * Listener to handle button actions * * @param e */ public void actionPerformed(ActionEvent e) { // Check if the user pressed the remove button if (e.getSource() == remove_button) { int row = table.getSelectedRow(); model.removeRow(row); table.clearSelection(); table.repaint(); valueChanged(null); } // Check if the user pressed the remove all button if (e.getSource() == remove_all_button) { model.clearAll(); table.setRowSelectionInterval(0, 0); table.repaint(); valueChanged(null); } // Check if the user pressed the filter button if (e.getSource() == filter_button) { filter.showDialog(); if (filter.okPressed()) { // Update the display with new filter model.setFilter(filter); table.repaint(); } } // Check if the user pressed the start button if (e.getSource() == start_button) { start(); } // Check if the user pressed the stop button if (e.getSource() == stop_button) { stop(); } // Check if the user wants to switch layout if (e.getSource() == layout_button) { details_panel.remove(details_soap); details_soap.removeAll(); if (details_soap.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) { details_soap = new JSplitPane(JSplitPane.VERTICAL_SPLIT); } else { details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); } details_soap.setTopComponent(request_panel); details_soap.setRightComponent(response_panel); details_soap.setResizeWeight(.5); details_panel.add(details_soap, BorderLayout.CENTER); details_panel.validate(); details_panel.repaint(); } // Check if the user is changing the reflow option if (e.getSource() == reflow_xml) { request_text.setReflowXML(reflow_xml.isSelected()); response_text.setReflowXML(reflow_xml.isSelected()); } } } /** * This class represend the data for a SOAP request/response pair */ class SOAPMonitorData { /** * Private data */ private Long id; /** * Field time */ private String time; /** * Field target */ private String target; /** * Field soap_request */ private String soap_request; /** * Field soap_response */ private String soap_response; /** * Constructor * * @param id * @param target * @param soap_request */ public SOAPMonitorData(Long id, String target, String soap_request) { this.id = id; // A null id is used to signal that the "most recent" entry // is being created. if (id == null) { this.time = "Most Recent"; this.target = "---"; this.soap_request = null; this.soap_response = null; } else { this.time = DateFormat.getTimeInstance().format(new Date()); this.target = target; this.soap_request = soap_request; this.soap_response = null; } } /** * Get the id for the SOAP message * * @return */ public Long getId() { return id; } /** * Get the time the SOAP request was received by the application * * @return */ public String getTime() { return time; } /** * Get the SOAP request target service name * * @return */ public String getTargetService() { return target; } /** * Get the status of the request * * @return */ public String getStatus() { String status = "---"; if (id != null) { status = "Complete"; if (soap_response == null) { status = "Active"; } } return status; } /** * Get the request SOAP contents * * @return */ public String getSOAPRequest() { return soap_request; } /** * Set the resposne SOAP contents * * @param response */ public void setSOAPResponse(String response) { soap_response = response; } /** * Get the response SOAP contents * * @return */ public String getSOAPResponse() { return soap_response; } } /** * This table model is used to manage the table displayed * at the top of the page to show all the SOAP messages * we have received and to control which message details are * to be displayed on the bottom of the page. */ class SOAPMonitorTableModel extends AbstractTableModel { /** * Column titles */ private final String[] column_names = {"Time", "Target Service", "Status"}; /** * Private data */ private Vector data; /** * Field filter_include */ private Vector filter_include; /** * Field filter_exclude */ private Vector filter_exclude; /** * Field filter_active */ private boolean filter_active; /** * Field filter_complete */ private boolean filter_complete; /** * Field filter_data */ private Vector filter_data; /** * Constructor */ public SOAPMonitorTableModel() { data = new Vector(); // Add "most recent" entry to top of table SOAPMonitorData soap = new SOAPMonitorData(null, null, null); data.addElement(soap); filter_include = null; filter_exclude = null; filter_active = false; filter_complete = false; filter_data = null; // By default, exclude NotificationService and // EventViewerService messages filter_exclude = new Vector(); filter_exclude.addElement("NotificationService"); filter_exclude.addElement("EventViewerService"); filter_data = new Vector(); filter_data.addElement(soap); } /** * Get column count (part of table model interface) * * @return */ public int getColumnCount() { return column_names.length; } /** * Get row count (part of table model interface) * * @return */ public int getRowCount() { int count = data.size(); if (filter_data != null) { count = filter_data.size(); } return count; } /** * Get column name (part of table model interface) * * @param col * @return */ public String getColumnName(int col) { return column_names[col]; } /** * Get value at (part of table model interface) * * @param row * @param col * @return */ public Object getValueAt(int row, int col) { SOAPMonitorData soap; String value = null; soap = (SOAPMonitorData) data.elementAt(row); if (filter_data != null) { soap = (SOAPMonitorData) filter_data.elementAt(row); } switch (col) { case 0: value = soap.getTime(); break; case 1: value = soap.getTargetService(); break; case 2: value = soap.getStatus(); break; } return value; } /** * Check if soap data matches filter * * @param soap * @return */ public boolean filterMatch(SOAPMonitorData soap) { boolean match = true; if (filter_include != null) { // Check for service match Enumeration e = filter_include.elements(); match = false; while (e.hasMoreElements() && !match) { String service = (String) e.nextElement(); if (service.equals(soap.getTargetService())) { match = true; } } } if (filter_exclude != null) { // Check for service match Enumeration e = filter_exclude.elements(); while (e.hasMoreElements() && match) { String service = (String) e.nextElement(); if (service.equals(soap.getTargetService())) { match = false; } } } if (filter_active) { // Check for active status match if (soap.getSOAPResponse() != null) { match = false; } } if (filter_complete) { // Check for complete status match if (soap.getSOAPResponse() == null) { match = false; } } // The "most recent" is always a match if (soap.getId() == null) { match = true; } return match; } /** * Add data to the table as a new row * * @param soap */ public void addData(SOAPMonitorData soap) { int row = data.size(); data.addElement(soap); if (filter_data != null) { if (filterMatch(soap)) { row = filter_data.size(); filter_data.addElement(soap); fireTableRowsInserted(row, row); } } else { fireTableRowsInserted(row, row); } } /** * Find the data for a given id * * @param id * @return */ public SOAPMonitorData findData(Long id) { SOAPMonitorData soap = null; for (int row = data.size(); (row > 0) && (soap == null); row--) { soap = (SOAPMonitorData) data.elementAt(row - 1); if (soap.getId().longValue() != id.longValue()) { soap = null; } } return soap; } /** * Find the row in the table for a given message id * * @param soap * @return */ public int findRow(SOAPMonitorData soap) { int row = -1; if (filter_data != null) { row = filter_data.indexOf(soap); } else { row = data.indexOf(soap); } return row; } /** * Remove all messages from the table (but leave "most recent") */ public void clearAll() { int last_row = data.size() - 1; if (last_row > 0) { data.removeAllElements(); SOAPMonitorData soap = new SOAPMonitorData(null, null, null); data.addElement(soap); if (filter_data != null) { filter_data.removeAllElements(); filter_data.addElement(soap); } fireTableDataChanged(); } } /** * Remove a message from the table * * @param row */ public void removeRow(int row) { SOAPMonitorData soap = null; if (filter_data == null) { soap = (SOAPMonitorData) data.elementAt(row); data.remove(soap); } else { soap = (SOAPMonitorData) filter_data.elementAt(row); filter_data.remove(soap); data.remove(soap); } fireTableRowsDeleted(row, row); } /** * Set a new filter * * @param filter */ public void setFilter(SOAPMonitorFilter filter) { // Save new filter criteria filter_include = filter.getFilterIncludeList(); filter_exclude = filter.getFilterExcludeList(); filter_active = filter.getFilterActive(); filter_complete = filter.getFilterComplete(); applyFilter(); } /** * Refilter the list of messages */ public void applyFilter() { // Re-filter using new criteria filter_data = null; if ((filter_include != null) || (filter_exclude != null) || filter_active || filter_complete) { filter_data = new Vector(); Enumeration e = data.elements(); SOAPMonitorData soap; while (e.hasMoreElements()) { soap = (SOAPMonitorData) e.nextElement(); if (filterMatch(soap)) { filter_data.addElement(soap); } } } fireTableDataChanged(); } /** * Get the data for a row * * @param row * @return */ public SOAPMonitorData getData(int row) { SOAPMonitorData soap = null; if (filter_data == null) { soap = (SOAPMonitorData) data.elementAt(row); } else { soap = (SOAPMonitorData) filter_data.elementAt(row); } return soap; } /** * Update a message * * @param soap */ public void updateData(SOAPMonitorData soap) { int row; if (filter_data == null) { // No filter, so just fire table updated row = data.indexOf(soap); if (row != -1) { fireTableRowsUpdated(row, row); } } else { // Check if the row was being displayed row = filter_data.indexOf(soap); if (row == -1) { // Row was not displayed, so check for if it // now needs to be displayed if (filterMatch(soap)) { int index = -1; row = data.indexOf(soap) + 1; while ((row < data.size()) && (index == -1)) { index = filter_data.indexOf(data.elementAt(row)); if (index != -1) { // Insert at this location filter_data.add(index, soap); } row++; } if (index == -1) { // Insert at end index = filter_data.size(); filter_data.addElement(soap); } fireTableRowsInserted(index, index); } } else { // Row was displayed, so check if it needs to // be updated or removed if (filterMatch(soap)) { fireTableRowsUpdated(row, row); } else { filter_data.remove(soap); fireTableRowsDeleted(row, row); } } } } } /** * Panel with checkbox and list */ class ServiceFilterPanel extends JPanel implements ActionListener, ListSelectionListener, DocumentListener { /** * Field service_box */ private JCheckBox service_box = null; /** * Field filter_list */ private Vector filter_list = null; /** * Field service_data */ private Vector service_data = null; /** * Field service_list */ private JList service_list = null; /** * Field service_scroll */ private JScrollPane service_scroll = null; /** * Field remove_service_button */ private JButton remove_service_button = null; /** * Field remove_service_panel */ private JPanel remove_service_panel = null; /** * Field indent_border */ private EmptyBorder indent_border = null; /** * Field empty_border */ private EmptyBorder empty_border = null; /** * Field service_area */ private JPanel service_area = null; /** * Field add_service_area */ private JPanel add_service_area = null; /** * Field add_service_field */ private JTextField add_service_field = null; /** * Field add_service_button */ private JButton add_service_button = null; /** * Field add_service_panel */ private JPanel add_service_panel = null; /** * Constructor * * @param text * @param list */ public ServiceFilterPanel(String text, Vector list) { empty_border = new EmptyBorder(5, 5, 0, 5); indent_border = new EmptyBorder(5, 25, 5, 5); service_box = new JCheckBox(text); service_box.addActionListener(this); service_data = new Vector(); if (list != null) { service_box.setSelected(true); service_data = (Vector) list.clone(); } service_list = new JList(service_data); service_list.setBorder(new EtchedBorder()); service_list.setVisibleRowCount(5); service_list.addListSelectionListener(this); service_list.setEnabled(service_box.isSelected()); service_scroll = new JScrollPane(service_list); service_scroll.setBorder(new EtchedBorder()); remove_service_button = new JButton("Remove"); remove_service_button.addActionListener(this); remove_service_button.setEnabled(false); remove_service_panel = new JPanel(); remove_service_panel.setLayout(new FlowLayout()); remove_service_panel.add(remove_service_button); service_area = new JPanel(); service_area.setLayout(new BorderLayout()); service_area.add(service_scroll, BorderLayout.CENTER); service_area.add(remove_service_panel, BorderLayout.EAST); service_area.setBorder(indent_border); add_service_field = new JTextField(); add_service_field.addActionListener(this); add_service_field.getDocument().addDocumentListener(this); add_service_field.setEnabled(service_box.isSelected()); add_service_button = new JButton("Add"); add_service_button.addActionListener(this); add_service_button.setEnabled(false); add_service_panel = new JPanel(); add_service_panel.setLayout(new BorderLayout()); JPanel dummy = new JPanel(); dummy.setBorder(empty_border); add_service_panel.add(dummy, BorderLayout.WEST); add_service_panel.add(add_service_button, BorderLayout.EAST); add_service_area = new JPanel(); add_service_area.setLayout(new BorderLayout()); add_service_area.add(add_service_field, BorderLayout.CENTER); add_service_area.add(add_service_panel, BorderLayout.EAST); add_service_area.setBorder(indent_border); setLayout(new BorderLayout()); add(service_box, BorderLayout.NORTH); add(service_area, BorderLayout.CENTER); add(add_service_area, BorderLayout.SOUTH); setBorder(empty_border); } /** * Get the current list of services * * @return */ public Vector getServiceList() { Vector list = null; if (service_box.isSelected()) { list = service_data; } return list; } /** * Listener to handle button actions * * @param e */ public void actionPerformed(ActionEvent e) { // Check if the user changed the service filter option if (e.getSource() == service_box) { service_list.setEnabled(service_box.isSelected()); service_list.clearSelection(); remove_service_button.setEnabled(false); add_service_field.setEnabled(service_box.isSelected()); add_service_field.setText(""); add_service_button.setEnabled(false); } // Check if the user pressed the add service button if ((e.getSource() == add_service_button) || (e.getSource() == add_service_field)) { String text = add_service_field.getText(); if ((text != null) && (text.length() > 0)) { service_data.addElement(text); service_list.setListData(service_data); } add_service_field.setText(""); add_service_field.requestFocus(); } // Check if the user pressed the remove service button if (e.getSource() == remove_service_button) { Object[] sels = service_list.getSelectedValues(); for (int i = 0; i < sels.length; i++) { service_data.removeElement(sels[i]); } service_list.setListData(service_data); service_list.clearSelection(); } } /** * Handle changes to the text field * * @param e */ public void changedUpdate(DocumentEvent e) { String text = add_service_field.getText(); if ((text != null) && (text.length() > 0)) { add_service_button.setEnabled(true); } else { add_service_button.setEnabled(false); } } /** * Handle changes to the text field * * @param e */ public void insertUpdate(DocumentEvent e) { changedUpdate(e); } /** * Handle changes to the text field * * @param e */ public void removeUpdate(DocumentEvent e) { changedUpdate(e); } /** * Listener to handle service list selection changes * * @param e */ public void valueChanged(ListSelectionEvent e) { if (service_list.getSelectedIndex() == -1) { remove_service_button.setEnabled(false); } else { remove_service_button.setEnabled(true); } } } /** * Class for showing the filter dialog */ class SOAPMonitorFilter implements ActionListener { /** * Private data */ private JDialog dialog = null; /** * Field panel */ private JPanel panel = null; /** * Field buttons */ private JPanel buttons = null; /** * Field ok_button */ private JButton ok_button = null; /** * Field cancel_button */ private JButton cancel_button = null; /** * Field include_panel */ private ServiceFilterPanel include_panel = null; /** * Field exclude_panel */ private ServiceFilterPanel exclude_panel = null; /** * Field status_panel */ private JPanel status_panel = null; /** * Field status_box */ private JCheckBox status_box = null; /** * Field empty_border */ private EmptyBorder empty_border = null; /** * Field indent_border */ private EmptyBorder indent_border = null; /** * Field status_options */ private JPanel status_options = null; /** * Field status_group */ private ButtonGroup status_group = null; /** * Field status_active */ private JRadioButton status_active = null; /** * Field status_complete */ private JRadioButton status_complete = null; /** * Field filter_include_list */ private Vector filter_include_list = null; /** * Field filter_exclude_list */ private Vector filter_exclude_list = null; /** * Field filter_active */ private boolean filter_active = false; /** * Field filter_complete */ private boolean filter_complete = false; /** * Field ok_pressed */ private boolean ok_pressed = false; /** * Constructor */ public SOAPMonitorFilter() { // By default, exclude NotificationService and // EventViewerService messages filter_exclude_list = new Vector(); filter_exclude_list.addElement("NotificationService"); filter_exclude_list.addElement("EventViewerService"); } /** * Get list of services to be included * * @return */ public Vector getFilterIncludeList() { return filter_include_list; } /** * Get list of services to be excluded * * @return */ public Vector getFilterExcludeList() { return filter_exclude_list; } /** * Check if filter active messages * * @return */ public boolean getFilterActive() { return filter_active; } /** * Check if filter complete messages * * @return */ public boolean getFilterComplete() { return filter_complete; } /** * Show the filter dialog */ public void showDialog() { empty_border = new EmptyBorder(5, 5, 0, 5); indent_border = new EmptyBorder(5, 25, 5, 5); include_panel = new ServiceFilterPanel( "Include messages based on target service:", filter_include_list); exclude_panel = new ServiceFilterPanel( "Exclude messages based on target service:", filter_exclude_list); status_box = new JCheckBox("Filter messages based on status:"); status_box.addActionListener(this); status_active = new JRadioButton("Active messages only"); status_active.setSelected(true); status_active.setEnabled(false); status_complete = new JRadioButton("Complete messages only"); status_complete.setEnabled(false); status_group = new ButtonGroup(); status_group.add(status_active); status_group.add(status_complete); if (filter_active || filter_complete) { status_box.setSelected(true); status_active.setEnabled(true); status_complete.setEnabled(true); if (filter_complete) { status_complete.setSelected(true); } } status_options = new JPanel(); status_options.setLayout(new BoxLayout(status_options, BoxLayout.Y_AXIS)); status_options.add(status_active); status_options.add(status_complete); status_options.setBorder(indent_border); status_panel = new JPanel(); status_panel.setLayout(new BorderLayout()); status_panel.add(status_box, BorderLayout.NORTH); status_panel.add(status_options, BorderLayout.CENTER); status_panel.setBorder(empty_border); ok_button = new JButton("Ok"); ok_button.addActionListener(this); cancel_button = new JButton("Cancel"); cancel_button.addActionListener(this); buttons = new JPanel(); buttons.setLayout(new FlowLayout()); buttons.add(ok_button); buttons.add(cancel_button); panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(include_panel); panel.add(exclude_panel); panel.add(status_panel); panel.add(buttons); dialog = new JDialog(); dialog.setTitle("SOAP Monitor Filter"); dialog.setContentPane(panel); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.setModal(true); dialog.pack(); Dimension d = dialog.getToolkit().getScreenSize(); dialog.setLocation((d.width - dialog.getWidth()) / 2, (d.height - dialog.getHeight()) / 2); ok_pressed = false; dialog.show(); } /** * Listener to handle button actions * * @param e */ public void actionPerformed(ActionEvent e) { // Check if the user pressed the ok button if (e.getSource() == ok_button) { filter_include_list = include_panel.getServiceList(); filter_exclude_list = exclude_panel.getServiceList(); if (status_box.isSelected()) { filter_active = status_active.isSelected(); filter_complete = status_complete.isSelected(); } else { filter_active = false; filter_complete = false; } ok_pressed = true; dialog.dispose(); } // Check if the user pressed the cancel button if (e.getSource() == cancel_button) { dialog.dispose(); } // Check if the user changed the status filter option if (e.getSource() == status_box) { status_active.setEnabled(status_box.isSelected()); status_complete.setEnabled(status_box.isSelected()); } } /** * Check if the user pressed the ok button * * @return */ public boolean okPressed() { return ok_pressed; } } /** * Text panel class that supports XML reflow */ class SOAPMonitorTextArea extends JTextArea { /** * Private data */ private boolean format = false; /** * Field original */ private String original = ""; /** * Field formatted */ private String formatted = null; /** * Constructor */ public SOAPMonitorTextArea() { } /** * Override setText to do formatting * * @param text */ public void setText(String text) { original = text; formatted = null; if (format) { doFormat(); super.setText(formatted); } else { super.setText(original); } } /** * Turn reflow on or off * * @param reflow */ public void setReflowXML(boolean reflow) { format = reflow; if (format) { if (formatted == null) { doFormat(); } super.setText(formatted); } else { super.setText(original); } } /** * Reflow XML */ public void doFormat() { Vector parts = new Vector(); char[] chars = original.toCharArray(); int index = 0; int first = 0; String part = null; while (index < chars.length) { // Check for start of tag if (chars[index] == '<') { // Did we have data before this tag? if (first < index) { part = new String(chars, first, index - first); part = part.trim(); // Save non-whitespace data if (part.length() > 0) { parts.addElement(part); } } // Save the start of tag first = index; } // Check for end of tag if (chars[index] == '>') { // Save the tag part = new String(chars, first, index - first + 1); parts.addElement(part); first = index + 1; } // Check for end of line if ((chars[index] == '\n') || (chars[index] == '\r')) { // Was there data on this line? if (first < index) { part = new String(chars, first, index - first); part = part.trim(); // Save non-whitespace data if (part.length() > 0) { parts.addElement(part); } } first = index + 1; } index++; } // Reflow as XML StringBuffer buf = new StringBuffer(); Object[] list = parts.toArray(); int indent = 0; int pad = 0; index = 0; while (index < list.length) { part = (String) list[index]; if (buf.length() == 0) { // Just add first tag (should be XML header) buf.append(part); } else { // All other parts need to start on a new line buf.append('\n'); // If we're at an end tag then decrease indent if (part.startsWith("</")) { indent--; } // Add any indent for (pad = 0; pad < indent; pad++) { buf.append(" "); } // Add the tag or data buf.append(part); // If this is a start tag then increase indent if (part.startsWith("<") && !part.startsWith("</") && !part.endsWith("/>")) { indent++; // Check for special <tag>data</tag> case if ((index + 2) < list.length) { part = (String) list[index + 2]; if (part.startsWith("</")) { part = (String) list[index + 1]; if (!part.startsWith("<")) { buf.append(part); part = (String) list[index + 2]; buf.append(part); index = index + 2; indent--; } } } } } index++; } formatted = new String(buf); } } /** * Listener to handle button actions * * @param e */ public void actionPerformed(ActionEvent e) { Object obj = e.getSource(); if (obj == add_btn) { int selected[] = list1.getSelectedIndices(); int len = selected.length - 1; for (int i = len; i >= 0; i--) { model2.addElement(model1.getElementAt(selected[i])); model1.remove(selected[i]); } if (model1.size() == 0) { add_btn.setEnabled(false); } if (model2.size() > 0) { del_btn.setEnabled(true); } } else if (obj == del_btn) { int selected[] = list2.getSelectedIndices(); int len = selected.length - 1; for (int i = len; i >= 0; i--) { model1.addElement(model2.getElementAt(selected[i])); model2.remove(selected[i]); } if (model2.size() == 0) { del_btn.setEnabled(false); } if (model1.size() > 0) { add_btn.setEnabled(true); } } else if (obj == login_btn) { if (doLogin()) { delPage(); addPage(new SOAPMonitorPage(axisHost)); start(); } else { add_btn.setEnabled(false); del_btn.setEnabled(false); } } else if (obj == save_btn) { String service = null; Node node = null; Node impNode = null; Document wsdd = null; JOptionPane pane = null; JDialog dlg = null; String msg = null; final String title = "Deployment status"; final String deploy = "<deployment name=\"SOAPMonitor\"" + " xmlns=\"http://xml.apache.org/axis/wsdd/\"" + " xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\">\n" + " <handler name=\"soapmonitor\"" + " type=\"java:org.apache.axis.handlers.SOAPMonitorHandler\" />\n" + " </deployment>"; // Create a new wsdd document try { wsdd = XMLUtils.newDocument( new ByteArrayInputStream(deploy.getBytes())); } catch (Exception ex) { ex.printStackTrace(); } Collection col = serviceMap.keySet(); Iterator ite = col.iterator(); // Add all of service nodes to the new wsdd while (ite.hasNext()) { service = (String) ite.next(); node = (Node) serviceMap.get(service); if (model2.contains(service)) { if (isMonitored(node)) { // It's already been monitored impNode = wsdd.importNode(node, true); } else { // It's to be monitored impNode = wsdd.importNode(addMonitor(node), true); } } else { if (isMonitored(node)) { // It's not to be monitored impNode = wsdd.importNode(delMonitor(node), true); } else { // It's not already been monitored impNode = wsdd.importNode(node, true); } } if (service.equals("AdminService")) { // Add "SimpleAuthenticationHandler" and "allowedRoles" parameter // with "admin" as a user account impNode = wsdd.importNode(addAuthenticate(impNode), true); } wsdd.getDocumentElement().appendChild(impNode); } // Show the result of deployment pane = new JOptionPane(); if (doDeploy(wsdd)) { msg = "The deploy was successful."; pane.setMessageType(JOptionPane.INFORMATION_MESSAGE); } else { msg = "The deploy was NOT successful."; pane.setMessageType(JOptionPane.WARNING_MESSAGE); } pane.setOptions(new String[]{"OK"}); pane.setMessage(msg); dlg = pane.createDialog(null, title); dlg.setVisible(true); } } /** * ChangeListener to handle tab actions * * @param e */ public void stateChanged( javax.swing.event.ChangeEvent e ){ JTabbedPane tab = (JTabbedPane)e.getSource(); int item = tab.getSelectedIndex(); if (item==1) { // "Monitoring" tab is selected. start(); } else { // "Setting" tab is selected. stop(); } } }
6,404
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/utils/ParserControl.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // This file is pulled from package org.apache.avalon.excalibur.cli Excalibur // version 4.1 (Jan 30, 2002). Only the package name has been changed. package org.apache.axis.utils; /** * ParserControl is used to control particular behaviour of the parser. * * @author <a href="mailto:peter@apache.org">Peter Donald</a> * @since 4.0 */ public interface ParserControl { boolean isFinished( int lastOptionCode ); }
6,405
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/utils/CLUtil.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // This file is pulled from package org.apache.avalon.excalibur.cli Excalibur // version 4.1 (Jan 30, 2002). Only the package name has been changed. package org.apache.axis.utils; /** * CLUtil offers basic utility operations for use both internal and external to package. * * @author <a href="mailto:peter@apache.org">Peter Donald</a> * @since 4.0 */ public final class CLUtil { private static final int MAX_DESCRIPTION_COLUMN_LENGTH = 60; /** * Format options into StringBuffer and return. This is typically used to * print "Usage" text in response to a "--help" or invalid option. * * @param options the option descriptors * @return the formatted description/help for options */ public static final StringBuffer describeOptions( final CLOptionDescriptor[] options ) { final StringBuffer sb = new StringBuffer(); for( int i = 0; i < options.length; i++ ) { final char ch = (char) options[i].getId(); final String name = options[i].getName(); String description = options[i].getDescription(); int flags = options[i].getFlags(); boolean argumentRequired = ( (flags & CLOptionDescriptor.ARGUMENT_REQUIRED) == CLOptionDescriptor.ARGUMENT_REQUIRED); boolean twoArgumentsRequired = ( (flags & CLOptionDescriptor.ARGUMENTS_REQUIRED_2) == CLOptionDescriptor.ARGUMENTS_REQUIRED_2); boolean needComma = false; if (twoArgumentsRequired) argumentRequired = true; sb.append('\t'); if( Character.isLetter(ch) ) { sb.append( "-" ); sb.append( ch ); needComma = true; } if( null != name ) { if( needComma ) { sb.append( ", " ); } sb.append( "--" ); sb.append( name ); if (argumentRequired) { sb.append(" <argument>"); } if (twoArgumentsRequired) { sb.append("=<value>"); } sb.append( JavaUtils.LS ); } if( null != description ) { while( description.length() > MAX_DESCRIPTION_COLUMN_LENGTH ) { final String descriptionPart = description.substring( 0, MAX_DESCRIPTION_COLUMN_LENGTH ); description = description.substring( MAX_DESCRIPTION_COLUMN_LENGTH ); sb.append( "\t\t" ); sb.append( descriptionPart ); sb.append( JavaUtils.LS ); } sb.append( "\t\t" ); sb.append( description ); sb.append( JavaUtils.LS ); } } return sb; } /** * Private Constructor so that no instance can ever be created. * */ private CLUtil() { } }
6,406
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/utils/CLOption.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // This file is pulled from package org.apache.avalon.excalibur.cli Excalibur // version 4.1 (Jan 30, 2002). Only the package name has been changed. package org.apache.axis.utils; import java.util.Arrays; /** * Basic class describing an instance of option. * * @author <a href="mailto:peter@apache.org">Peter Donald</a> * @since 4.0 */ public final class CLOption { /** * Value of {@link #getId} when the option is a text argument. */ public static final int TEXT_ARGUMENT = 0; private final int m_id; private String[] m_arguments; /** * Retrieve argument to option if it takes arguments. * * @return the (first) argument */ public final String getArgument() { return getArgument( 0 ); } /** * Retrieve indexed argument to option if it takes arguments. * * @param index The argument index, from 0 to * {@link #getArgumentCount()}-1. * @return the argument */ public final String getArgument( final int index ) { if( null == m_arguments || index < 0 || index >= m_arguments.length ) { return null; } else { return m_arguments[ index ]; } } /** * Retrieve id of option. * * The id is eqivalent to character code if it can be a single letter option. * * @return the id */ public final int getId() { return m_id; } /** * Constructor taking an id (that must be a proper character code) * * @param id the new id */ public CLOption( final int id ) { m_id = id; } /** * Constructor taking argument for option. * * @param argument the argument */ public CLOption( final String argument ) { this( TEXT_ARGUMENT ); addArgument( argument ); } /** * Mutator of Argument property. * * @param argument the argument */ public final void addArgument( final String argument ) { if( null == m_arguments ) m_arguments = new String[] { argument }; else { final String[] arguments = new String[ m_arguments.length + 1 ]; System.arraycopy( m_arguments, 0, arguments, 0, m_arguments.length ); arguments[ m_arguments.length ] = argument; m_arguments = arguments; } } /** * Get number of arguments. */ public final int getArgumentCount() { if( null == m_arguments ) { return 0; } else { return m_arguments.length; } } /** * Convert to String. * * @return the string value */ public final String toString() { final StringBuffer sb = new StringBuffer(); sb.append( "[Option " ); sb.append( (char)m_id ); if( null != m_arguments ) { sb.append( ", " ); sb.append( Arrays.asList( m_arguments ) ); } sb.append( " ]" ); return sb.toString(); } }
6,407
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/utils/Token.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // This file is pulled from package org.apache.avalon.excalibur.cli Excalibur // version 4.1 (Jan 30, 2002). Only the package name has been changed. package org.apache.axis.utils; /** * Token handles tokenizing the CLI arguments * * @author <a href="mailto:peter@apache.org">Peter Donald</a> * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a> * @since 4.0 */ class Token { /** Type for a separator token */ public static final int TOKEN_SEPARATOR = 0; /** Type for a text token */ public static final int TOKEN_STRING = 1; private final int m_type; private final String m_value; /** * New Token object with a type and value */ public Token( final int type, final String value ) { m_type = type; m_value = value; } /** * Get the value of the token */ public final String getValue() { return m_value; } /** * Get the type of the token */ public final int getType() { return m_type; } /** * Convert to a string */ public final String toString() { return new StringBuffer().append(m_type).append(":").append(m_value).toString(); } }
6,408
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/utils/CLArgsParser.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // This file is pulled from package org.apache.avalon.excalibur.cli Excalibur // version 4.1 (Jan 30, 2002). Only the package name has been changed. package org.apache.axis.utils; import java.text.ParseException; import java.util.Hashtable; import java.util.Vector; /** * Parser for command line arguments. * * This parses command lines according to the standard (?) of * GNU utilities. * * Note: This is still used in 1.1 libraries so do not add 1.2+ dependencies. * * @author <a href="mailto:peter@apache.org">Peter Donald</a> * @since 4.0 */ public final class CLArgsParser { private static final int STATE_NORMAL = 0; private static final int STATE_REQUIRE_2ARGS = 1; private static final int STATE_REQUIRE_ARG = 2; private static final int STATE_OPTIONAL_ARG = 3; private static final int STATE_NO_OPTIONS = 4; private static final int STATE_OPTION_MODE = 5; private static final int TOKEN_SEPARATOR = 0; private static final int TOKEN_STRING = 1; private static final char[] ARG2_SEPARATORS = new char[] { (char)0, '=', '-' }; private static final char[] ARG_SEPARATORS = new char[] { (char)0, '=' }; private static final char[] NULL_SEPARATORS = new char[] { (char)0 }; private final CLOptionDescriptor[] m_optionDescriptors; private final Vector m_options; private Hashtable m_optionIndex; private final ParserControl m_control; private String m_errorMessage; private String[] m_unparsedArgs = new String[] {}; //variables used while parsing options. private char ch; private String[] args; private boolean isLong; private int argIndex; private int stringIndex; private int stringLength; //cached character == Integer.MAX_VALUE when invalid private static final int INVALID = Integer.MAX_VALUE; private int m_lastChar = INVALID; private int m_lastOptionId; private CLOption m_option; private int m_state = STATE_NORMAL; public final String[] getUnparsedArgs() { return m_unparsedArgs; } /** * Retrieve a list of options that were parsed from command list. * * @return the list of options */ public final Vector getArguments() { //System.out.println( "Arguments: " + m_options ); return m_options; } /** * Retrieve the {@link CLOption} with specified id, or * <code>null</code> if no command line option is found. * * @param id the command line option id * @return the {@link CLOption} with the specified id, or * <code>null</code> if no CLOption is found. * @see CLOption */ public final CLOption getArgumentById( final int id ) { return (CLOption)m_optionIndex.get( new Integer( id ) ); } /** * Retrieve the {@link CLOption} with specified name, or * <code>null</code> if no command line option is found. * * @param name the command line option name * @return the {@link CLOption} with the specified name, or * <code>null</code> if no CLOption is found. * @see CLOption */ public final CLOption getArgumentByName( final String name) { return (CLOption)m_optionIndex.get( name ); } /** * Get Descriptor for option id. * * @param id the id * @return the descriptor */ private final CLOptionDescriptor getDescriptorFor( final int id ) { for( int i = 0; i < m_optionDescriptors.length; i++ ) { if( m_optionDescriptors[i].getId() == id ) { return m_optionDescriptors[i]; } } return null; } /** * Retrieve a descriptor by name. * * @param name the name * @return the descriptor */ private final CLOptionDescriptor getDescriptorFor( final String name ) { for( int i = 0; i < m_optionDescriptors.length; i++ ) { if( m_optionDescriptors[i].getName().equals( name ) ) { return m_optionDescriptors[i]; } } return null; } /** * Retrieve an error message that occured during parsing if one existed. * * @return the error string */ public final String getErrorString() { //System.out.println( "ErrorString: " + m_errorMessage ); return m_errorMessage; } /** * Require state to be placed in for option. * * @param descriptor the Option Descriptor * @return the state */ private final int getStateFor( final CLOptionDescriptor descriptor ) { int flags = descriptor.getFlags(); if( ( flags & CLOptionDescriptor.ARGUMENTS_REQUIRED_2 ) == CLOptionDescriptor.ARGUMENTS_REQUIRED_2 ) { return STATE_REQUIRE_2ARGS; } else if( ( flags & CLOptionDescriptor.ARGUMENT_REQUIRED ) == CLOptionDescriptor.ARGUMENT_REQUIRED ) { return STATE_REQUIRE_ARG; } else if( ( flags & CLOptionDescriptor.ARGUMENT_OPTIONAL ) == CLOptionDescriptor.ARGUMENT_OPTIONAL ) { return STATE_OPTIONAL_ARG; } else { return STATE_NORMAL; } } /** * Create a parser that can deal with options and parses certain args. * * @param args the args, typically that passed to the * <code>public static void main(String[] args)</code> method. * @param optionDescriptors the option descriptors */ public CLArgsParser( final String[] args, final CLOptionDescriptor[] optionDescriptors, final ParserControl control ) { m_optionDescriptors = optionDescriptors; m_control = control; m_options = new Vector(); this.args = args; try { parse(); checkIncompatibilities( m_options ); buildOptionIndex(); } catch( final ParseException pe ) { m_errorMessage = pe.getMessage(); } //System.out.println( "Built : " + m_options ); //System.out.println( "From : " + Arrays.asList( args ) ); } /** * Check for duplicates of an option. * It is an error to have duplicates unless appropriate flags is set in descriptor. * * @param arguments the arguments */ private final void checkIncompatibilities( final Vector arguments ) throws ParseException { final int size = arguments.size(); for( int i = 0; i < size; i++ ) { final CLOption option = (CLOption)arguments.elementAt( i ); final int id = option.getId(); final CLOptionDescriptor descriptor = getDescriptorFor( id ); //this occurs when id == 0 and user has not supplied a descriptor //for arguments if( null == descriptor ) { continue; } final int[] incompatible = descriptor.getIncompatible(); checkIncompatible( arguments, incompatible, i ); } } private final void checkIncompatible( final Vector arguments, final int[] incompatible, final int original ) throws ParseException { final int size = arguments.size(); for( int i = 0; i < size; i++ ) { if( original == i ) { continue; } final CLOption option = (CLOption)arguments.elementAt( i ); final int id = option.getId(); // final CLOptionDescriptor descriptor = getDescriptorFor( id ); for( int j = 0; j < incompatible.length; j++ ) { if( id == incompatible[ j ] ) { final CLOption originalOption = (CLOption)arguments.elementAt( original ); final int originalId = originalOption.getId(); String message = null; if( id == originalId ) { message = "Duplicate options for " + describeDualOption( originalId ) + " found."; } else { message = "Incompatible options -" + describeDualOption( id ) + " and " + describeDualOption( originalId ) + " found."; } throw new ParseException( message, 0 ); } } } } private final String describeDualOption( final int id ) { final CLOptionDescriptor descriptor = getDescriptorFor( id ); if( null == descriptor ) { return "<parameter>"; } else { final StringBuffer sb = new StringBuffer(); boolean hasCharOption = false; if( Character.isLetter( (char)id ) ) { sb.append( '-' ); sb.append( (char)id ); hasCharOption = true; } final String longOption = descriptor.getName(); if( null != longOption ) { if( hasCharOption ) { sb.append( '/' ); } sb.append( "--" ); sb.append( longOption ); } return sb.toString(); } } /** * Create a parser that deals with options and parses certain args. * * @param args the args * @param optionDescriptors the option descriptors */ public CLArgsParser( final String[] args, final CLOptionDescriptor[] optionDescriptors ) { this( args, optionDescriptors, null ); } /** * Create a string array that is subset of input array. * The sub-array should start at array entry indicated by index. That array element * should only include characters from charIndex onwards. * * @param array[] the original array * @param index the cut-point in array * @param charIndex the cut-point in element of array * @return the result array */ private final String[] subArray( final String[] array, final int index, final int charIndex ) { final int remaining = array.length - index; final String[] result = new String[ remaining ]; if( remaining > 1 ) { System.arraycopy( array, index + 1, result, 1, remaining - 1 ); } result[0] = array[ index ].substring( charIndex - 1 ); return result; } /** * Actually parse arguments * * @param args[] arguments */ private final void parse() throws ParseException { if( 0 == args.length ) { return; } stringLength = args[ argIndex ].length(); //ch = peekAtChar(); while( true ) { ch = peekAtChar(); //System.out.println( "Pre State=" + m_state ); //System.out.println( "Pre Char=" + (char)ch + "/" + (int)ch ); if( argIndex >= args.length ) { break; } if( null != m_control && m_control.isFinished( m_lastOptionId ) ) { //this may need mangling due to peeks m_unparsedArgs = subArray( args, argIndex, stringIndex ); return; } //System.out.println( "State=" + m_state ); //System.out.println( "Char=" + (char)ch + "/" + (int)ch ); if( STATE_OPTION_MODE == m_state ) { //if get to an arg barrier then return to normal mode //else continue accumulating options if( 0 == ch ) { getChar(); //strip the null m_state = STATE_NORMAL; } else { parseShortOption(); } } else if( STATE_NORMAL == m_state ) { parseNormal(); } else if( STATE_NO_OPTIONS == m_state ) { //should never get to here when stringIndex != 0 addOption( new CLOption( args[ argIndex++ ] ) ); } else if( STATE_OPTIONAL_ARG == m_state && '-' == ch ) { m_state = STATE_NORMAL; addOption( m_option ); } else { parseArguments(); } } if( m_option != null ) { if( STATE_OPTIONAL_ARG == m_state ) { m_options.addElement( m_option ); } else if( STATE_REQUIRE_ARG == m_state ) { final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getId() ); final String message = "Missing argument to option " + getOptionDescription( descriptor ); throw new ParseException( message, 0 ); } else if( STATE_REQUIRE_2ARGS == m_state ) { if( 1 == m_option.getArgumentCount() ) { m_option.addArgument( "" ); m_options.addElement( m_option ); } else { final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getId() ); final String message = "Missing argument to option " + getOptionDescription( descriptor ); throw new ParseException( message, 0 ); } } else { throw new ParseException( "IllegalState " + m_state + ": " + m_option, 0 ); } } } private final String getOptionDescription( final CLOptionDescriptor descriptor ) { if( isLong ) { return "--" + descriptor.getName(); } else { return "-" + (char)descriptor.getId(); } } private final char peekAtChar() { if( INVALID == m_lastChar ) { m_lastChar = readChar(); } return (char)m_lastChar; } private final char getChar() { if( INVALID != m_lastChar ) { final char result = (char)m_lastChar; m_lastChar = INVALID; return result; } else { return readChar(); } } private final char readChar() { if( stringIndex >= stringLength ) { argIndex++; stringIndex = 0; if( argIndex < args.length ) { stringLength = args[ argIndex ].length(); } else { stringLength = 0; } return 0; } if( argIndex >= args.length ) return 0; return args[ argIndex ].charAt( stringIndex++ ); } private final Token nextToken( final char[] separators ) { ch = getChar(); if( isSeparator( ch, separators ) ) { ch = getChar(); return new Token( TOKEN_SEPARATOR, null ); } final StringBuffer sb = new StringBuffer(); do { sb.append( ch ); ch = getChar(); } while( !isSeparator( ch, separators ) ); return new Token( TOKEN_STRING, sb.toString() ); } private final boolean isSeparator( final char ch, final char[] separators ) { for( int i = 0; i < separators.length; i++ ) { if( ch == separators[ i ] ) { return true; } } return false; } private final void addOption( final CLOption option ) { m_options.addElement( option ); m_lastOptionId = option.getId(); m_option = null; } private final void parseOption( final CLOptionDescriptor descriptor, final String optionString ) throws ParseException { if( null == descriptor ) { throw new ParseException( "Unknown option " + optionString, 0 ); } m_state = getStateFor( descriptor ); m_option = new CLOption( descriptor.getId() ); if( STATE_NORMAL == m_state ) { addOption( m_option ); } } private final void parseShortOption() throws ParseException { ch = getChar(); final CLOptionDescriptor descriptor = getDescriptorFor( ch ); isLong = false; parseOption( descriptor, "-" + ch ); if( STATE_NORMAL == m_state ) { m_state = STATE_OPTION_MODE; } } private final void parseArguments() throws ParseException { if( STATE_REQUIRE_ARG == m_state ) { if( '=' == ch || 0 == ch ) { getChar(); } final Token token = nextToken( NULL_SEPARATORS ); m_option.addArgument( token.getValue() ); addOption( m_option ); m_state = STATE_NORMAL; } else if( STATE_OPTIONAL_ARG == m_state ) { if( '-' == ch || 0 == ch ) { getChar(); //consume stray character addOption( m_option ); m_state = STATE_NORMAL; return; } if( '=' == ch ) { getChar(); } final Token token = nextToken( NULL_SEPARATORS ); m_option.addArgument( token.getValue() ); addOption( m_option ); m_state = STATE_NORMAL; } else if( STATE_REQUIRE_2ARGS == m_state ) { if( 0 == m_option.getArgumentCount() ) { final Token token = nextToken( ARG_SEPARATORS ); if( TOKEN_SEPARATOR == token.getType() ) { final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getId() ); final String message = "Unable to parse first argument for option " + getOptionDescription( descriptor ); throw new ParseException( message, 0 ); } else { m_option.addArgument( token.getValue() ); } } else //2nd argument { final StringBuffer sb = new StringBuffer(); ch = getChar(); if( '-' == ch ) { m_lastChar = ch; } while( !isSeparator( ch, ARG2_SEPARATORS ) ) { sb.append( ch ); ch = getChar(); } final String argument = sb.toString(); //System.out.println( "Arguement:" + argument ); m_option.addArgument( argument ); addOption( m_option ); m_option = null; m_state = STATE_NORMAL; } } } /** * Parse Options from Normal mode. */ private final void parseNormal() throws ParseException { if( '-' != ch ) { //Parse the arguments that are not options final String argument = nextToken( NULL_SEPARATORS ).getValue(); addOption( new CLOption( argument ) ); m_state = STATE_NORMAL; } else { getChar(); // strip the - if( 0 == peekAtChar() ) { throw new ParseException( "Malformed option -", 0 ); } else { ch = peekAtChar(); //if it is a short option then parse it else ... if( '-' != ch ) { parseShortOption(); } else { getChar(); // strip the - //-- sequence .. it can either mean a change of state //to STATE_NO_OPTIONS or else a long option if( 0 == peekAtChar() ) { getChar(); m_state = STATE_NO_OPTIONS; } else { //its a long option final String optionName = nextToken( ARG_SEPARATORS ).getValue(); final CLOptionDescriptor descriptor = getDescriptorFor( optionName ); isLong = true; parseOption( descriptor, "--" + optionName ); } } } } } /** * Build the m_optionIndex lookup map for the parsed options. */ private final void buildOptionIndex() { m_optionIndex = new Hashtable( m_options.size() * 2 ); for( int i = 0; i < m_options.size(); i++ ) { final CLOption option = (CLOption)m_options.get( i ); final CLOptionDescriptor optionDescriptor = getDescriptorFor( option.getId() ); m_optionIndex.put( new Integer( option.getId() ), option ); if( null != optionDescriptor ) { m_optionIndex.put( optionDescriptor.getName(), option ); } } } }
6,409
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/utils/CLOptionDescriptor.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // This file is pulled from package org.apache.avalon.excalibur.cli Excalibur // version 4.1 (Jan 30, 2002). Only the package name has been changed. package org.apache.axis.utils; /** * Basic class describing an type of option. * Typically, one creates a static array of <code>CLOptionDescriptor</code>s, * and passes it to {@link CLArgsParser#CLArgsParser(String[], CLOptionDescriptor[])}. * * @author <a href="mailto:peter@apache.org">Peter Donald</a> * @since 4.0 */ public final class CLOptionDescriptor { /** Flag to say that one argument is required */ public static final int ARGUMENT_REQUIRED = 1 << 1; /** Flag to say that the argument is optional */ public static final int ARGUMENT_OPTIONAL = 1 << 2; /** Flag to say this option does not take arguments */ public static final int ARGUMENT_DISALLOWED = 1 << 3; /** Flag to say this option requires 2 arguments */ public static final int ARGUMENTS_REQUIRED_2 = 1 << 4; /** Flag to say this option may be repeated on the command line */ public static final int DUPLICATES_ALLOWED = 1 << 5; private final int m_id; private final int m_flags; private final String m_name; private final String m_description; private final int[] m_incompatible; /** * Constructor. * * @param name the name/long option * @param flags the flags * @param id the id/character option * @param description description of option usage */ public CLOptionDescriptor( final String name, final int flags, final int id, final String description ) { this( name, flags, id, description, ((flags & CLOptionDescriptor.DUPLICATES_ALLOWED) > 0) ? new int[] {} : new int[] { id } ); } /** * Constructor. * * @param name the name/long option * @param flags the flags * @param id the id/character option * @param description description of option usage */ public CLOptionDescriptor( final String name, final int flags, final int id, final String description, final int[] incompatable ) { m_id = id; m_name = name; m_flags = flags; m_description = description; m_incompatible = incompatable; } /** * @deprecated Use the correctly spelled {@link #getIncompatible} instead. */ protected final int[] getIncompatble() { return getIncompatible(); } protected final int[] getIncompatible() { return m_incompatible; } /** * Retrieve textual description. * * @return the description */ public final String getDescription() { return m_description; } /** * Retrieve flags about option. * Flags include details such as whether it allows parameters etc. * * @return the flags */ public final int getFlags() { return m_flags; } /** * Retrieve the id for option. * The id is also the character if using single character options. * * @return the id */ public final int getId() { return m_id; } /** * Retrieve name of option which is also text for long option. * * @return name/long option */ public final String getName() { return m_name; } /** * Convert to String. * * @return the converted value to string. */ public final String toString() { return new StringBuffer() .append("[OptionDescriptor ").append(m_name) .append(", ").append(m_id).append(", ").append(m_flags) .append(", ").append(m_description).append(" ]").toString(); } }
6,410
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/wsdl/WSDL2Java.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.axis.wsdl; import org.apache.axis.constants.Scope; import org.apache.axis.utils.CLOption; import org.apache.axis.utils.CLOptionDescriptor; import org.apache.axis.utils.ClassUtils; import org.apache.axis.utils.JavaUtils; import org.apache.axis.utils.Messages; import org.apache.axis.wsdl.gen.Parser; import org.apache.axis.wsdl.gen.WSDL2; import org.apache.axis.wsdl.toJava.Emitter; import org.apache.axis.wsdl.toJava.NamespaceSelector; /** * Command line interface to the WSDL2Java utility */ public class WSDL2Java extends WSDL2 { // Define our short one-letter option identifiers. /** Field SERVER_OPT */ protected static final int SERVER_OPT = 's'; /** Field SKELETON_DEPLOY_OPT */ protected static final int SKELETON_DEPLOY_OPT = 'S'; /** Field NAMESPACE_OPT */ protected static final int NAMESPACE_OPT = 'N'; /** Field NAMESPACE_FILE_OPT */ protected static final int NAMESPACE_FILE_OPT = 'f'; /** Field OUTPUT_OPT */ protected static final int OUTPUT_OPT = 'o'; /** Field SCOPE_OPT */ protected static final int SCOPE_OPT = 'd'; /** Field TEST_OPT */ protected static final int TEST_OPT = 't'; /** Field BUILDFILE_OPT */ protected static final int BUILDFILE_OPT = 'B'; /** Field PACKAGE_OPT */ protected static final int PACKAGE_OPT = 'p'; /** Field ALL_OPT */ protected static final int ALL_OPT = 'a'; /** Field TYPEMAPPING_OPT */ protected static final int TYPEMAPPING_OPT = 'T'; /** Field FACTORY_CLASS_OPT */ protected static final int FACTORY_CLASS_OPT = 'F'; /** Field HELPER_CLASS_OPT */ protected static final int HELPER_CLASS_OPT = 'H'; /** Field USERNAME_OPT */ protected static final int USERNAME_OPT = 'U'; /** Field PASSWORD_OPT */ protected static final int PASSWORD_OPT = 'P'; protected static final int CLASSPATH_OPT = 'X'; /** Field bPackageOpt */ protected boolean bPackageOpt = false; /** Field namespace include */ protected static final int NS_INCLUDE_OPT = 'i'; /** Filed namespace exclude */ protected static final int NS_EXCLUDE_OPT = 'x'; /** Field IMPL_CLASS_OPT */ protected static final int IMPL_CLASS_OPT = 'c'; /** Field ALLOW_INVALID_URL_OPT */ protected static final int ALLOW_INVALID_URL_OPT = 'u'; /** Wrap arrays option */ protected static final int WRAP_ARRAYS_OPT = 'w'; /** Field emitter */ private Emitter emitter; /** * Define the understood options. Each CLOptionDescriptor contains: * - The "long" version of the option. Eg, "help" means that "--help" will * be recognised. * - The option flags, governing the option's argument(s). * - The "short" version of the option. Eg, 'h' means that "-h" will be * recognised. * - A description of the option for the usage message */ protected static final CLOptionDescriptor[] options = new CLOptionDescriptor[]{ new CLOptionDescriptor("server-side", CLOptionDescriptor.ARGUMENT_DISALLOWED, SERVER_OPT, Messages.getMessage("optionSkel00")), new CLOptionDescriptor("skeletonDeploy", CLOptionDescriptor.ARGUMENT_REQUIRED, SKELETON_DEPLOY_OPT, Messages.getMessage("optionSkeletonDeploy00")), new CLOptionDescriptor("NStoPkg", CLOptionDescriptor.DUPLICATES_ALLOWED + CLOptionDescriptor.ARGUMENTS_REQUIRED_2, NAMESPACE_OPT, Messages.getMessage("optionNStoPkg00")), new CLOptionDescriptor("fileNStoPkg", CLOptionDescriptor.ARGUMENT_REQUIRED, NAMESPACE_FILE_OPT, Messages.getMessage("optionFileNStoPkg00")), new CLOptionDescriptor("package", CLOptionDescriptor.ARGUMENT_REQUIRED, PACKAGE_OPT, Messages.getMessage("optionPackage00")), new CLOptionDescriptor("output", CLOptionDescriptor.ARGUMENT_REQUIRED, OUTPUT_OPT, Messages.getMessage("optionOutput00")), new CLOptionDescriptor("deployScope", CLOptionDescriptor.ARGUMENT_REQUIRED, SCOPE_OPT, Messages.getMessage("optionScope00")), new CLOptionDescriptor("testCase", CLOptionDescriptor.ARGUMENT_DISALLOWED, TEST_OPT, Messages.getMessage("optionTest00")), new CLOptionDescriptor("all", CLOptionDescriptor.ARGUMENT_DISALLOWED, ALL_OPT, Messages.getMessage("optionAll00")), new CLOptionDescriptor("typeMappingVersion", CLOptionDescriptor.ARGUMENT_REQUIRED, TYPEMAPPING_OPT, Messages.getMessage("optionTypeMapping00")), new CLOptionDescriptor("factory", CLOptionDescriptor.ARGUMENT_REQUIRED, FACTORY_CLASS_OPT, Messages.getMessage("optionFactory00")), new CLOptionDescriptor("helperGen", CLOptionDescriptor.ARGUMENT_DISALLOWED, HELPER_CLASS_OPT, Messages.getMessage("optionHelper00")), new CLOptionDescriptor("buildFile", CLOptionDescriptor.ARGUMENT_DISALLOWED, BUILDFILE_OPT, Messages.getMessage("optionBuildFile00")), new CLOptionDescriptor("user", CLOptionDescriptor.ARGUMENT_REQUIRED, USERNAME_OPT, Messages.getMessage("optionUsername")), new CLOptionDescriptor("password", CLOptionDescriptor.ARGUMENT_REQUIRED, PASSWORD_OPT, Messages.getMessage("optionPassword")), new CLOptionDescriptor("classpath", CLOptionDescriptor.ARGUMENT_OPTIONAL, CLASSPATH_OPT, Messages.getMessage("optionClasspath")), new CLOptionDescriptor("nsInclude", CLOptionDescriptor.DUPLICATES_ALLOWED + CLOptionDescriptor.ARGUMENT_REQUIRED, NS_INCLUDE_OPT, Messages.getMessage("optionNSInclude")), new CLOptionDescriptor("nsExclude", CLOptionDescriptor.DUPLICATES_ALLOWED + CLOptionDescriptor.ARGUMENT_REQUIRED, NS_EXCLUDE_OPT, Messages.getMessage("optionNSExclude")), new CLOptionDescriptor("implementationClassName", CLOptionDescriptor.ARGUMENT_REQUIRED, IMPL_CLASS_OPT, Messages.getMessage("implementationClassName")), new CLOptionDescriptor("allowInvalidURL", CLOptionDescriptor.ARGUMENT_DISALLOWED, ALLOW_INVALID_URL_OPT, Messages.getMessage("optionAllowInvalidURL")), new CLOptionDescriptor("wrapArrays", CLOptionDescriptor.ARGUMENT_OPTIONAL, WRAP_ARRAYS_OPT, Messages.getMessage("optionWrapArrays")), }; /** * Instantiate a WSDL2Java emitter. */ protected WSDL2Java() { // emitter is the same as the parent's parser variable. Just cast it // here once so we don't have to cast it every time we use it. emitter = (Emitter) parser; addOptions(options); } // ctor /** * Instantiate an extension of the Parser * * @return */ protected Parser createParser() { return new Emitter(); } // createParser /** * Parse an option * * @param option is the option */ protected void parseOption(CLOption option) { switch (option.getId()) { case FACTORY_CLASS_OPT: emitter.setFactory(option.getArgument()); break; case HELPER_CLASS_OPT: emitter.setHelperWanted(true); break; case SKELETON_DEPLOY_OPT: emitter.setSkeletonWanted( JavaUtils.isTrueExplicitly(option.getArgument(0))); // --skeletonDeploy assumes --server-side, so fall thru case SERVER_OPT: emitter.setServerSide(true); break; case NAMESPACE_OPT: String namespace = option.getArgument(0); String packageName = option.getArgument(1); emitter.getNamespaceMap().put(namespace, packageName); break; case NAMESPACE_FILE_OPT: emitter.setNStoPkg(option.getArgument()); break; case PACKAGE_OPT: bPackageOpt = true; emitter.setPackageName(option.getArgument()); break; case OUTPUT_OPT: emitter.setOutputDir(option.getArgument()); break; case SCOPE_OPT: String arg = option.getArgument(); // Provide 'null' default, prevents logging internal error. // we have something different to report here. Scope scope = Scope.getScope(arg, null); if (scope != null) { emitter.setScope(scope); } else { System.err.println(Messages.getMessage("badScope00", arg)); } break; case TEST_OPT: emitter.setTestCaseWanted(true); break; case BUILDFILE_OPT: emitter.setBuildFileWanted(true); break; case ALL_OPT: emitter.setAllWanted(true); break; case TYPEMAPPING_OPT: String tmValue = option.getArgument(); if (tmValue.equals("1.0")) { emitter.setTypeMappingVersion("1.0"); } else if (tmValue.equals("1.1")) { emitter.setTypeMappingVersion("1.1"); } else if (tmValue.equals("1.2")) { emitter.setTypeMappingVersion("1.2"); } else if (tmValue.equals("1.3")) { emitter.setTypeMappingVersion("1.3"); } else { System.out.println( Messages.getMessage("badTypeMappingOption00")); } break; case USERNAME_OPT: emitter.setUsername(option.getArgument()); break; case PASSWORD_OPT: emitter.setPassword(option.getArgument()); break; case CLASSPATH_OPT: ClassUtils.setDefaultClassLoader(ClassUtils.createClassLoader( option.getArgument(), this.getClass().getClassLoader())); break; case NS_INCLUDE_OPT: NamespaceSelector include = new NamespaceSelector(); include.setNamespace(option.getArgument()); emitter.getNamespaceIncludes().add(include); break; case NS_EXCLUDE_OPT: NamespaceSelector exclude = new NamespaceSelector(); exclude.setNamespace(option.getArgument()); emitter.getNamespaceExcludes().add(exclude); break; case IMPL_CLASS_OPT: emitter.setImplementationClassName(option.getArgument()); break; case ALLOW_INVALID_URL_OPT: emitter.setAllowInvalidURL(true); break; case WRAP_ARRAYS_OPT: emitter.setWrapArrays(true); break; default : super.parseOption(option); } } // parseOption /** * validateOptions * This method is invoked after the options are set to validate * the option settings. */ protected void validateOptions() { super.validateOptions(); // validate argument combinations if (emitter.isSkeletonWanted() && !emitter.isServerSide()) { System.out.println(Messages.getMessage("badSkeleton00")); printUsage(); } if (!emitter.getNamespaceMap().isEmpty() && bPackageOpt) { System.out.println(Messages.getMessage("badpackage00")); printUsage(); } } // validateOptions /** * Main * Run the WSDL2Java emitter with the specified command-line arguments * * @param args command-line arguments */ public static void main(String args[]) { WSDL2Java wsdl2java = new WSDL2Java(); wsdl2java.run(args); } }
6,411
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/wsdl/Java2WSDL.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.axis.wsdl; import org.apache.axis.utils.CLArgsParser; import org.apache.axis.utils.CLOption; import org.apache.axis.utils.CLOptionDescriptor; import org.apache.axis.utils.CLUtil; import org.apache.axis.utils.ClassUtils; import org.apache.axis.utils.Messages; import org.apache.axis.wsdl.fromJava.Emitter; import org.apache.axis.encoding.TypeMappingRegistryImpl; import org.apache.axis.encoding.TypeMappingImpl; import java.io.File; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Command line interface to the java2wsdl utility * * @author Ravi Kumar (rkumar@borland.com) * @author Rich Scheuerle (scheu@us.ibm.com) */ public class Java2WSDL { // Define our short one-letter option identifiers. /** Field INHERITED_CLASS_OPT */ protected static final int INHERITED_CLASS_OPT = 'a'; /** Field SOAPACTION_OPT */ protected static final int SOAPACTION_OPT = 'A'; /** Field BINDING_NAME_OPT */ protected static final int BINDING_NAME_OPT = 'b'; /** Field STOP_CLASSES_OPT */ protected static final int STOP_CLASSES_OPT = 'c'; /** Field IMPORT_SCHEMA_OPT */ protected static final int IMPORT_SCHEMA_OPT = 'C'; /** Field EXTRA_CLASSES_OPT */ protected static final int EXTRA_CLASSES_OPT = 'e'; /** Field HELP_OPT */ protected static final int HELP_OPT = 'h'; /** Field IMPL_CLASS_OPT */ protected static final int IMPL_CLASS_OPT = 'i'; /** Field INPUT_OPT */ protected static final int INPUT_OPT = 'I'; /** Field LOCATION_OPT */ protected static final int LOCATION_OPT = 'l'; /** Field LOCATION_IMPORT_OPT */ protected static final int LOCATION_IMPORT_OPT = 'L'; /** Field METHODS_ALLOWED_OPT */ protected static final int METHODS_ALLOWED_OPT = 'm'; /** Field NAMESPACE_OPT */ protected static final int NAMESPACE_OPT = 'n'; /** Field NAMESPACE_IMPL_OPT */ protected static final int NAMESPACE_IMPL_OPT = 'N'; /** Field OUTPUT_OPT */ protected static final int OUTPUT_OPT = 'o'; /** Field OUTPUT_IMPL_OPT */ protected static final int OUTPUT_IMPL_OPT = 'O'; /** Field PACKAGE_OPT */ protected static final int PACKAGE_OPT = 'p'; /** Field PORTTYPE_NAME_OPT */ protected static final int PORTTYPE_NAME_OPT = 'P'; /** Field SERVICE_PORT_NAME_OPT */ protected static final int SERVICE_PORT_NAME_OPT = 's'; /** Field SERVICE_ELEMENT_NAME_OPT */ protected static final int SERVICE_ELEMENT_NAME_OPT = 'S'; /** Field TYPEMAPPING_OPT */ protected static final int TYPEMAPPING_OPT = 'T'; /** Field USE_OPT */ protected static final int USE_OPT = 'u'; /** Field OUTPUT_WSDL_MODE_OPT */ protected static final int OUTPUT_WSDL_MODE_OPT = 'w'; /** Field METHODS_NOTALLOWED_OPT */ protected static final int METHODS_NOTALLOWED_OPT = 'x'; protected static final int CLASSPATH_OPT = 'X'; /** Field STYLE_OPT */ protected static final int STYLE_OPT = 'y'; /** Field DEPLOY_OPT */ protected static final int DEPLOY_OPT = 'd'; /** * Define the understood options. Each CLOptionDescriptor contains: * - The "long" version of the option. Eg, "help" means that "--help" will * be recognised. * - The option flags, governing the option's argument(s). * - The "short" version of the option. Eg, 'h' means that "-h" will be * recognised. * - A description of the option for the usage message */ protected CLOptionDescriptor[] options = new CLOptionDescriptor[]{ new CLOptionDescriptor("help", CLOptionDescriptor.ARGUMENT_DISALLOWED, HELP_OPT, Messages.getMessage("j2wopthelp00")), new CLOptionDescriptor("input", CLOptionDescriptor.ARGUMENT_REQUIRED, INPUT_OPT, Messages.getMessage("j2woptinput00")), new CLOptionDescriptor("output", CLOptionDescriptor.ARGUMENT_REQUIRED, OUTPUT_OPT, Messages.getMessage("j2woptoutput00")), new CLOptionDescriptor("location", CLOptionDescriptor.ARGUMENT_REQUIRED, LOCATION_OPT, Messages.getMessage("j2woptlocation00")), new CLOptionDescriptor("portTypeName", CLOptionDescriptor.ARGUMENT_REQUIRED, PORTTYPE_NAME_OPT, Messages.getMessage("j2woptportTypeName00")), new CLOptionDescriptor("bindingName", CLOptionDescriptor.ARGUMENT_REQUIRED, BINDING_NAME_OPT, Messages.getMessage("j2woptbindingName00")), new CLOptionDescriptor( "serviceElementName", CLOptionDescriptor.ARGUMENT_REQUIRED, SERVICE_ELEMENT_NAME_OPT, Messages.getMessage("j2woptserviceElementName00")), new CLOptionDescriptor("servicePortName", CLOptionDescriptor.ARGUMENT_REQUIRED, SERVICE_PORT_NAME_OPT, Messages.getMessage("j2woptservicePortName00")), new CLOptionDescriptor("namespace", CLOptionDescriptor.ARGUMENT_REQUIRED, NAMESPACE_OPT, Messages.getMessage("j2woptnamespace00")), new CLOptionDescriptor("PkgtoNS", CLOptionDescriptor.DUPLICATES_ALLOWED + CLOptionDescriptor.ARGUMENTS_REQUIRED_2, PACKAGE_OPT, Messages.getMessage("j2woptPkgtoNS00")), new CLOptionDescriptor("methods", CLOptionDescriptor.DUPLICATES_ALLOWED + CLOptionDescriptor.ARGUMENT_REQUIRED, METHODS_ALLOWED_OPT, Messages.getMessage("j2woptmethods00")), new CLOptionDescriptor("all", CLOptionDescriptor.ARGUMENT_DISALLOWED, INHERITED_CLASS_OPT, Messages.getMessage("j2woptall00")), new CLOptionDescriptor("outputWsdlMode", CLOptionDescriptor.ARGUMENT_REQUIRED, OUTPUT_WSDL_MODE_OPT, Messages.getMessage("j2woptoutputWsdlMode00")), new CLOptionDescriptor("locationImport", CLOptionDescriptor.ARGUMENT_REQUIRED, LOCATION_IMPORT_OPT, Messages.getMessage("j2woptlocationImport00")), new CLOptionDescriptor("namespaceImpl", CLOptionDescriptor.ARGUMENT_REQUIRED, NAMESPACE_IMPL_OPT, Messages.getMessage("j2woptnamespaceImpl00")), new CLOptionDescriptor("outputImpl", CLOptionDescriptor.ARGUMENT_REQUIRED, OUTPUT_IMPL_OPT, Messages.getMessage("j2woptoutputImpl00")), new CLOptionDescriptor("implClass", CLOptionDescriptor.ARGUMENT_REQUIRED, IMPL_CLASS_OPT, Messages.getMessage("j2woptimplClass00")), new CLOptionDescriptor("exclude", CLOptionDescriptor.DUPLICATES_ALLOWED + CLOptionDescriptor.ARGUMENT_REQUIRED, METHODS_NOTALLOWED_OPT, Messages.getMessage("j2woptexclude00")), new CLOptionDescriptor("stopClasses", CLOptionDescriptor.DUPLICATES_ALLOWED + CLOptionDescriptor.ARGUMENT_REQUIRED, STOP_CLASSES_OPT, Messages.getMessage("j2woptstopClass00")), new CLOptionDescriptor("typeMappingVersion", CLOptionDescriptor.ARGUMENT_REQUIRED, TYPEMAPPING_OPT, Messages.getMessage("j2wopttypeMapping00")), new CLOptionDescriptor("soapAction", CLOptionDescriptor.ARGUMENT_REQUIRED, SOAPACTION_OPT, Messages.getMessage("j2woptsoapAction00")), new CLOptionDescriptor("style", CLOptionDescriptor.ARGUMENT_REQUIRED, STYLE_OPT, Messages.getMessage("j2woptStyle00")), new CLOptionDescriptor("use", CLOptionDescriptor.ARGUMENT_REQUIRED, USE_OPT, Messages.getMessage("j2woptUse00")), new CLOptionDescriptor("extraClasses", CLOptionDescriptor.DUPLICATES_ALLOWED + CLOptionDescriptor.ARGUMENT_REQUIRED, EXTRA_CLASSES_OPT, Messages.getMessage("j2woptExtraClasses00")), new CLOptionDescriptor("importSchema", CLOptionDescriptor.ARGUMENT_OPTIONAL, IMPORT_SCHEMA_OPT, Messages.getMessage("j2woptImportSchema00")), new CLOptionDescriptor("classpath", CLOptionDescriptor.ARGUMENT_OPTIONAL, CLASSPATH_OPT, Messages.getMessage("optionClasspath")), new CLOptionDescriptor("deploy", CLOptionDescriptor.ARGUMENT_DISALLOWED, DEPLOY_OPT, Messages.getMessage("j2woptDeploy00")), }; /** Field emitter */ protected Emitter emitter; /** Field className */ protected String className = null; /** Field wsdlFilename */ protected String wsdlFilename = null; /** Field wsdlImplFilename */ protected String wsdlImplFilename = null; /** Field namespaceMap */ protected HashMap namespaceMap = new HashMap(); /** Field mode */ protected int mode = Emitter.MODE_ALL; /** Field locationSet */ boolean locationSet = false; /** Field typeMappingVersion */ protected String typeMappingVersion = "1.2"; /** Field isDeplpy */ protected boolean isDeploy = false; /** * The class loader to use to load classes specified on the command line. */ private ClassLoader classLoader = Java2WSDL.class.getClassLoader(); /** * Instantiate a Java2WSDL emitter. */ protected Java2WSDL() { emitter = createEmitter(); } // ctor /** * Instantiate an Emitter * * @return */ protected Emitter createEmitter() { return new Emitter(); } // createEmitter /** * addOptions * Add option descriptions to the tool. Allows * extended classes to add additional options. * * @param newOptions CLOptionDescriptor[] the options */ protected void addOptions(CLOptionDescriptor[] newOptions) { if ((newOptions != null) && (newOptions.length > 0)) { CLOptionDescriptor[] allOptions = new CLOptionDescriptor[options.length + newOptions.length]; System.arraycopy(options, 0, allOptions, 0, options.length); System.arraycopy(newOptions, 0, allOptions, options.length, newOptions.length); options = allOptions; } } /** * Parse an option * * @param option CLOption is the option * @return */ protected boolean parseOption(CLOption option) { String value; boolean status = true; switch (option.getId()) { case CLOption.TEXT_ARGUMENT: if (className != null) { System.out.println( Messages.getMessage( "j2wDuplicateClass00", className, option.getArgument())); printUsage(); status = false; // error } className = option.getArgument(); break; case METHODS_ALLOWED_OPT: emitter.setAllowedMethods(option.getArgument()); break; case INHERITED_CLASS_OPT: emitter.setUseInheritedMethods(true); break; case IMPL_CLASS_OPT: try { emitter.setImplCls(classLoader.loadClass(option.getArgument())); } catch (ClassNotFoundException e) { System.out.println(Messages.getMessage("j2woptBadClass01", e.toString())); status = false; } break; case HELP_OPT: printUsage(); status = false; break; case OUTPUT_WSDL_MODE_OPT: String modeArg = option.getArgument(); if ("All".equalsIgnoreCase(modeArg)) { mode = Emitter.MODE_ALL; } else if ("Interface".equalsIgnoreCase(modeArg)) { mode = Emitter.MODE_INTERFACE; } else if ("Implementation".equalsIgnoreCase(modeArg)) { mode = Emitter.MODE_IMPLEMENTATION; } else { mode = Emitter.MODE_ALL; System.err.println(Messages.getMessage("j2wmodeerror", modeArg)); } break; case OUTPUT_OPT: wsdlFilename = option.getArgument(); break; case INPUT_OPT: emitter.setInputWSDL(option.getArgument()); break; case OUTPUT_IMPL_OPT: wsdlImplFilename = option.getArgument(); break; case PACKAGE_OPT: String packageName = option.getArgument(0); String namespace = option.getArgument(1); namespaceMap.put(packageName, namespace); break; case NAMESPACE_OPT: emitter.setIntfNamespace(option.getArgument()); break; case NAMESPACE_IMPL_OPT: emitter.setImplNamespace(option.getArgument()); break; case SERVICE_ELEMENT_NAME_OPT: emitter.setServiceElementName(option.getArgument()); break; case SERVICE_PORT_NAME_OPT: emitter.setServicePortName(option.getArgument()); break; case LOCATION_OPT: emitter.setLocationUrl(option.getArgument()); locationSet = true; break; case LOCATION_IMPORT_OPT: emitter.setImportUrl(option.getArgument()); break; case METHODS_NOTALLOWED_OPT: emitter.setDisallowedMethods(option.getArgument()); break; case PORTTYPE_NAME_OPT: emitter.setPortTypeName(option.getArgument()); break; case BINDING_NAME_OPT: emitter.setBindingName(option.getArgument()); break; case STOP_CLASSES_OPT: emitter.setStopClasses(option.getArgument()); break; case TYPEMAPPING_OPT: value = option.getArgument(); typeMappingVersion = value; break; case SOAPACTION_OPT: value = option.getArgument(); if (value.equalsIgnoreCase("DEFAULT")) { emitter.setSoapAction("DEFAULT"); } else if (value.equalsIgnoreCase("OPERATION")) { emitter.setSoapAction("OPERATION"); } else if (value.equalsIgnoreCase("NONE")) { emitter.setSoapAction("NONE"); } else { System.out.println( Messages.getMessage("j2wBadSoapAction00")); status = false; } break; case STYLE_OPT: value = option.getArgument(); if (value.equalsIgnoreCase("DOCUMENT") || value.equalsIgnoreCase("RPC") || value.equalsIgnoreCase("WRAPPED")) { emitter.setStyle(value); } else { System.out.println(Messages.getMessage("j2woptBadStyle00")); status = false; } break; case USE_OPT: value = option.getArgument(); if (value.equalsIgnoreCase("LITERAL") || value.equalsIgnoreCase("ENCODED")) { emitter.setUse(value); } else { System.out.println(Messages.getMessage("j2woptBadUse00")); status = false; } break; case EXTRA_CLASSES_OPT: try { emitter.setExtraClasses(option.getArgument(), classLoader); } catch (ClassNotFoundException e) { System.out.println(Messages.getMessage("j2woptBadClass00", e.toString())); status = false; } break; case IMPORT_SCHEMA_OPT: emitter.setInputSchema(option.getArgument()); break; case CLASSPATH_OPT: classLoader = ClassUtils.createClassLoader( option.getArgument(), this.getClass().getClassLoader()); break; case DEPLOY_OPT: isDeploy = true; break; default : break; } return status; } /** * validateOptions * This method is invoked after the options are set to validate * the option settings. * * @return */ protected boolean validateOptions() { // Can't proceed without a class name if ((className == null)) { System.out.println(Messages.getMessage("j2wMissingClass00")); printUsage(); return false; } if (!locationSet && ((mode == Emitter.MODE_ALL) || (mode == Emitter.MODE_IMPLEMENTATION))) { System.out.println(Messages.getMessage("j2wMissingLocation00")); printUsage(); return false; } return true; // a-OK } /** * run * checks the command-line arguments and runs the tool. * * @param args String[] command-line arguments. * @return */ protected int run(String[] args) { // Parse the arguments CLArgsParser argsParser = new CLArgsParser(args, options); // Print parser errors, if any if (null != argsParser.getErrorString()) { System.err.println( Messages.getMessage("j2werror00", argsParser.getErrorString())); printUsage(); return (1); } // Get a list of parsed options List clOptions = argsParser.getArguments(); int size = clOptions.size(); try { // Parse the options and configure the emitter as appropriate. for (int i = 0; i < size; i++) { if (parseOption((CLOption) clOptions.get(i)) == false) { return (1); } } // validate argument combinations if (validateOptions() == false) { return (1); } // Set the namespace map if (!namespaceMap.isEmpty()) { emitter.setNamespaceMap(namespaceMap); } TypeMappingRegistryImpl tmr = new TypeMappingRegistryImpl(); tmr.doRegisterFromVersion(typeMappingVersion); emitter.setTypeMappingRegistry(tmr); // Find the class using the name emitter.setCls(classLoader.loadClass(className)); // Generate a full wsdl, or interface & implementation wsdls if (wsdlImplFilename == null) { emitter.emit(wsdlFilename, mode); } else { emitter.emit(wsdlFilename, wsdlImplFilename); } if (isDeploy) { generateServerSide(emitter, (wsdlImplFilename != null) ? wsdlImplFilename : wsdlFilename); } // everything is good return (0); } catch (Throwable t) { t.printStackTrace(); return (1); } } // run /** * Generate the server side artifacts from the generated WSDL * * @param j2w the Java2WSDL emitter * @param wsdlFileName the generated WSDL file * @throws Exception */ protected void generateServerSide(Emitter j2w, String wsdlFileName) throws Exception { org.apache.axis.wsdl.toJava.Emitter w2j = new org.apache.axis.wsdl.toJava.Emitter(); File wsdlFile = new File(wsdlFileName); w2j.setServiceDesc(j2w.getServiceDesc()); w2j.setQName2ClassMap(j2w.getQName2ClassMap()); w2j.setOutputDir(wsdlFile.getParent()); w2j.setServerSide(true); w2j.setHelperWanted(true); // setup namespace-to-package mapping String ns = j2w.getIntfNamespace(); String pkg = j2w.getCls().getPackage().getName(); w2j.getNamespaceMap().put(ns, pkg); Map nsmap = j2w.getNamespaceMap(); if (nsmap != null) { for (Iterator i = nsmap.keySet().iterator(); i.hasNext(); ) { pkg = (String) i.next(); ns = (String) nsmap.get(pkg); w2j.getNamespaceMap().put(ns, pkg); } } // set 'deploy' mode w2j.setDeploy(true); if (j2w.getImplCls() != null) { w2j.setImplementationClassName(j2w.getImplCls().getName()); } else { if (!j2w.getCls().isInterface()) { w2j.setImplementationClassName(j2w.getCls().getName()); } else { throw new Exception("implementation class is not specified."); } } w2j.run(wsdlFileName); } /** * printUsage * print usage information and quit. */ protected void printUsage() { String lSep = System.getProperty("line.separator"); StringBuffer msg = new StringBuffer(); msg.append("Java2WSDL " + Messages.getMessage("j2wemitter00")).append(lSep); msg.append( Messages.getMessage( "j2wusage00", "java " + getClass().getName() + " [options] class-of-portType")).append(lSep); msg.append(Messages.getMessage("j2woptions00")).append(lSep); msg.append(CLUtil.describeOptions(options).toString()); msg.append(Messages.getMessage("j2wdetails00")).append(lSep); System.out.println(msg.toString()); } /** * Main * Run the Java2WSDL emitter with the specified command-line arguments * * @param args String[] command-line arguments */ public static void main(String args[]) { Java2WSDL java2wsdl = new Java2WSDL(); System.exit(java2wsdl.run(args)); } }
6,412
0
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/wsdl
Create_ds/axis-axis1-java/axis-tools/src/main/java/org/apache/axis/wsdl/gen/WSDL2.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.axis.wsdl.gen; import org.apache.axis.utils.CLArgsParser; import org.apache.axis.utils.CLOption; import org.apache.axis.utils.CLOptionDescriptor; import org.apache.axis.utils.CLUtil; import org.apache.axis.utils.DefaultAuthenticator; import org.apache.axis.utils.Messages; import java.net.Authenticator; import java.net.MalformedURLException; import java.net.URL; import java.util.List; /** * Class WSDL2 * * @version %I%, %G% */ public class WSDL2 { /** Field DEBUG_OPT */ protected static final int DEBUG_OPT = 'D'; /** Field HELP_OPT */ protected static final int HELP_OPT = 'h'; /** Field NETWORK_TIMEOUT_OPT */ protected static final int NETWORK_TIMEOUT_OPT = 'O'; /** Field NOIMPORTS_OPT */ protected static final int NOIMPORTS_OPT = 'n'; /** Field VERBOSE_OPT */ protected static final int VERBOSE_OPT = 'v'; /** Field NOWRAP_OPT */ protected static final int NOWRAP_OPT = 'W'; /** Filed quiet */ protected static final int QUIET_OPT = 'q'; /** Field options */ protected CLOptionDescriptor[] options = new CLOptionDescriptor[]{ new CLOptionDescriptor("help", CLOptionDescriptor.ARGUMENT_DISALLOWED, HELP_OPT, Messages.getMessage("optionHelp00")), new CLOptionDescriptor("verbose", CLOptionDescriptor.ARGUMENT_DISALLOWED, VERBOSE_OPT, Messages.getMessage("optionVerbose00")), new CLOptionDescriptor("noImports", CLOptionDescriptor.ARGUMENT_DISALLOWED, NOIMPORTS_OPT, Messages.getMessage("optionImport00")), new CLOptionDescriptor("timeout", CLOptionDescriptor.ARGUMENT_REQUIRED, NETWORK_TIMEOUT_OPT, Messages.getMessage("optionTimeout00")), new CLOptionDescriptor("Debug", CLOptionDescriptor.ARGUMENT_DISALLOWED, DEBUG_OPT, Messages.getMessage("optionDebug00")), new CLOptionDescriptor("noWrapped", CLOptionDescriptor.ARGUMENT_DISALLOWED, NOWRAP_OPT, Messages.getMessage("optionNoWrap00")), new CLOptionDescriptor("quiet", CLOptionDescriptor.ARGUMENT_DISALLOWED, QUIET_OPT, Messages.getMessage("optionQuiet")) }; /** Field wsdlURI */ protected String wsdlURI = null; /** Field parser */ protected Parser parser; /** * Constructor * Used by extended classes to construct an instance of WSDL2 */ protected WSDL2() { parser = createParser(); } // ctor /** * createParser * Used by extended classes to construct an instance of the Parser * * @return */ protected Parser createParser() { return new Parser(); } // createParser /** * getParser * get the Parser object * * @return */ protected Parser getParser() { return parser; } // getParser /** * addOptions * Add option descriptions to the tool. * * @param newOptions CLOptionDescriptor[] the options */ protected void addOptions(CLOptionDescriptor[] newOptions) { if ((newOptions != null) && (newOptions.length > 0)) { CLOptionDescriptor[] allOptions = new CLOptionDescriptor[options.length + newOptions.length]; System.arraycopy(options, 0, allOptions, 0, options.length); System.arraycopy(newOptions, 0, allOptions, options.length, newOptions.length); options = allOptions; } } // addOptions /** * removeOption * Remove an option description from the tool. * * @param name the name of the CLOptionDescriptor to remove */ protected void removeOption(String name) { int foundOptionIndex = -1; for (int i = 0; i < options.length; i++) { if (options[i].getName().equals(name)) { foundOptionIndex = i; break; } } if (foundOptionIndex != -1) { CLOptionDescriptor[] newOptions = new CLOptionDescriptor[options.length - 1]; System.arraycopy(options, 0, newOptions, 0, foundOptionIndex); if (foundOptionIndex < newOptions.length) { System.arraycopy(options, foundOptionIndex + 1, newOptions, foundOptionIndex, newOptions.length - foundOptionIndex); } options = newOptions; } } // removeOption /** * Parse an option * * @param option CLOption is the option */ protected void parseOption(CLOption option) { switch (option.getId()) { case CLOption.TEXT_ARGUMENT: if (wsdlURI != null) { System.out.println( Messages.getMessage( "w2jDuplicateWSDLURI00", wsdlURI, option.getArgument())); printUsage(); } wsdlURI = option.getArgument(); break; case HELP_OPT: printUsage(); break; case NOIMPORTS_OPT: parser.setImports(false); break; case NETWORK_TIMEOUT_OPT: String timeoutValue = option.getArgument(); long timeout = Long.parseLong(timeoutValue); // Convert seconds to milliseconds. if (timeout > 0) { timeout = timeout * 1000; } parser.setTimeout(timeout); break; case VERBOSE_OPT: parser.setVerbose(true); break; case DEBUG_OPT: parser.setDebug(true); break; case QUIET_OPT: parser.setQuiet(true); break; case NOWRAP_OPT: parser.setNowrap(true); break; } } // parseOption /** * validateOptions * This method is invoked after the options are set to validate and default the options * the option settings. */ protected void validateOptions() { if (wsdlURI == null) { System.out.println(Messages.getMessage("w2jMissingWSDLURI00")); printUsage(); } if (parser.isQuiet()) { if (parser.isVerbose()) { System.out.println(Messages.getMessage("exclusiveQuietVerbose")); printUsage(); } if (parser.isDebug()) { System.out.println(Messages.getMessage("exclusiveQuietDebug")); printUsage(); } } // Set username and password if provided in URL checkForAuthInfo(wsdlURI); Authenticator.setDefault(new DefaultAuthenticator(parser.getUsername(), parser.getPassword())); } // validateOptions /** * checkForAuthInfo * set user and password information * * @param uri */ private void checkForAuthInfo(String uri) { URL url = null; try { url = new URL(uri); } catch (MalformedURLException e) { // not going to have userInfo return; } String userInfo = url.getUserInfo(); if (userInfo != null) { int i = userInfo.indexOf(':'); if (i >= 0) { parser.setUsername(userInfo.substring(0, i)); parser.setPassword(userInfo.substring(i + 1)); } else { parser.setUsername(userInfo); } } } /** * printUsage * print usage information and quit. */ protected void printUsage() { String lSep = System.getProperty("line.separator"); StringBuffer msg = new StringBuffer(); msg.append(Messages.getMessage("usage00", "java " + getClass().getName() + " [options] WSDL-URI")).append(lSep); msg.append(Messages.getMessage("options00")).append(lSep); msg.append(CLUtil.describeOptions(options).toString()); System.out.println(msg.toString()); System.exit(1); } // printUsage /** * run * checkes the command-line arguments and runs the tool. * * @param args String[] command-line arguments. */ protected void run(String[] args) { // Parse the arguments CLArgsParser argsParser = new CLArgsParser(args, options); // Print parser errors, if any if (null != argsParser.getErrorString()) { System.err.println( Messages.getMessage("error01", argsParser.getErrorString())); printUsage(); } // Get a list of parsed options List clOptions = argsParser.getArguments(); int size = clOptions.size(); try { // Parse the options and configure the emitter as appropriate. for (int i = 0; i < size; i++) { parseOption((CLOption) clOptions.get(i)); } // validate argument combinations // validateOptions(); parser.run(wsdlURI); // everything is good System.exit(0); } catch (Throwable t) { t.printStackTrace(); System.exit(1); } } // run /** * Main * Run the tool with the specified command-line arguments * * @param args String[] command-line arguments */ public static void main(String[] args) { WSDL2 wsdl2 = new WSDL2(); wsdl2.run(args); } // main } // class WSDL2
6,413
0
Create_ds/axis-axis1-java
Create_ds/axis-axis1-java/test/AxisTestBase.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test; import org.custommonkey.xmlunit.XMLTestCase; /** * base test class for Axis test cases. * @author steve loughran */ public abstract class AxisTestBase extends XMLTestCase { public AxisTestBase(String s) { super(s); } /** * probe for a property being set in ant terms. * @param propertyname * @return true if the system property is set and set to true or yes */ public static boolean isPropertyTrue(String propertyname) { String setting = System.getProperty(propertyname); return "true".equalsIgnoreCase(setting) || "yes".equalsIgnoreCase(setting); } /** * test for the online tests being enabled * @return true if 'online' tests are allowed. */ public static boolean isOnline() { return isPropertyTrue("test.functional.online"); } }
6,414
0
Create_ds/axis-axis1-java
Create_ds/axis-axis1-java/test/PlaybackService.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test; import org.apache.axis.AxisFault; import org.apache.axis.Message; import org.apache.axis.MessageContext; import org.apache.axis.handlers.BasicHandler; import java.io.FileInputStream; import java.io.FileNotFoundException; /** * A trivial service which simply echoes back a desired SOAP message. This * is useful for testing, as we can simulate responses from particular packages, * bugs, etc. This should be deployed with provider="Handler". * * @author Glen Daniels (gdaniels@apache.org) */ public class PlaybackService extends BasicHandler { /** * Get the filename which contains the response message. Looks in * the MessageContext/service/engine for a "responseFile" property, and * if found simply returns that value. Otherwise defaults to * "response.xml" in the current directory of the server. * * This mechanism can be configured in two ways. First, anyone can set * the "responseFile" property based on the message contents, etc. As long * as this happens earlier in the handler chain, the value will be picked * up and used here. Second, this class can be subclassed and this * method overriden to do the right thing. * * @param context the current MessageContext * @return the filename containing the canned response */ protected String getFilename(MessageContext context) { String filename = context.getStrProp("responseFile"); if (filename == null) { filename = "response.xml"; } return filename; } public void invoke(MessageContext context) throws AxisFault { try { FileInputStream stream = new FileInputStream(getFilename(context)); context.setResponseMessage(new Message(stream)); } catch (FileNotFoundException e) { throw AxisFault.makeFault(e); } } }
6,415
0
Create_ds/axis-axis1-java
Create_ds/axis-axis1-java/test/put.java
package test; import org.apache.axis.Message; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.utils.Options; import java.io.File; import java.io.FileInputStream; /** * A convenient little test program which will send a message as is to * the server. Useful for debugging interoperability problems or * handling of ill-formed messages that are hard to reproduce programmatically. * * Accepts the standard options, followed by a list of files containing * the contents to be sent. */ class put { static void main(String[] args) throws Exception { Options opts = new Options(args); String action = opts.isValueSet('a'); Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(opts.getURL()) ); if (action != null ) { call.setUseSOAPAction( true ); call.setSOAPActionURI( action ); } args = opts.getRemainingArgs(); for (int i=0; i<args.length; i++) { FileInputStream stream = new FileInputStream(new File(args[i])); call.setRequestMessage(new Message(stream)); call.invoke(); System.out.println(call.getResponseMessage().getSOAPPartAsString()); } } }
6,416
0
Create_ds/axis-axis1-java
Create_ds/axis-axis1-java/test/GenericLocalTest.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test; import junit.framework.TestCase; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.configuration.BasicServerConfig; import org.apache.axis.configuration.SimpleProvider; import org.apache.axis.constants.Style; import org.apache.axis.constants.Use; import org.apache.axis.handlers.soap.SOAPService; import org.apache.axis.providers.java.RPCProvider; import org.apache.axis.server.AxisServer; import org.apache.axis.transport.local.LocalTransport; import org.apache.axis.Handler; /** * This is a framework class which handles all the basic stuff necessary * to set up a local "roundtrip" test to an AxisServer. * * To use it - extend this class with your own test. Make sure if you * override setUp() that you call super.setUp() so that the engine gets * initialized correctly. The method deploy() needs to be called to deploy * a target service and set up the transport to talk to it - note that this * is done by default in the no-argument setUp(). If you don't want this * behavior, or want to tweak names/classes, just call super.setUp(false) * instead of super.setUp() and the deploy() call won't happen. * * Then you get a Call object by calling getCall() and you're ready to rock. * * @author Glen Daniels (gdaniels@apache.org) */ public class GenericLocalTest extends TestCase { protected AxisServer server; protected SimpleProvider config; protected LocalTransport transport; protected SOAPService service = null; public GenericLocalTest(String s) { super(s); } /** * Default setUp, which automatically deploys the current class * as a service named "service". Override to switch this off. * * @throws Exception */ protected void setUp() throws Exception { setUp(true); } /** * setUp which allows controlling whether or not deploy() is called. * * @param deploy indicates whether we should call deploy() * @throws Exception */ protected void setUp(boolean deploy) throws Exception { super.setUp(); config = new BasicServerConfig(); server = new AxisServer(config); transport = new LocalTransport(server); if (deploy) deploy(); } /** * Get an initialized Call, ready to invoke us over the local transport. * * @return an initialized Call object. */ public Call getCall() { Call call = new Call(new Service()); call.setTransport(transport); return call; } /** * Convenience method to deploy ourselves as a service */ public void deploy() { deploy("service", this.getClass(), Style.RPC); } /** * Deploy a service to the local server we've set up, and point the * cached local transport object to the desired service name. * * After calling this method, the "service" field will contain the * deployed service, on which you could set other options if * desired. * * @param serviceName the name under which to deploy the service. * @param target class of the service. */ public void deploy(String serviceName, Class target, Style style) { String className = target.getName(); service = new SOAPService(new RPCProvider()); service.setStyle(style); service.setOption("className", className); service.setOption("allowedMethods", "*"); config.deployService(serviceName, service); transport.setRemoteService(serviceName); } public void deploy(String serviceName, Class target, Style style, Use use) { String className = target.getName(); service = new SOAPService(new RPCProvider()); service.setStyle(style); service.setUse(use); service.setOption("className", className); service.setOption("allowedMethods", "*"); config.deployService(serviceName, service); transport.setRemoteService(serviceName); } /** * Deploy a service to the local server we've set up, using a * Handler we provide as the pivot. * * @param serviceName * @param handler */ public void deploy(String serviceName, Handler handler) { service = new SOAPService(handler); config.deployService(serviceName, service); transport.setRemoteService(serviceName); } }
6,417
0
Create_ds/axis-axis1-java/test
Create_ds/axis-axis1-java/test/badWSDL/WSDL2JavaFailuresTestCase.java
package test.badWSDL; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.axis.wsdl.toJava.Emitter; import java.io.File; import java.io.FilenameFilter; /** * This test grabs each WSDL file in the directory and runs WSDL2Java against them. * They should all fail. If one does not, this test fails. */ public class WSDL2JavaFailuresTestCase extends TestCase { private static final String badWSDL = "test" + File.separatorChar + "badWSDL"; private String wsdl; public WSDL2JavaFailuresTestCase(String wsdl) { super("testWSDLFailures"); this.wsdl = wsdl; } /** * Create a test suite with a single test for each WSDL file in this * directory. */ public static Test suite() { TestSuite tests = new TestSuite(); String[] wsdls = getWSDLs(); for (int i = 0; i < wsdls.length; ++i) { tests.addTest(new WSDL2JavaFailuresTestCase(badWSDL + File.separatorChar + wsdls[i])); } return tests; } // suite /** * Get a list of all WSDL files in this directory. */ private static String[] getWSDLs() { String[] wsdls = null; try { File failuresDir = new File(badWSDL); FilenameFilter fnf = new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(".wsdl"); } }; wsdls = failuresDir.list(fnf); } catch (Throwable t) { wsdls = null; } if (wsdls == null) { wsdls = new String[0]; } return wsdls; } // getWSDLs /** * Call WSDL2Java on this WSDL file, failing if WSDL2Java succeeds. */ public void testWSDLFailures() { boolean failed = false; Emitter emitter = new Emitter(); emitter.setTestCaseWanted(true); emitter.setHelperWanted(true); emitter.setImports(true); emitter.setAllWanted(true); emitter.setServerSide(true); emitter.setSkeletonWanted(true); try { emitter.run(wsdl); failed = true; } catch (Throwable e) { } if (failed) { fail("WSDL2Java " + wsdl + " should have failed."); } } // testWSDLFailures } // class WSDL2JavaFailuresTestCase
6,418
0
Create_ds/axis-axis1-java/test
Create_ds/axis-axis1-java/test/badWSDL/PackageTests.java
package test.badWSDL; import junit.framework.Test; import junit.framework.TestSuite; /** */ public class PackageTests { public static void main (String[] args) { junit.textui.TestRunner.run (suite()); } public static Test suite() { TestSuite suite = new TestSuite("All bad WSDL tests"); suite.addTest(WSDL2JavaFailuresTestCase.suite()); return suite; } }
6,419
0
Create_ds/axis-axis1-java/test
Create_ds/axis-axis1-java/test/md5attach/MD5AttachTest.java
package test.md5attach; import org.apache.axis.MessageContext; import org.apache.axis.client.Call; import org.apache.axis.utils.Options; /** * A convenient little test program which will send a message as is to * the server. Useful for debugging interoperability problems or * handling of ill-formed messages that are hard to reproduce programmatically. * * Accepts the standard options, followed by a list of files containing * the contents to be sent. */ public class MD5AttachTest { static void main(String[] args) throws Exception { Options opts = new Options(args); String action = opts.isValueSet('a'); Call call = new Call(opts.getURL()); if (action != null) { call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true)); call.setProperty(Call.SOAPACTION_URI_PROPERTY, action); } args = opts.getRemainingArgs(); if (null == args || args.length != 1) { System.err.println("Must specify file to send as an attachment!"); System.exit(8); } //Create the attachment. javax.activation.DataHandler dh = new javax.activation.DataHandler(new javax.activation.FileDataSource(args[0])); org.apache.axis.message.SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope(); //Build the body elements. javax.xml.parsers.DocumentBuilderFactory dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance(); javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder(); org.w3c.dom.Document doc = db.newDocument(); org.w3c.dom.Element methodElement = doc.createElementNS("foo", "foo:MD5Attach"); org.w3c.dom.Element paramElement = doc.createElementNS("foo", "foo:thefile"); long startTime = System.currentTimeMillis(); methodElement.appendChild(paramElement); paramElement.appendChild(doc.createTextNode("" + startTime)); org.apache.axis.message.SOAPBodyElement sbe = new org.apache.axis.message.SOAPBodyElement(methodElement); env.addBodyElement(sbe); org.apache.axis.Message msg = new org.apache.axis.Message(env); //Add the attachment content to the message. org.apache.axis.attachments.Attachments attachments = msg.getAttachmentsImpl(); org.apache.axis.Part attachmentPart = attachments.createAttachmentPart(dh); String href = attachmentPart.getContentId(); //Have the parameter element set an href attribute to the attachment. paramElement.setAttribute(org.apache.axis.Constants.ATTR_HREF, href); env.clearBody(); env.addBodyElement(sbe); ((org.apache.axis.SOAPPart)msg.getSOAPPart()).setSOAPEnvelope(env); call.setRequestMessage(msg); //go on now.... call.invoke(); MessageContext mc = call.getMessageContext(); // System.out.println(mc.getResponseMessage().getAsString()); env = mc.getResponseMessage().getSOAPEnvelope(); sbe = env.getFirstBody(); org.w3c.dom.Element sbElement = sbe.getAsDOM(); //get the first level accessor ie parameter org.w3c.dom.Node n = sbElement.getFirstChild(); for (; n != null && !(n instanceof org.w3c.dom.Element); n = n.getNextSibling()) ; paramElement = (org.w3c.dom.Element) n; org.w3c.dom.Node respNode = paramElement.getFirstChild(); long elapsedTime = -1; if (respNode != null && respNode instanceof org.w3c.dom.Text) { String respStr = ((org.w3c.dom.Text) respNode).getData(); String timeStr = null; String MD5String = null; java.util.StringTokenizer st = new java.util.StringTokenizer(respStr); while (st.hasMoreTokens()) { String s = st.nextToken().trim(); if (s.startsWith("elapsedTime=")) timeStr = s.substring(12); else if (s.startsWith("MD5=")) MD5String = s.substring(4); } if (timeStr != null) { long time = Long.parseLong(timeStr); timeStr = (time / 100.0) + " sec."; } else { timeStr = "Unknown"; } System.out.println("The time to send was:" + timeStr); if (MD5String == null) { System.err.println("Sorry no MD5 data was received."); } else { System.out.println("Calculating MD5 for local file..."); java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5"); byte[] MD5received = org.apache.axis.encoding.Base64.decode(MD5String); java.io.InputStream attachmentStream = dh.getInputStream(); int bread = 0; byte[] buf = new byte[64 * 1024]; do { bread = attachmentStream.read(buf); if (bread > 0) { md.update(buf, 0, bread); } } while (bread > -1); attachmentStream.close(); buf = null; //Add the mime type to the digest. String contentType = dh.getContentType(); if (contentType != null && contentType.length() != 0) { md.update(contentType.getBytes("US-ASCII")); } byte[] MD5orginal = md.digest(); if (java.util.Arrays.equals(MD5orginal, MD5received)) { System.out.println("All is well with Axis's attachment support!"); System.exit(0); } else { System.err.println("Miss match in MD5"); } } } else { System.err.println("Sorry no returned data."); } System.err.println("You've found a bug:\"http://nagoya.apache.org/bugzilla/\""); System.exit(8); } }
6,420
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/addrNoImplSEI/AddressBookTestCase.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.addrNoImplSEI; import junit.framework.TestCase; /** Test the address book sample code. */ public class AddressBookTestCase extends TestCase { public AddressBookTestCase(String name) { super(name); } public void doTest () throws Exception { String[] args = {}; Main.main(args); } public void testAddressBookService () throws Exception { doTest(); } }
6,421
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/addrNoImplSEI/AddressBookNoImplSEISoapBindingImpl.java
/** * AddressBookNoImplSEISOAPBindingImpl.java * * This file was hand modified from the Emmitter generated code. */ package test.wsdl.addrNoImplSEI; import java.util.Hashtable; import java.util.Map; // Don't implement the AddressBook interface public class AddressBookNoImplSEISoapBindingImpl { private Map addresses = new Hashtable(); public void addEntry(java.lang.String name, test.wsdl.addrNoImplSEI.Address address) throws java.rmi.RemoteException, java.lang.IllegalArgumentException // This should be accepted { if (address == null) { throw new java.lang.IllegalArgumentException(); } this.addresses.put(name, address); } public test.wsdl.addrNoImplSEI.Address getAddressFromName(java.lang.String name) throws java.rmi.RemoteException, javax.xml.rpc.JAXRPCException // This should be accepted { return (test.wsdl.addrNoImplSEI.Address) this.addresses.get(name); } public test.wsdl.addrNoImplSEI.Address[] getAddresses() throws java.rmi.RemoteException { test.wsdl.addrNoImplSEI.Address[] array = new test.wsdl.addrNoImplSEI.Address[this.addresses.size()]; this.addresses.values().toArray(array); return array; } }
6,422
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/addrNoImplSEI/Main.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.addrNoImplSEI; import org.apache.axis.utils.Options; import java.net.URL; /** * This class shows how to use the Call object's ability to * become session aware. * * @author Rob Jellinghaus (robj@unrealities.com) * @author Sanjiva Weerawarana <sanjiva@watson.ibm.com> */ public class Main { static String name1; static Address addr1; static Phone phone1; static { name1 = "Purdue Boilermaker"; addr1 = new Address(); phone1 = new Phone(); addr1.setStreetNum(1); addr1.setStreetName("University Drive"); addr1.setCity("West Lafayette"); addr1.setState(StateType.IN); addr1.setZip(47907); phone1.setAreaCode(765); phone1.setExchange("494"); phone1.setNumber("4900"); addr1.setPhone(phone1); } private static void printAddress (Address ad) { if (ad == null) { System.err.println ("\t[ADDRESS NOT FOUND!]"); return; } System.err.println ("\t" + ad.getStreetNum() + " " + ad.getStreetName()); System.err.println ("\t" + ad.getCity() + ", " + ad.getState() + " " + ad.getZip()); Phone ph = ad.getPhone(); System.err.println ("\tPhone: (" + ph.getAreaCode() + ") " + ph.getExchange() + "-" + ph.getNumber()); } private static Object doit (AddressBookNoImplSEI ab) throws Exception { ab.addEntry (name1, addr1); Address resp = ab.getAddressFromName (name1); // if we are NOT maintaining session, resp must be == null. // If we ARE, resp must be != null. resp = ab.getAddressFromName (name1); // Test NPE try { ab.addEntry(null, null); throw new Exception("Expected exception when calling addEntry with null params"); } catch (org.apache.axis.AxisFault e) { if ("java.lang.IllegalArgumentException".equals(e.getFaultString())) { // Good! Expected this! } else { throw e; // This is not right! } } return resp; } public static void main (String[] args) throws Exception { Options opts = new Options(args); AddressBookNoImplSEIService abs = new AddressBookNoImplSEIServiceLocator(); opts.setDefaultURL( abs.getAddressBookNoImplSEIAddress() ); URL serviceURL = new URL(opts.getURL()); AddressBookNoImplSEI ab1 = null; if (serviceURL == null) { ab1 = abs.getAddressBookNoImplSEI(); } else { ab1 = abs.getAddressBookNoImplSEI(serviceURL); } Object ret = doit (ab1); if (ret != null) { throw new Exception("non-session test expected null response, got "+ret); } AddressBookNoImplSEI ab2 = null; if (serviceURL == null) { ab2 = abs.getAddressBookNoImplSEI(); } else { ab2 = abs.getAddressBookNoImplSEI(serviceURL); } ((AddressBookNoImplSEISoapBindingStub) ab2).setMaintainSession (true); ret = doit (ab2); if (ret == null) { throw new Exception("session test expected non-null response, got "+ret); } } }
6,423
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/addrNoImplSEI/AddressBookDynamicProxyTestCase.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.addrNoImplSEI; import junit.framework.TestCase; import org.apache.axis.transport.http.SimpleAxisWorker; import org.apache.axis.utils.NetworkUtils; import javax.xml.namespace.QName; import javax.xml.rpc.Service; import javax.xml.rpc.ServiceFactory; import javax.xml.rpc.Stub; import javax.xml.rpc.encoding.TypeMapping; import javax.xml.rpc.encoding.TypeMappingRegistry; import java.net.URL; /** * Test the address book sample code using JAX-RPC's Dynamic Proxy support. */ public class AddressBookDynamicProxyTestCase extends TestCase { public AddressBookDynamicProxyTestCase(String name) { super(name); } // Use pure JAX-RPC to talk to the server. public void testAddressBookServiceUsingDynamicProxy() throws Exception { String nameSpaceUri = "http://addrNoImplSEI.wsdl.test"; String serviceName = "AddressBookNoImplSEIService"; String thisHost = NetworkUtils.getLocalHostname(); String thisPort = System.getProperty("test.functional.ServicePort", "8080"); //location of wsdl file String wsdlLocation = "http://" + thisHost + ":" + thisPort + "/axis/services/AddressBookNoImplSEI?WSDL"; URL orgWsdlUrl = new URL(wsdlLocation); ServiceFactory serviceFactory = ServiceFactory.newInstance(); Service addressBookService = serviceFactory.createService(orgWsdlUrl, new QName(nameSpaceUri, serviceName)); // Add the typemapping entries TypeMappingRegistry registry = addressBookService.getTypeMappingRegistry(); TypeMapping map = registry.getDefaultTypeMapping(); map.register(test.wsdl.addrNoImplSEI.Address.class, new QName("urn:AddrNoImplSEI", "Address"), new org.apache.axis.encoding.ser.BeanSerializerFactory(test.wsdl.addrNoImplSEI.Address.class, new QName("urn:AddrNoImplSEI", "Address")), new org.apache.axis.encoding.ser.BeanDeserializerFactory(test.wsdl.addrNoImplSEI.Address.class, new QName("urn:AddrNoImplSEI", "Address"))); map.register(test.wsdl.addrNoImplSEI.Phone.class, new QName("urn:AddrNoImplSEI", ">Phone"), new org.apache.axis.encoding.ser.BeanSerializerFactory(test.wsdl.addrNoImplSEI.Phone.class, new QName("urn:AddrNoImplSEI", ">Phone")), new org.apache.axis.encoding.ser.BeanDeserializerFactory(test.wsdl.addrNoImplSEI.Phone.class, new QName("urn:AddrNoImplSEI", ">Phone"))); map.register(test.wsdl.addrNoImplSEI.StateType.class, new QName("urn:AddrNoImplSEI", "StateType"), new org.apache.axis.encoding.ser.EnumSerializerFactory(test.wsdl.addrNoImplSEI.StateType.class, new QName("urn:AddrNoImplSEI", "StateType")), new org.apache.axis.encoding.ser.EnumDeserializerFactory(test.wsdl.addrNoImplSEI.StateType.class, new QName("urn:AddrNoImplSEI", "StateType"))); AddressBookNoImplSEI myProxy = (AddressBookNoImplSEI) addressBookService.getPort(AddressBookNoImplSEI.class); // Set session on. ((Stub) myProxy)._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE); String name1; Address addr1; Phone phone1; name1 = "Purdue Boilermaker"; addr1 = new Address(); phone1 = new Phone(); addr1.setStreetNum(1); addr1.setStreetName("University Drive"); addr1.setCity("West Lafayette"); addr1.setState(StateType.IN); addr1.setZip(47907); phone1.setAreaCode(765); phone1.setExchange("494"); phone1.setNumber("4900"); addr1.setPhone(phone1); // Add an entry myProxy.addEntry(name1, addr1); // Get the list of entries test.wsdl.addrNoImplSEI.Address[] addresses = myProxy.getAddresses(); assertTrue(addresses.length > 0); } }
6,424
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/opStyles/VerifyTestCase.java
package test.wsdl.opStyles; import java.lang.reflect.Method; import java.util.Vector; // This test makes sure that the OpStyles interface ONLY has oneway and // requestResponse methods and that no other methods, particularly // solicitResponse and notification, exist. public class VerifyTestCase extends junit.framework.TestCase { public VerifyTestCase(String name) { super(name); } public void testOpStyles() { Method[] methods = test.wsdl.opStyles.OpStyles.class.getDeclaredMethods(); boolean sawOneway = false; boolean sawRequestResponse = false; boolean sawSolicitResponse = false; boolean sawNotification = false; Vector others = new Vector(); for (int i = 0; i < methods.length; ++i) { String name = methods[i].getName(); if ("oneway".equals(name)) { sawOneway = true; } else if ("requestResponse".equals(name)) { sawRequestResponse = true; } else { others.add(name); } } assertTrue("Expected method oneWay does not exist on OpStyles", sawOneway == true); assertTrue("Expected method requestResponse does not exist on OpStyles", sawRequestResponse == true); if (others.size() > 0) { String message = "Methods exist on OpStyles but should not: "; boolean needComma = false; for (int i = 0; i < others.size(); ++i) { if (needComma) { message += ", "; } else { needComma = true; } message += (String) others.get(i); } } } // testOpStyles } // class VerifyTestCase
6,425
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/opStylesDoc/VerifyTestCase.java
package test.wsdl.opStylesDoc; import junit.framework.AssertionFailedError; import junit.framework.TestCase; import javax.xml.rpc.ServiceException; import javax.xml.rpc.Stub; import java.rmi.RemoteException; public class VerifyTestCase extends junit.framework.TestCase { public VerifyTestCase(String name) { super(name); } public void testOpStyles() throws Exception { OpStyles binding; try { binding = new OpStyleDocServiceLocator().getOpStylesDoc(); } catch (ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } binding.requestResponse(); binding.requestResponse2(); binding.requestResponse3(null); } // testOpStyles } // class VerifyTestCase
6,426
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/uddiv2/InquiryServiceTestCase.java
/** * InquiryServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2dev Nov 14, 2003 (04:44:28 EST) WSDL2Java emitter. */ package test.wsdl.uddiv2; import java.net.SocketException; import org.apache.axis.AxisFault; public class InquiryServiceTestCase extends junit.framework.TestCase { public InquiryServiceTestCase(java.lang.String name) { super(name); } public void test2InquiryService1Find_business() throws Exception { test.wsdl.uddiv2.inquiry_v2.InquireSoapStub binding; try { binding = (test.wsdl.uddiv2.inquiry_v2.InquireSoapStub) new test.wsdl.uddiv2.InquiryServiceLocator().getInquiryService1(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); test.wsdl.uddiv2.api_v2.Find_business find = new test.wsdl.uddiv2.api_v2.Find_business(); find.setGeneric("2.0"); find.setMaxRows(new Integer(100)); test.wsdl.uddiv2.api_v2.Name[] names = new test.wsdl.uddiv2.api_v2.Name[1]; names[0] = new test.wsdl.uddiv2.api_v2.Name(); names[0].set_value("IBM"); find.setName(names); // Test operation try { test.wsdl.uddiv2.api_v2.BusinessList list = null; list = binding.find_business(find); test.wsdl.uddiv2.api_v2.BusinessInfos infos = list.getBusinessInfos(); test.wsdl.uddiv2.api_v2.BusinessInfo[] infos2 = infos.getBusinessInfo(); for(int i=0;i<infos2.length;i++){ System.out.println(infos2[i].getBusinessKey()); } } catch (test.wsdl.uddiv2.api_v2.DispositionReport e1) { throw new junit.framework.AssertionFailedError("error Exception caught: " + e1); } catch (Exception e) { e.printStackTrace(); if (e instanceof AxisFault) { AxisFault af = (AxisFault) e; if ((af.detail instanceof SocketException) || (af.getFaultCode().getLocalPart().equals("HTTP"))) { System.out.println("Connect failure caused testJWSFault to be skipped."); return; } } throw new Exception("Fault returned from test: " + e); } } }
6,427
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/jaxrpchandler/JAXRPCHandlerTestCase.java
package test.wsdl.jaxrpchandler; import junit.framework.TestCase; import org.apache.axis.client.AdminClient; import org.apache.axis.utils.Admin; import org.apache.axis.utils.Options; import javax.xml.namespace.QName; import javax.xml.rpc.handler.HandlerInfo; import javax.xml.rpc.handler.HandlerRegistry; import java.net.URL; /** * */ public class JAXRPCHandlerTestCase extends TestCase { private static boolean _roundtrip = false; private static int _faultRoundtrip = 0; public static void completeRoundtrip() { _roundtrip = true; } public static void setFaultRoundtrip(int faultCount) { _faultRoundtrip = faultCount; } /** * Default constructor for use as service */ public JAXRPCHandlerTestCase() { super("JAXRPCHandlerTest"); } public JAXRPCHandlerTestCase(String name) { super(name); } public void testStockQuote() throws Exception { String[] args = {}; goStockQuote(args); } public void testHandleFail() throws Exception { String[] args = {}; goFail(args); } public void goStockQuote(String[] args) throws Exception { Options opts = new Options( args ); args = opts.getRemainingArgs(); URL url = new URL(opts.getURL()); String user = opts.getUser(); String passwd = opts.getPassword(); System.out.println("URL is " + url); _roundtrip = false; doTestDeploy(); float val = getQuote(url,false); assertEquals("Stock price is not the expected 55.25 +/- 0.01", val, 55.25, 0.01); assertTrue("Expected setting for config-based handlers should be true", _roundtrip == true); doTestClientUndeploy(); _roundtrip = false; val = getQuote(url,true); assertEquals("Stock price is not the expected 55.25 +/- 0.01", val, 55.25, 0.01); assertTrue("Expected setting for programmatic-based handlers should be true", _roundtrip == true); doTestServerUndeploy(); } public void goFail(String[] args) throws Exception { Options opts = new Options( args ); args = opts.getRemainingArgs(); URL url = new URL(opts.getURL()); String user = opts.getUser(); String passwd = opts.getPassword(); System.out.println("Fail URL is " + url); _faultRoundtrip = 0; doTestDeploy(); try { float val = getQuoteFail(url, true); } catch (Exception e) { // catch and ignore the exception } assertTrue("Expected setting for config-based handlers should be 3" + " (1 Request Client Handler increment, passed in header to Server Handler " + " 1 Fault Server Handler increment, passed back in header to Response Client Handler " + " 1 Response Client Handler increment)", _faultRoundtrip == 3); doTestClientUndeploy(); doTestServerUndeploy(); } public float getQuote (URL url, boolean runJAXRPCHandler) throws Exception { StockQuoteService service = new StockQuoteServiceLocator(); if (runJAXRPCHandler) { HandlerRegistry hr = service.getHandlerRegistry(); java.util.List lhi = new java.util.Vector(); test.wsdl.jaxrpchandler.ClientHandler mh = new test.wsdl.jaxrpchandler.ClientHandler(); Class myhandler = mh.getClass(); HandlerInfo hi = new HandlerInfo(myhandler,null,null); lhi.add(hi); hr.setHandlerChain(new QName("","jaxrpchandler"),lhi); } float res; StockQuote sq = service.getjaxrpchandler(url); res = sq.getQuote("XXX"); return res; } public float getQuoteFail (URL url, boolean runJAXRPCHandler) throws Exception { StockQuoteService service = new StockQuoteServiceLocator(); if (runJAXRPCHandler) { HandlerRegistry hr = service.getHandlerRegistry(); java.util.List lhi = new java.util.Vector(); test.wsdl.jaxrpchandler.ClientHandler mh = new test.wsdl.jaxrpchandler.ClientHandler(); Class myhandler = mh.getClass(); HandlerInfo hi = new HandlerInfo(myhandler,null,null); lhi.add(hi); hr.setHandlerChain(new QName("","jaxrpchandler"),lhi); } float res; StockQuote sq = service.getjaxrpchandler(url); res = sq.getQuote("fail"); return res; } public static void main(String[] args) throws Exception { JAXRPCHandlerTestCase test = new JAXRPCHandlerTestCase("test"); test.goStockQuote(args); test.goFail(args); } public void doTestClientUndeploy() throws Exception { String[] args1 = { "client", "test/wsdl/jaxrpchandler/undeploy.wsdd"}; Admin.main(args1); } public void doTestServerUndeploy() throws Exception { String[] args = { "test/wsdl/jaxrpchandler/undeploy.wsdd"}; AdminClient.main(args); } public void doTestDeploy() throws Exception { String[] args = { "test/wsdl/jaxrpchandler/server_deploy.wsdd"}; AdminClient.main(args); String[] args1 = { "client", "test/wsdl/jaxrpchandler/client_deploy.wsdd"}; Admin.main(args1); } }
6,428
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/jaxrpchandler/ClientHandler.java
package test.wsdl.jaxrpchandler; import javax.xml.namespace.QName; import javax.xml.rpc.handler.Handler; import javax.xml.rpc.handler.HandlerInfo; import javax.xml.rpc.handler.MessageContext; import javax.xml.rpc.handler.soap.SOAPMessageContext; import javax.xml.soap.Name; import javax.xml.soap.SOAPEnvelope; import javax.xml.soap.SOAPHeader; import javax.xml.soap.SOAPBody; import javax.xml.soap.SOAPHeaderElement; import javax.xml.soap.SOAPMessage; import javax.xml.soap.SOAPPart; import java.util.Iterator; /** */ public class ClientHandler implements Handler { private final static String _actorURI = "myActorURI"; /** * Constructor for ClientHandler. */ public ClientHandler() { super(); } /** * @see javax.xml.rpc.handler.Handler#handleRequest(MessageContext) */ public boolean handleRequest(MessageContext context) { System.out.println("Hey - in Handle request"); try { SOAPMessageContext smc = (SOAPMessageContext) context; SOAPMessage msg = smc.getMessage(); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPHeader sh = se.getHeader(); Name name = se.createName( "HeaderTest", "AXIS", "http://xml.apache.org/axis"); SOAPHeaderElement she = sh.addHeaderElement(name); she.setActor(_actorURI); she.addAttribute(se.createName("counter", "", ""), "1"); she.addAttribute(se.createName("faultCounter", "", ""), "1"); } catch (Exception e) { e.printStackTrace(); } return true; } /** * @see javax.xml.rpc.handler.Handler#handleResponse(MessageContext) */ public boolean handleResponse(MessageContext context) { System.out.println("Hey - in Handle response"); try { String counter = null; String faultCounter = null; SOAPMessageContext smc = (SOAPMessageContext) context; SOAPMessage msg = smc.getMessage(); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPHeader sh = se.getHeader(); SOAPBody sb = se.getBody(); Name name = se.createName( "HeaderTest", "AXIS", "http://xml.apache.org/axis"); Iterator iter = sh.extractHeaderElements(_actorURI); while (iter.hasNext()) { SOAPHeaderElement she = (SOAPHeaderElement) iter.next(); counter = she.getAttributeValue(se.createName("counter", "", "")); System.out.println( "The counter in the element sent back is " + counter); faultCounter = she.getAttributeValue(se.createName("faultCounter", "", "")); System.out.println( "The faultCounter in the element sent back is " + faultCounter); } if ((counter != null) && (counter.equals("3")) && (!sb.hasFault())) { JAXRPCHandlerTestCase.completeRoundtrip(); } if ((faultCounter != null) && (faultCounter.equals("3")) && (sb.hasFault())) { JAXRPCHandlerTestCase.setFaultRoundtrip(Integer.parseInt(faultCounter)); } } catch (Exception e) { e.printStackTrace(); } return false; } /** * @see javax.xml.rpc.handler.Handler#handleFault(MessageContext) */ public boolean handleFault(MessageContext context) { return false; } /** * @see javax.xml.rpc.handler.Handler#init(HandlerInfo) */ public void init(HandlerInfo config) { } /** * @see javax.xml.rpc.handler.Handler#destroy() */ public void destroy() { } /** * @see javax.xml.rpc.handler.Handler#getHeaders() */ public QName[] getHeaders() { return null; } }
6,429
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/jaxrpchandler/ServerHandler.java
package test.wsdl.jaxrpchandler; import javax.xml.namespace.QName; import javax.xml.rpc.handler.Handler; import javax.xml.rpc.handler.HandlerInfo; import javax.xml.rpc.handler.MessageContext; import javax.xml.rpc.handler.soap.SOAPMessageContext; import javax.xml.soap.Name; import javax.xml.soap.SOAPEnvelope; import javax.xml.soap.SOAPHeader; import javax.xml.soap.SOAPHeaderElement; import javax.xml.soap.SOAPMessage; import javax.xml.soap.SOAPPart; import java.util.Iterator; /** */ public class ServerHandler implements Handler { private int _counter = 0; private int _faultCounter = 0; public final static String _actorURI = "myActorURI"; /** * Constructor for ClientHandler. */ public ServerHandler() { super(); } /** * @see javax.xml.rpc.handler.Handler#handleRequest(MessageContext) */ public boolean handleRequest(MessageContext context) { System.out.println("Hey - in Handle request"); try { SOAPMessageContext smc = (SOAPMessageContext) context; SOAPMessage msg = smc.getMessage(); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPHeader sh = se.getHeader(); Name name = se.createName("HeaderTest", "AXIS", "http://xml.apache.org/axis"); Iterator iter = sh.extractHeaderElements(_actorURI); while (iter.hasNext()) { SOAPHeaderElement she = (SOAPHeaderElement) iter.next(); String counter = she.getAttributeValue(se.createName("counter","","")); _counter = Integer.parseInt(counter) + 1; String faultCounter = she.getAttributeValue(se.createName("faultCounter","","")); _faultCounter = Integer.parseInt(faultCounter) + 1; // Increment it to 2 } } catch (Exception e) { e.printStackTrace(); } return true; } /** * @see javax.xml.rpc.handler.Handler#handleResponse(MessageContext) */ public boolean handleResponse(MessageContext context) { System.out.println("Hey - in Handle response"); try { SOAPMessageContext smc = (SOAPMessageContext) context; SOAPMessage msg = smc.getMessage(); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPHeader sh = se.getHeader(); Name name = se.createName("HeaderTest", "AXIS", "http://xml.apache.org/axis"); SOAPHeaderElement she = sh.addHeaderElement(name); she.addAttribute(se.createName("counter","",""), new Integer(_counter +1).toString()); she.setActor(_actorURI); } catch (Exception e) { e.printStackTrace(); } return true; } /** * @see javax.xml.rpc.handler.Handler#handleFault(MessageContext) */ public boolean handleFault(MessageContext context) { try { SOAPMessageContext smc = (SOAPMessageContext) context; SOAPMessage msg = smc.getMessage(); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPHeader sh = se.getHeader(); Name name = se.createName("HeaderTest", "AXIS", "http://xml.apache.org/axis"); SOAPHeaderElement she = sh.addHeaderElement(name); she.addAttribute(se.createName("faultCounter","",""), new Integer(_faultCounter +1).toString()); she.setActor(_actorURI); } catch (Exception e) { e.printStackTrace(); } return true; } /** * @see javax.xml.rpc.handler.Handler#init(HandlerInfo) */ public void init(HandlerInfo config) { } /** * @see javax.xml.rpc.handler.Handler#destroy() */ public void destroy() { } /** * @see javax.xml.rpc.handler.Handler#getHeaders() */ public QName[] getHeaders() { return null; } }
6,430
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/jaxrpchandler/StockQuoteImpl.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.jaxrpchandler; /** * See \samples\stock\readme for info. * */ public class StockQuoteImpl { public float getQuote (String symbol) throws Exception { if ( symbol.equals("fail") ) { throw new NullPointerException(); } if ( symbol.equals("XXX") ) return( (float) 55.25 ); else return( 0 ); } }
6,431
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip2/RoundTrip2TestServiceTestCase.java
/** * RoundTrip2TestServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Feb 19, 2005 (03:03:59 EST) WSDL2Java emitter. */ package test.wsdl.roundtrip2; public class RoundTrip2TestServiceTestCase extends junit.framework.TestCase { public RoundTrip2TestServiceTestCase(java.lang.String name) { super(name); } public void testRoundTrip2TestWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2TestAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getServiceName()); assertTrue(service != null); } public void test1RoundTrip2TestBooleanTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation boolean value = false; value = binding.booleanTest(true); // TBD - validate results } public void test2RoundTrip2TestWrapperBooleanTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Boolean value = null; value = binding.wrapperBooleanTest(new java.lang.Boolean(false)); // TBD - validate results } public void test3RoundTrip2TestByteTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation byte value = -3; value = binding.byteTest((byte)0); // TBD - validate results } public void test4RoundTrip2TestWrapperByteTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Byte value = null; value = binding.wrapperByteTest(new java.lang.Byte((byte)0)); // TBD - validate results } public void test5RoundTrip2TestShortTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation short value = -3; value = binding.shortTest((short)0); // TBD - validate results } public void test6RoundTrip2TestWrapperShortTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Short value = null; value = binding.wrapperShortTest(new java.lang.Short((short)0)); // TBD - validate results } public void test7RoundTrip2TestIntTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation int value = -3; value = binding.intTest(0); // TBD - validate results } public void test8RoundTrip2TestWrapperIntegerTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Integer value = null; value = binding.wrapperIntegerTest(new java.lang.Integer(0)); // TBD - validate results } public void test9RoundTrip2TestLongTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation long value = -3; value = binding.longTest(0); // TBD - validate results } public void test10RoundTrip2TestWrapperLongTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Long value = null; value = binding.wrapperLongTest(new java.lang.Long(0)); // TBD - validate results } public void test11RoundTrip2TestFloatTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation float value = -3; value = binding.floatTest(0); // TBD - validate results } public void test12RoundTrip2TestWrapperFloatTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Float value = null; value = binding.wrapperFloatTest(new java.lang.Float(0)); // TBD - validate results } public void test13RoundTrip2TestDoubleTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation double value = -3; value = binding.doubleTest(0); // TBD - validate results } public void test14RoundTrip2TestWrapperDoubleTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Double value = null; value = binding.wrapperDoubleTest(new java.lang.Double(0)); // TBD - validate results } public void test15RoundTrip2TestBooleanArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation boolean[] value = null; value = binding.booleanArrayTest(new boolean[]{true,false}); // TBD - validate results } public void test16RoundTrip2TestByteArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation byte[] value = null; value = binding.byteArrayTest(new byte[]{0xD,0xE}); // TBD - validate results } public void test17RoundTrip2TestShortArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation short[] value = null; value = binding.shortArrayTest(new short[]{3,4}); // TBD - validate results } public void test18RoundTrip2TestIntArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation int[] value = null; value = binding.intArrayTest(new int[]{1,2}); // TBD - validate results } public void test19RoundTrip2TestLongArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation long[] value = null; value = binding.longArrayTest(new long[]{45,64}); // TBD - validate results } public void test20RoundTrip2TestFloatArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation float[] value = null; value = binding.floatArrayTest(new float[]{12,34}); // TBD - validate results } public void test21RoundTrip2TestDoubleArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation double[] value = null; value = binding.doubleArrayTest(new double[]{435,647}); // TBD - validate results } public void test22RoundTrip2TestWrapperBooleanArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Boolean[] value = null; value = binding.wrapperBooleanArrayTest(new java.lang.Boolean[]{Boolean.TRUE, Boolean.FALSE}); // TBD - validate results } public void test23RoundTrip2TestWrapperByteArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Byte[] value = null; value = binding.wrapperByteArrayTest(new java.lang.Byte[]{new Byte((byte)0x3)}); // TBD - validate results } public void test24RoundTrip2TestWrapperShortArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Short[] value = null; value = binding.wrapperShortArrayTest(new java.lang.Short[]{new Short((short)3)}); // TBD - validate results } public void test25RoundTrip2TestWrapperIntArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Integer[] value = null; value = binding.wrapperIntArrayTest(new java.lang.Integer[]{new Integer(4)}); // TBD - validate results } public void test26RoundTrip2TestWrapperLongArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Long[] value = null; value = binding.wrapperLongArrayTest(new java.lang.Long[0]); // TBD - validate results } public void test27RoundTrip2TestWrapperFloatArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Float[] value = null; value = binding.wrapperFloatArrayTest(new java.lang.Float[0]); // TBD - validate results } public void test28RoundTrip2TestWrapperDoubleArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.Double[] value = null; value = binding.wrapperDoubleArrayTest(new java.lang.Double[0]); // TBD - validate results } public void test29RoundTrip2TestBooleanMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation boolean[][] value = null; value = binding.booleanMultiArrayTest(new boolean[0][0]); // TBD - validate results } public void test30RoundTrip2TestByteMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation byte[][] value = null; value = binding.byteMultiArrayTest(new byte[0][0]); // TBD - validate results } public void test31RoundTrip2TestShortMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation short[][] value = null; value = binding.shortMultiArrayTest(new short[0][0]); // TBD - validate results } public void test32RoundTrip2TestIntMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation int[][] value = null; value = binding.intMultiArrayTest(new int[0][0]); // TBD - validate results } public void test33RoundTrip2TestLongMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation long[][] value = null; value = binding.longMultiArrayTest(new long[0][0]); // TBD - validate results } public void test34RoundTrip2TestFloatMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation float[][] value = null; value = binding.floatMultiArrayTest(new float[0][0]); // TBD - validate results } public void test35RoundTrip2TestDoubleMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation double[][] value = null; value = binding.doubleMultiArrayTest(new double[0][0]); // TBD - validate results } public void test36RoundTrip2TestStringTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.String value = null; value = binding.stringTest(new java.lang.String()); // TBD - validate results } public void test37RoundTrip2TestStringArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.String[] value = null; value = binding.stringArrayTest(new java.lang.String[0]); // TBD - validate results } public void test38RoundTrip2TestStringMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.lang.String[][] value = null; value = binding.stringMultiArrayTest(new java.lang.String[0][0]); // TBD - validate results } public void test39RoundTrip2TestCalendarTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.util.Calendar value = null; value = binding.calendarTest(java.util.Calendar.getInstance()); // TBD - validate results } public void test40RoundTrip2TestCalendarArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.util.Calendar[] value = null; value = binding.calendarArrayTest(new java.util.Calendar[0]); // TBD - validate results } public void test41RoundTrip2TestCalendarMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.util.Calendar[][] value = null; value = binding.calendarMultiArrayTest(new java.util.Calendar[0][0]); // TBD - validate results } public void test42RoundTrip2TestBigIntegerTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.math.BigInteger value = null; value = binding.bigIntegerTest(new java.math.BigInteger("0")); // TBD - validate results } public void test43RoundTrip2TestBigIntegerArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.math.BigInteger[] value = null; value = binding.bigIntegerArrayTest(new java.math.BigInteger[0]); // TBD - validate results } public void test44RoundTrip2TestBigIntegerMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.math.BigInteger[][] value = null; value = binding.bigIntegerMultiArrayTest(new java.math.BigInteger[0][0]); // TBD - validate results } public void test45RoundTrip2TestBigDecimalTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.math.BigDecimal value = null; value = binding.bigDecimalTest(new java.math.BigDecimal(0)); // TBD - validate results } public void test46RoundTrip2TestBigDecimalArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.math.BigDecimal[] value = null; value = binding.bigDecimalArrayTest(new java.math.BigDecimal[0]); // TBD - validate results } public void test47RoundTrip2TestBigDecimalMultiArrayTest() throws Exception { test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub binding; try { binding = (test.wsdl.roundtrip2.RoundTrip2TestSoapBindingStub) new test.wsdl.roundtrip2.RoundTrip2TestServiceLocator().getRoundTrip2Test(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation java.math.BigDecimal[][] value = null; value = binding.bigDecimalMultiArrayTest(new java.math.BigDecimal[0][0]); // TBD - validate results } }
6,432
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip2/RoundTrip2SoapBindingImpl.java
package test.wsdl.roundtrip2; import java.math.BigDecimal; import java.math.BigInteger; import java.rmi.RemoteException; import java.util.Calendar; public class RoundTrip2SoapBindingImpl implements test.wsdl.roundtrip2.RoundTrip2Test { /** * Method booleanTest * * @param v * @return * @throws RemoteException */ public boolean booleanTest(boolean v) throws RemoteException { return v; } /** * Method wrapperBooleanTest * * @param v * @return * @throws RemoteException */ public Boolean wrapperBooleanTest(Boolean v) throws RemoteException { return v; } /** * Method byteTest * * @param v * @return * @throws RemoteException */ public byte byteTest(byte v) throws RemoteException { return v; } /** * Method wrapperByteTest * * @param v * @return * @throws RemoteException */ public Byte wrapperByteTest(Byte v) throws RemoteException { return v; } /** * Method shortTest * * @param v * @return * @throws RemoteException */ public short shortTest(short v) throws RemoteException { return v; } /** * Method wrapperShortTest * * @param v * @return * @throws RemoteException */ public Short wrapperShortTest(Short v) throws RemoteException { return v; } /** * Method intTest * * @param v * @return * @throws RemoteException */ public int intTest(int v) throws RemoteException { return v; } /** * Method wrapperIntegerTest * * @param v * @return * @throws RemoteException */ public Integer wrapperIntegerTest(Integer v) throws RemoteException { return v; } /** * Method longTest * * @param v * @return * @throws RemoteException */ public long longTest(long v) throws RemoteException { return v; } /** * Method wrapperLongTest * * @param v * @return * @throws RemoteException */ public Long wrapperLongTest(Long v) throws RemoteException { return v; } /** * Method floatTest * * @param v * @return * @throws RemoteException */ public float floatTest(float v) throws RemoteException { return v; } /** * Method wrapperFloatTest * * @param v * @return * @throws RemoteException */ public Float wrapperFloatTest(Float v) throws RemoteException { return v; } /** * Method doubleTest * * @param v * @return * @throws RemoteException */ public double doubleTest(double v) throws RemoteException { return v; } /** * Method wrapperDoubleTest * * @param v * @return * @throws RemoteException */ public Double wrapperDoubleTest(Double v) throws RemoteException { return v; } /** * Method booleanArrayTest * * @param v * @return * @throws RemoteException */ public boolean[] booleanArrayTest(boolean v[]) throws RemoteException { return v; } /** * Method byteArrayTest * * @param v * @return * @throws RemoteException */ public byte[] byteArrayTest(byte v[]) throws RemoteException { return v; } /** * Method shortArrayTest * * @param v * @return * @throws RemoteException */ public short[] shortArrayTest(short v[]) throws RemoteException { return v; } /** * Method intArrayTest * * @param v * @return * @throws RemoteException */ public int[] intArrayTest(int v[]) throws RemoteException { return v; } /** * Method longArrayTest * * @param v * @return * @throws RemoteException */ public long[] longArrayTest(long v[]) throws RemoteException { return v; } /** * Method floatArrayTest * * @param v * @return * @throws RemoteException */ public float[] floatArrayTest(float v[]) throws RemoteException { return v; } /** * Method doubleArrayTest * * @param v * @return * @throws RemoteException */ public double[] doubleArrayTest(double v[]) throws RemoteException { return v; } /** * Method wrapperBooleanArrayTest * * @param v * @return * @throws RemoteException */ public Boolean[] wrapperBooleanArrayTest(Boolean v[]) throws RemoteException { return v; } /** * Method wrapperByteArrayTest * * @param v * @return * @throws RemoteException */ public Byte[] wrapperByteArrayTest(Byte v[]) throws RemoteException { return v; } /** * Method wrapperShortArrayTest * * @param v * @return * @throws RemoteException */ public Short[] wrapperShortArrayTest(Short v[]) throws RemoteException { return v; } /** * Method wrapperIntArrayTest * * @param v * @return * @throws RemoteException */ public Integer[] wrapperIntArrayTest(Integer v[]) throws RemoteException { return v; } /** * Method wrapperLongArrayTest * * @param v * @return * @throws RemoteException */ public Long[] wrapperLongArrayTest(Long v[]) throws RemoteException { return v; } /** * Method wrapperFloatArrayTest * * @param v * @return * @throws RemoteException */ public Float[] wrapperFloatArrayTest(Float v[]) throws RemoteException { return v; } /** * Method wrapperDoubleArrayTest * * @param v * @return * @throws RemoteException */ public Double[] wrapperDoubleArrayTest(Double v[]) throws RemoteException { return v; } /** * Method booleanMultiArrayTest * * @param v * @return * @throws RemoteException */ public boolean[][] booleanMultiArrayTest(boolean v[][]) throws RemoteException { return v; } /** * Method byteMultiArrayTest * * @param v * @return * @throws RemoteException */ public byte[][] byteMultiArrayTest(byte v[][]) throws RemoteException { return v; } /** * Method shortMultiArrayTest * * @param v * @return * @throws RemoteException */ public short[][] shortMultiArrayTest(short v[][]) throws RemoteException { return v; } /** * Method intMultiArrayTest * * @param v * @return * @throws RemoteException */ public int[][] intMultiArrayTest(int v[][]) throws RemoteException { return v; } /** * Method longMultiArrayTest * * @param v * @return * @throws RemoteException */ public long[][] longMultiArrayTest(long v[][]) throws RemoteException { return v; } /** * Method floatMultiArrayTest * * @param v * @return * @throws RemoteException */ public float[][] floatMultiArrayTest(float v[][]) throws RemoteException { return v; } /** * Method doubleMultiArrayTest * * @param v * @return * @throws RemoteException */ public double[][] doubleMultiArrayTest(double v[][]) throws RemoteException { return v; } /** * Method stringTest * * @param v * @return * @throws RemoteException */ public String stringTest(String v) throws RemoteException { return v; } /** * Method stringArrayTest * * @param v * @return * @throws RemoteException */ public String[] stringArrayTest(String v[]) throws RemoteException { return v; } /** * Method stringMultiArrayTest * * @param v * @return * @throws RemoteException */ public String[][] stringMultiArrayTest(String v[][]) throws RemoteException { return v; } /** * Method calendarTest * * @param v * @return * @throws RemoteException */ public Calendar calendarTest(Calendar v) throws RemoteException { return v; } /** * Method calendarArrayTest * * @param v * @return * @throws RemoteException */ public Calendar[] calendarArrayTest(Calendar v[]) throws RemoteException { return v; } /** * Method calendarMultiArrayTest * * @param v * @return * @throws RemoteException */ public Calendar[][] calendarMultiArrayTest(Calendar v[][]) throws RemoteException { return v; } /** * Method bigIntegerTest * * @param v * @return * @throws RemoteException */ public BigInteger bigIntegerTest(BigInteger v) throws RemoteException { return v; } /** * Method bigIntegerArrayTest * * @param v * @return * @throws RemoteException */ public BigInteger[] bigIntegerArrayTest(BigInteger v[]) throws RemoteException { return v; } /** * Method bigIntegerMultiArrayTest * * @param v * @return * @throws RemoteException */ public BigInteger[][] bigIntegerMultiArrayTest(BigInteger v[][]) throws RemoteException { return v; } /** * Method bigDecimalTest * * @param v * @return * @throws RemoteException */ public BigDecimal bigDecimalTest(BigDecimal v) throws RemoteException { return v; } /** * Method bigDecimalArrayTest * * @param v * @return * @throws RemoteException */ public BigDecimal[] bigDecimalArrayTest(BigDecimal v[]) throws RemoteException { return v; } /** * Method bigDecimalMultiArrayTest * * @param v * @return * @throws RemoteException */ public BigDecimal[][] bigDecimalMultiArrayTest(BigDecimal v[][]) throws RemoteException { return v; } }
6,433
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip2/RoundTrip2Test.java
/** * RoundTrip2Test.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Feb 19, 2005 (03:03:59 EST) WSDL2Java emitter. */ package test.wsdl.roundtrip2; public interface RoundTrip2Test extends java.rmi.Remote { public boolean booleanTest(boolean v) throws java.rmi.RemoteException; public java.lang.Boolean wrapperBooleanTest(java.lang.Boolean v) throws java.rmi.RemoteException; public byte byteTest(byte v) throws java.rmi.RemoteException; public java.lang.Byte wrapperByteTest(java.lang.Byte v) throws java.rmi.RemoteException; public short shortTest(short v) throws java.rmi.RemoteException; public java.lang.Short wrapperShortTest(java.lang.Short v) throws java.rmi.RemoteException; public int intTest(int v) throws java.rmi.RemoteException; public java.lang.Integer wrapperIntegerTest(java.lang.Integer v) throws java.rmi.RemoteException; public long longTest(long v) throws java.rmi.RemoteException; public java.lang.Long wrapperLongTest(java.lang.Long v) throws java.rmi.RemoteException; public float floatTest(float v) throws java.rmi.RemoteException; public java.lang.Float wrapperFloatTest(java.lang.Float v) throws java.rmi.RemoteException; public double doubleTest(double v) throws java.rmi.RemoteException; public java.lang.Double wrapperDoubleTest(java.lang.Double v) throws java.rmi.RemoteException; public boolean[] booleanArrayTest(boolean[] v) throws java.rmi.RemoteException; public byte[] byteArrayTest(byte[] v) throws java.rmi.RemoteException; public short[] shortArrayTest(short[] v) throws java.rmi.RemoteException; public int[] intArrayTest(int[] v) throws java.rmi.RemoteException; public long[] longArrayTest(long[] v) throws java.rmi.RemoteException; public float[] floatArrayTest(float[] v) throws java.rmi.RemoteException; public double[] doubleArrayTest(double[] v) throws java.rmi.RemoteException; public java.lang.Boolean[] wrapperBooleanArrayTest(java.lang.Boolean[] v) throws java.rmi.RemoteException; public java.lang.Byte[] wrapperByteArrayTest(java.lang.Byte[] v) throws java.rmi.RemoteException; public java.lang.Short[] wrapperShortArrayTest(java.lang.Short[] v) throws java.rmi.RemoteException; public java.lang.Integer[] wrapperIntArrayTest(java.lang.Integer[] v) throws java.rmi.RemoteException; public java.lang.Long[] wrapperLongArrayTest(java.lang.Long[] v) throws java.rmi.RemoteException; public java.lang.Float[] wrapperFloatArrayTest(java.lang.Float[] v) throws java.rmi.RemoteException; public java.lang.Double[] wrapperDoubleArrayTest(java.lang.Double[] v) throws java.rmi.RemoteException; public boolean[][] booleanMultiArrayTest(boolean[][] v) throws java.rmi.RemoteException; public byte[][] byteMultiArrayTest(byte[][] v) throws java.rmi.RemoteException; public short[][] shortMultiArrayTest(short[][] v) throws java.rmi.RemoteException; public int[][] intMultiArrayTest(int[][] v) throws java.rmi.RemoteException; public long[][] longMultiArrayTest(long[][] v) throws java.rmi.RemoteException; public float[][] floatMultiArrayTest(float[][] v) throws java.rmi.RemoteException; public double[][] doubleMultiArrayTest(double[][] v) throws java.rmi.RemoteException; public java.lang.String stringTest(java.lang.String v) throws java.rmi.RemoteException; public java.lang.String[] stringArrayTest(java.lang.String[] v) throws java.rmi.RemoteException; public java.lang.String[][] stringMultiArrayTest(java.lang.String[][] v) throws java.rmi.RemoteException; public java.util.Calendar calendarTest(java.util.Calendar v) throws java.rmi.RemoteException; public java.util.Calendar[] calendarArrayTest(java.util.Calendar[] v) throws java.rmi.RemoteException; public java.util.Calendar[][] calendarMultiArrayTest(java.util.Calendar[][] v) throws java.rmi.RemoteException; public java.math.BigInteger bigIntegerTest(java.math.BigInteger v) throws java.rmi.RemoteException; public java.math.BigInteger[] bigIntegerArrayTest(java.math.BigInteger[] v) throws java.rmi.RemoteException; public java.math.BigInteger[][] bigIntegerMultiArrayTest(java.math.BigInteger[][] v) throws java.rmi.RemoteException; public java.math.BigDecimal bigDecimalTest(java.math.BigDecimal v) throws java.rmi.RemoteException; public java.math.BigDecimal[] bigDecimalArrayTest(java.math.BigDecimal[] v) throws java.rmi.RemoteException; public java.math.BigDecimal[][] bigDecimalMultiArrayTest(java.math.BigDecimal[][] v) throws java.rmi.RemoteException; }
6,434
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/marshall3/Marshall3TestPort1SoapBindingImpl.java
/** * Marshall3TestPort1SoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter. */ package test.wsdl.marshall3; import java.rmi.RemoteException; import test.wsdl.marshall3.types.QNameArrayTest; import test.wsdl.marshall3.types.QNameArrayTestResponse; import test.wsdl.marshall3.types.ShortArrayTest; import test.wsdl.marshall3.types.ShortArrayTestResponse; import test.wsdl.marshall3.types.StringArrayTest; import test.wsdl.marshall3.types.StringArrayTestResponse; public class Marshall3TestPort1SoapBindingImpl implements test.wsdl.marshall3.MarshallTest{ public ShortArrayTestResponse shortArrayTest(ShortArrayTest parameters) throws java.rmi.RemoteException { return new ShortArrayTestResponse(parameters.getShortArray()); } public StringArrayTestResponse stringArrayTest(StringArrayTest parameters) throws java.rmi.RemoteException { return new StringArrayTestResponse(parameters.getStringArray()); } public QNameArrayTestResponse qnameArrayTest(QNameArrayTest parameters) throws java.rmi.RemoteException { if (parameters.getQnameArray().length != 3) { throw new java.rmi.RemoteException("Array size mismatch"); } return new QNameArrayTestResponse(parameters.getQnameArray()); } public short[] echoShortListTypeTest(short[] fooShortListTypeRequest) throws java.rmi.RemoteException { return fooShortListTypeRequest; } }
6,435
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/marshall3/MarshallTestServiceTestCase.java
/** * MarshallTestServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter. */ package test.wsdl.marshall3; import javax.xml.namespace.QName; import test.wsdl.marshall3.types.QNameArrayTest; import test.wsdl.marshall3.types.QNameArrayTestResponse; import test.wsdl.marshall3.types.ShortArrayTest; import test.wsdl.marshall3.types.ShortArrayTestResponse; import test.wsdl.marshall3.types.StringArrayTest; import test.wsdl.marshall3.types.StringArrayTestResponse; public class MarshallTestServiceTestCase extends junit.framework.TestCase { public MarshallTestServiceTestCase(java.lang.String name) { super(name); } public void test1Marshall3TestPort1ShortArrayTest() throws Exception { test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding; try { binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub) new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation ShortArrayTestResponse value = null; value = binding.shortArrayTest(new ShortArrayTest(new short[]{1,2,3})); assertEquals(3,value.getShortArray().length); } public void test2Marshall3TestPort1StringArrayTest() throws Exception { test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding; try { binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub) new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation StringArrayTestResponse value = null; value = binding.stringArrayTest(new StringArrayTest(new String[]{"1","2","","4",null,"6"})); // TBD - validate results assertEquals(6,value.getStringArray().length); } public void test2Marshall3TestPort1QnameArrayTest() throws Exception { test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding; try { binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub) new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation QNameArrayTestResponse value = null; QName[] qnames= new QName[3]; qnames[0] = new QName("urn:someNamespaceURI", "localPart"); qnames[1] = new QName("localPartWithoutNS"); qnames[2] = null; value = binding.qnameArrayTest(new QNameArrayTest(qnames)); // TBD - validate results assertEquals("wrong array size", 3, value.getQnameArray().length); assertEquals("qnames[0] not equals", new QName("urn:someNamespaceURI", "localPart"), value.getQnameArray()[0]); assertEquals("qnames[1] not equals", new QName("localPartWithoutNS"), value.getQnameArray()[1]); assertEquals("qnames[2] not equals", null, value.getQnameArray()[2]); } public void test3Marshall3TestPort1EchoShortListTypeTest() throws Exception { test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub binding; try { binding = (test.wsdl.marshall3.Marshall3TestPort1SoapBindingStub) new test.wsdl.marshall3.MarshallTestServiceLocator().getMarshall3TestPort1(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation short[] value = null; value = binding.echoShortListTypeTest(new short[]{1,2,3}); // TBD - validate results assertEquals(3,value.length); } }
6,436
0
Create_ds/axis-axis1-java/test/wsdl/marshall3
Create_ds/axis-axis1-java/test/wsdl/marshall3/types/ShortArrayTestResponse.java
/** * ShortArrayTestResponse.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter. */ package test.wsdl.marshall3.types; public class ShortArrayTestResponse implements java.io.Serializable { private short[] shortArray; public ShortArrayTestResponse() { } public ShortArrayTestResponse( short[] shortArray) { this.shortArray = shortArray; } /** * Gets the shortArray value for this ShortArrayTestResponse. * * @return shortArray */ public short[] getShortArray() { return shortArray; } /** * Sets the shortArray value for this ShortArrayTestResponse. * * @param shortArray */ public void setShortArray(short[] shortArray) { this.shortArray = shortArray; } }
6,437
0
Create_ds/axis-axis1-java/test/wsdl/marshall3
Create_ds/axis-axis1-java/test/wsdl/marshall3/types/StringArrayTest.java
/** * StringArrayTest.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter. */ package test.wsdl.marshall3.types; public class StringArrayTest implements java.io.Serializable { private java.lang.String[] stringArray; public StringArrayTest() { } public StringArrayTest( java.lang.String[] stringArray) { this.stringArray = stringArray; } /** * Gets the stringArray value for this StringArrayTest. * * @return stringArray */ public java.lang.String[] getStringArray() { return stringArray; } /** * Sets the stringArray value for this StringArrayTest. * * @param stringArray */ public void setStringArray(java.lang.String[] stringArray) { this.stringArray = stringArray; } }
6,438
0
Create_ds/axis-axis1-java/test/wsdl/marshall3
Create_ds/axis-axis1-java/test/wsdl/marshall3/types/QNameArrayTestResponse.java
/** * StringArrayTestResponse.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter. */ package test.wsdl.marshall3.types; import javax.xml.namespace.QName; public class QNameArrayTestResponse implements java.io.Serializable { private QName[] qnameArray; public QNameArrayTestResponse() { } public QNameArrayTestResponse( QName[] qnameArray) { this.qnameArray = qnameArray; } /** * Gets the stringArray value for this StringArrayTestResponse. * * @return stringArray */ public QName[] getQnameArray() { return qnameArray; } /** * Sets the stringArray value for this StringArrayTestResponse. * * @param stringArray */ public void setQnameArray(QName[] qnameArray) { this.qnameArray = qnameArray; } }
6,439
0
Create_ds/axis-axis1-java/test/wsdl/marshall3
Create_ds/axis-axis1-java/test/wsdl/marshall3/types/QNameArrayTest.java
/** * StringArrayTest.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter. */ package test.wsdl.marshall3.types; import javax.xml.namespace.QName; public class QNameArrayTest implements java.io.Serializable { private QName[] qnameArray; public QNameArrayTest() { } public QNameArrayTest(QName[] qnameArray) { this.qnameArray = qnameArray; } /** * Gets the stringArray value for this StringArrayTest. * * @return stringArray */ public QName[] getQnameArray() { return qnameArray; } /** * Sets the stringArray value for this StringArrayTest. * * @param stringArray */ public void setQnameArray(QName[] qnameArray) { this.qnameArray = qnameArray; } }
6,440
0
Create_ds/axis-axis1-java/test/wsdl/marshall3
Create_ds/axis-axis1-java/test/wsdl/marshall3/types/StringArrayTestResponse.java
/** * StringArrayTestResponse.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter. */ package test.wsdl.marshall3.types; public class StringArrayTestResponse implements java.io.Serializable { private java.lang.String[] stringArray; public StringArrayTestResponse() { } public StringArrayTestResponse( java.lang.String[] stringArray) { this.stringArray = stringArray; } /** * Gets the stringArray value for this StringArrayTestResponse. * * @return stringArray */ public java.lang.String[] getStringArray() { return stringArray; } /** * Sets the stringArray value for this StringArrayTestResponse. * * @param stringArray */ public void setStringArray(java.lang.String[] stringArray) { this.stringArray = stringArray; } }
6,441
0
Create_ds/axis-axis1-java/test/wsdl/marshall3
Create_ds/axis-axis1-java/test/wsdl/marshall3/types/ShortArrayTest.java
/** * ShortArrayTest.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Apr 29, 2005 (10:05:23 EDT) WSDL2Java emitter. */ package test.wsdl.marshall3.types; public class ShortArrayTest implements java.io.Serializable { private short[] shortArray; public ShortArrayTest() { } public ShortArrayTest( short[] shortArray) { this.shortArray = shortArray; } /** * Gets the shortArray value for this ShortArrayTest. * * @return shortArray */ public short[] getShortArray() { return shortArray; } /** * Sets the shortArray value for this ShortArrayTest. * * @param shortArray */ public void setShortArray(short[] shortArray) { this.shortArray = shortArray; } }
6,442
0
Create_ds/axis-axis1-java/test/wsdl/interop5
Create_ds/axis-axis1-java/test/wsdl/interop5/basetype/InteropTestsBindingImpl.java
/** * InteropTestsBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop5.basetype; public class InteropTestsBindingImpl implements test.wsdl.interop5.basetype.InteropTestsExpType{ public double echoDouble(double inputDouble) throws java.rmi.RemoteException { return inputDouble; } public org.apache.axis.types.Duration echoDuration(org.apache.axis.types.Duration inputDuration) throws java.rmi.RemoteException { return inputDuration; } public java.util.Calendar echoDateTime(java.util.Calendar inputDateTime) throws java.rmi.RemoteException { return inputDateTime; } public org.apache.axis.types.Time echoTime(org.apache.axis.types.Time inputTime) throws java.rmi.RemoteException { return inputTime; } public org.apache.axis.types.YearMonth echoGYearMonth(org.apache.axis.types.YearMonth inputGYearMonth) throws java.rmi.RemoteException { return inputGYearMonth; } public org.apache.axis.types.Year echoGYear(org.apache.axis.types.Year inputGYear) throws java.rmi.RemoteException { return inputGYear; } public org.apache.axis.types.MonthDay echoGMonthDay(org.apache.axis.types.MonthDay inputGMonthDay) throws java.rmi.RemoteException { return inputGMonthDay; } public org.apache.axis.types.Day echoGDay(org.apache.axis.types.Day inputGDay) throws java.rmi.RemoteException { return inputGDay; } public org.apache.axis.types.Month echoGMonth(org.apache.axis.types.Month inputGMonth) throws java.rmi.RemoteException { return inputGMonth; } public org.apache.axis.types.URI echoAnyURI(org.apache.axis.types.URI inputAnyURI) throws java.rmi.RemoteException { return inputAnyURI; } public javax.xml.namespace.QName echoQName(javax.xml.namespace.QName inputQName) throws java.rmi.RemoteException { return inputQName; } public org.apache.axis.types.Notation echoNotation(org.apache.axis.types.Notation inputNotation) throws java.rmi.RemoteException { return inputNotation; } public org.apache.axis.types.Language echoLanguage(org.apache.axis.types.Language inputLanguage) throws java.rmi.RemoteException { return inputLanguage; } public org.apache.axis.types.NMToken echoNMToken(org.apache.axis.types.NMToken inputNMToken) throws java.rmi.RemoteException { return inputNMToken; } public org.apache.axis.types.NMTokens echoNMTokens(org.apache.axis.types.NMTokens inputNMTokens) throws java.rmi.RemoteException { return inputNMTokens; } public org.apache.axis.types.Name echoName(org.apache.axis.types.Name inputName) throws java.rmi.RemoteException { return inputName; } public org.apache.axis.types.NCName echoNCName(org.apache.axis.types.NCName inputNCName) throws java.rmi.RemoteException { return inputNCName; } public org.apache.axis.types.Id echoID(org.apache.axis.types.Id inputID) throws java.rmi.RemoteException { return inputID; } public org.apache.axis.types.IDRef echoIDREF(org.apache.axis.types.IDRef inputIDREF) throws java.rmi.RemoteException { return inputIDREF; } public org.apache.axis.types.IDRefs echoIDREFS(org.apache.axis.types.IDRefs inputIDREFS) throws java.rmi.RemoteException { return inputIDREFS; } public org.apache.axis.types.Entity echoEntity(org.apache.axis.types.Entity inputEntity) throws java.rmi.RemoteException { return inputEntity; } public org.apache.axis.types.Entities echoEntities(org.apache.axis.types.Entities inputEntities) throws java.rmi.RemoteException { return inputEntities; } public org.apache.axis.types.NonPositiveInteger echoNonPositiveInteger(org.apache.axis.types.NonPositiveInteger inputNonPositiveInteger) throws java.rmi.RemoteException { return inputNonPositiveInteger; } public org.apache.axis.types.NegativeInteger echoNegativeInteger(org.apache.axis.types.NegativeInteger inputNegativeInteger) throws java.rmi.RemoteException { return inputNegativeInteger; } public long echoLong(long inputLong) throws java.rmi.RemoteException { return inputLong; } public int echoInt(int inputInt) throws java.rmi.RemoteException { return -3; } public short echoShort(short inputShort) throws java.rmi.RemoteException { return (short)-3; } public byte echoByte(byte inputByte) throws java.rmi.RemoteException { return (byte)-3; } public org.apache.axis.types.NonNegativeInteger echoNonNegativeInteger(org.apache.axis.types.NonNegativeInteger inputNonNegativeInteger) throws java.rmi.RemoteException { return inputNonNegativeInteger; } public org.apache.axis.types.UnsignedLong echoUnsignedLong(org.apache.axis.types.UnsignedLong inputUnsignedLong) throws java.rmi.RemoteException { return inputUnsignedLong; } public org.apache.axis.types.UnsignedInt echoUnsignedInt(org.apache.axis.types.UnsignedInt inputUnsignedInt) throws java.rmi.RemoteException { return inputUnsignedInt; } public org.apache.axis.types.UnsignedShort echoUnsignedShort(org.apache.axis.types.UnsignedShort inputUnsignedShort) throws java.rmi.RemoteException { return inputUnsignedShort; } public org.apache.axis.types.UnsignedByte echoUnsignedByte(org.apache.axis.types.UnsignedByte inputUnsignedByte) throws java.rmi.RemoteException { return inputUnsignedByte; } public org.apache.axis.types.PositiveInteger echoPositiveInteger(org.apache.axis.types.PositiveInteger inputPositiveInteger) throws java.rmi.RemoteException { return inputPositiveInteger; } }
6,443
0
Create_ds/axis-axis1-java/test/wsdl/interop5
Create_ds/axis-axis1-java/test/wsdl/interop5/basetype/BaseTypesInteropTestsTestCase.java
/** * BaseTypesInteropTestsTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop5.basetype; import org.apache.axis.types.NMToken; import org.apache.axis.types.NMTokens; import org.apache.axis.types.IDRef; import org.apache.axis.types.IDRefs; import java.net.URL; public class BaseTypesInteropTestsTestCase extends junit.framework.TestCase { public static URL url = null; public static void main(String[] args) throws Exception { if (args.length == 1) { url = new URL(args[0]); } else { url = new URL(new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPortAddress()); } junit.textui.TestRunner.run(new junit.framework.TestSuite(BaseTypesInteropTestsTestCase.class)); } // main protected void setUp() throws Exception { if (url == null) { String urlStr = System.getProperty("testURL"); if (urlStr != null) { url = new URL(urlStr); } } if(url == null) { url = new URL(new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPortAddress()); } } public BaseTypesInteropTestsTestCase(java.lang.String name) { super(name); } public void testInteropTestsPortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getServiceName()); assertTrue(service != null); } public void test1InteropTestsPortEchoDouble() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation double value = -3; value = binding.echoDouble(0); // TBD - validate results } public void test2InteropTestsPortEchoDuration() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Duration value = null; value = binding.echoDuration(new org.apache.axis.types.Duration()); // TBD - validate results } public void test3InteropTestsPortEchoDateTime() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation java.util.Calendar value = null; value = binding.echoDateTime(java.util.Calendar.getInstance()); // TBD - validate results } public void test4InteropTestsPortEchoTime() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Time value = null; value = binding.echoTime(new org.apache.axis.types.Time("15:45:45.275Z")); // TBD - validate results } public void test5InteropTestsPortEchoGYearMonth() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.YearMonth value = null; value = binding.echoGYearMonth(new org.apache.axis.types.YearMonth(2000,1)); // TBD - validate results } public void test6InteropTestsPortEchoGYear() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Year value = null; value = binding.echoGYear(new org.apache.axis.types.Year(2000)); // TBD - validate results } public void test7InteropTestsPortEchoGMonthDay() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.MonthDay value = null; value = binding.echoGMonthDay(new org.apache.axis.types.MonthDay(1, 1)); // TBD - validate results } public void test8InteropTestsPortEchoGDay() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Day value = null; value = binding.echoGDay(new org.apache.axis.types.Day(1)); // TBD - validate results } public void test9InteropTestsPortEchoGMonth() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Month value = null; value = binding.echoGMonth(new org.apache.axis.types.Month(1)); // TBD - validate results } public void test10InteropTestsPortEchoAnyURI() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.URI value = null; value = binding.echoAnyURI(new org.apache.axis.types.URI("urn:testing")); // TBD - validate results } public void test11InteropTestsPortEchoQName() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation javax.xml.namespace.QName value = null; value = binding.echoQName(new javax.xml.namespace.QName("http://double-double", "toil-and-trouble")); // TBD - validate results } public void test12InteropTestsPortEchoNotation() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Notation value = null; value = binding.echoNotation(new org.apache.axis.types.Notation()); // TBD - validate results } public void test13InteropTestsPortEchoLanguage() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Language value = null; value = binding.echoLanguage(new org.apache.axis.types.Language()); // TBD - validate results } public void test14InteropTestsPortEchoNMToken() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.NMToken value = null; NMToken token = new NMToken(); token.setValue("eye_am_an_en_em_tokin"); value = binding.echoNMToken(token); assertEquals(token, value); } public void test15InteropTestsPortEchoNMTokens() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.NMTokens value = null; NMTokens tokens = new NMTokens(); tokens.setValue("one two three"); value = binding.echoNMTokens(tokens); assertEquals(tokens, value); } public void test16InteropTestsPortEchoName() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Name value = null; value = binding.echoName(new org.apache.axis.types.Name()); // TBD - validate results } public void test17InteropTestsPortEchoNCName() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.NCName value = null; value = binding.echoNCName(new org.apache.axis.types.NCName()); // TBD - validate results } public void test18InteropTestsPortEchoID() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Id value = null; value = binding.echoID(new org.apache.axis.types.Id()); // TBD - validate results } public void test19InteropTestsPortEchoIDREF() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.IDRef value = null; IDRef ref = new IDRef(); ref.setValue("THX1138"); value = binding.echoIDREF(ref); assertEquals(ref, value); } public void test20InteropTestsPortEchoIDREFS() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.IDRefs value = null; IDRefs refs = new IDRefs(); refs.setValue("THX1138 R2D2 C3P0"); value = binding.echoIDREFS(refs); assertEquals(refs, value); } public void test21InteropTestsPortEchoEntity() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Entity value = null; value = binding.echoEntity(new org.apache.axis.types.Entity()); // TBD - validate results } public void test22InteropTestsPortEchoEntities() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.Entities value = null; value = binding.echoEntities(new org.apache.axis.types.Entities()); // TBD - validate results } public void test23InteropTestsPortEchoNonPositiveInteger() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.NonPositiveInteger value = null; value = binding.echoNonPositiveInteger(new org.apache.axis.types.NonPositiveInteger("0")); // TBD - validate results } public void test24InteropTestsPortEchoNegativeInteger() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.NegativeInteger value = null; value = binding.echoNegativeInteger(new org.apache.axis.types.NegativeInteger("-1")); // TBD - validate results } public void test25InteropTestsPortEchoLong() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation long value = -3; value = binding.echoLong(0); // TBD - validate results } public void test26InteropTestsPortEchoInt() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation int value = -3; value = binding.echoInt(0); // TBD - validate results } public void test27InteropTestsPortEchoShort() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation short value = -3; value = binding.echoShort((short)0); // TBD - validate results } public void test28InteropTestsPortEchoByte() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation byte value = -3; value = binding.echoByte((byte)0); // TBD - validate results } public void test29InteropTestsPortEchoNonNegativeInteger() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.NonNegativeInteger value = null; value = binding.echoNonNegativeInteger(new org.apache.axis.types.NonNegativeInteger("0")); // TBD - validate results } public void test30InteropTestsPortEchoUnsignedLong() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.UnsignedLong value = null; value = binding.echoUnsignedLong(new org.apache.axis.types.UnsignedLong(0)); // TBD - validate results } public void test31InteropTestsPortEchoUnsignedInt() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.UnsignedInt value = null; value = binding.echoUnsignedInt(new org.apache.axis.types.UnsignedInt(0)); // TBD - validate results } public void test32InteropTestsPortEchoUnsignedShort() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.UnsignedShort value = null; value = binding.echoUnsignedShort(new org.apache.axis.types.UnsignedShort(0)); // TBD - validate results } public void test33InteropTestsPortEchoUnsignedByte() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.UnsignedByte value = null; value = binding.echoUnsignedByte(new org.apache.axis.types.UnsignedByte(0)); // TBD - validate results } public void test34InteropTestsPortEchoPositiveInteger() throws Exception { test.wsdl.interop5.basetype.InteropTestsExpType binding; try { binding = new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation org.apache.axis.types.PositiveInteger value = null; value = binding.echoPositiveInteger(new org.apache.axis.types.PositiveInteger("1")); // TBD - validate results } }
6,444
0
Create_ds/axis-axis1-java/test/wsdl/interop5
Create_ds/axis-axis1-java/test/wsdl/interop5/complextype/ComplexTypeExtensionsServiceTestCase.java
/** * ComplexTypeExtensionsServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop5.complextype; import java.net.URL; public class ComplexTypeExtensionsServiceTestCase extends junit.framework.TestCase { public static URL url = null; protected void setUp() throws Exception { if(url == null) { url = new URL(new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPortAddress()); } } public static void main(String[] args) throws Exception { if (args.length == 1) { url = new URL(args[0]); } else { url = new URL(new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPortAddress()); } junit.textui.TestRunner.run(new junit.framework.TestSuite(ComplexTypeExtensionsServiceTestCase.class)); } // main public ComplexTypeExtensionsServiceTestCase(java.lang.String name) { super(name); } public void testComplexTypeExtensionsPortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getServiceName()); assertTrue(service != null); } public void test1ComplexTypeExtensionsPortEchoBaseType_1() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation test.wsdl.interop5.complextype.types.BaseType input = new test.wsdl.interop5.complextype.types.BaseType(); input.setBaseTypeMember1("echoBaseType_1"); input.setBaseTypeMember2(1); test.wsdl.interop5.complextype.types.holders.BaseTypeHolder inputHolder = new test.wsdl.interop5.complextype.types.holders.BaseTypeHolder(input); binding.echoBaseType_1(inputHolder); test.wsdl.interop5.complextype.types.BaseType output = inputHolder.value; // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); } public void test2ComplexTypeExtensionsPortEchoBaseType_2() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation test.wsdl.interop5.complextype.types.L1DerivedType input = new test.wsdl.interop5.complextype.types.L1DerivedType(); input.setBaseTypeMember1("echoBaseType_2"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L1DerivedType"); test.wsdl.interop5.complextype.types.holders.BaseTypeHolder inputHolder = new test.wsdl.interop5.complextype.types.holders.BaseTypeHolder(input); binding.echoBaseType_2(inputHolder); test.wsdl.interop5.complextype.types.L1DerivedType output = (test.wsdl.interop5.complextype.types.L1DerivedType)inputHolder.value; // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); } public void test3ComplexTypeExtensionsPortEchoBaseType_3() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation test.wsdl.interop5.complextype.types.L2DerivedType1 input = new test.wsdl.interop5.complextype.types.L2DerivedType1(); input.setBaseTypeMember1("echoBaseType_3"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L2DerivedType1"); input.setL2DerivedType1Member(3); test.wsdl.interop5.complextype.types.holders.BaseTypeHolder inputHolder = new test.wsdl.interop5.complextype.types.holders.BaseTypeHolder(input); binding.echoBaseType_3(inputHolder); test.wsdl.interop5.complextype.types.L2DerivedType1 output = (test.wsdl.interop5.complextype.types.L2DerivedType1)inputHolder.value; // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); assertEquals(output.getL2DerivedType1Member(),input.getL2DerivedType1Member()); } public void test4ComplexTypeExtensionsPortEchoBaseType_4() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation test.wsdl.interop5.complextype.types.L2DerivedType2 input = new test.wsdl.interop5.complextype.types.L2DerivedType2(); input.setBaseTypeMember1("echoBaseType_4"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L2DerivedType2"); input.setL2DerivedType2Member(new java.math.BigDecimal(100.00)); test.wsdl.interop5.complextype.types.holders.BaseTypeHolder inputHolder = new test.wsdl.interop5.complextype.types.holders.BaseTypeHolder(input); binding.echoBaseType_4(inputHolder); test.wsdl.interop5.complextype.types.L2DerivedType2 output = (test.wsdl.interop5.complextype.types.L2DerivedType2)inputHolder.value; // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); assertEquals(output.getL2DerivedType2Member(),input.getL2DerivedType2Member()); } public void test5ComplexTypeExtensionsPortEchoBaseType_5() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation test.wsdl.interop5.complextype.types.L3DerivedType input = new test.wsdl.interop5.complextype.types.L3DerivedType(); input.setBaseTypeMember1("echoBaseType_5"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L3DerivedType"); input.setL2DerivedType2Member(new java.math.BigDecimal(100.00)); input.setL3DerivedTypeMember((short)5); test.wsdl.interop5.complextype.types.holders.BaseTypeHolder inputHolder = new test.wsdl.interop5.complextype.types.holders.BaseTypeHolder(input); binding.echoBaseType_5(inputHolder); test.wsdl.interop5.complextype.types.L3DerivedType output = (test.wsdl.interop5.complextype.types.L3DerivedType)inputHolder.value; // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); assertEquals(output.getL2DerivedType2Member(),input.getL2DerivedType2Member()); assertEquals(output.getL3DerivedTypeMember(),input.getL3DerivedTypeMember()); } public void test6ComplexTypeExtensionsPortEchoL1DerivedType_1() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation test.wsdl.interop5.complextype.types.L1DerivedType input = new test.wsdl.interop5.complextype.types.L1DerivedType(); input.setBaseTypeMember1("echoL1DerivedType_1"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L1DerivedType"); test.wsdl.interop5.complextype.types.holders.L1DerivedTypeHolder inputHolder = new test.wsdl.interop5.complextype.types.holders.L1DerivedTypeHolder(input); binding.echoL1DerivedType_1(inputHolder); test.wsdl.interop5.complextype.types.L1DerivedType output = inputHolder.value; // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); } public void test7ComplexTypeExtensionsPortEchoL1DerivedType_2() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation test.wsdl.interop5.complextype.types.L2DerivedType1 input = new test.wsdl.interop5.complextype.types.L2DerivedType1(); input.setBaseTypeMember1("echoL1DerivedType_1"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L2DerivedType1"); input.setL2DerivedType1Member(5); test.wsdl.interop5.complextype.types.holders.L1DerivedTypeHolder inputHolder = new test.wsdl.interop5.complextype.types.holders.L1DerivedTypeHolder(input); binding.echoL1DerivedType_2(inputHolder); test.wsdl.interop5.complextype.types.L2DerivedType1 output = (test.wsdl.interop5.complextype.types.L2DerivedType1)inputHolder.value; // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); assertEquals(output.getL2DerivedType1Member(),input.getL2DerivedType1Member()); } public void test8ComplexTypeExtensionsPortEchoL2DerivedType1_1() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation test.wsdl.interop5.complextype.types.L2DerivedType1 input = new test.wsdl.interop5.complextype.types.L2DerivedType1(); input.setBaseTypeMember1("echoL2DerivedType1_1"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L2DerivedType1"); input.setL2DerivedType1Member(5); test.wsdl.interop5.complextype.types.holders.L2DerivedType1Holder inputHolder = new test.wsdl.interop5.complextype.types.holders.L2DerivedType1Holder(input); binding.echoL2DerivedType1_1(inputHolder); test.wsdl.interop5.complextype.types.L2DerivedType1 output = inputHolder.value; // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); assertEquals(output.getL2DerivedType1Member(),input.getL2DerivedType1Member()); } public void test9ComplexTypeExtensionsPortEchoL1DerivedTypeAsBaseType() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); test.wsdl.interop5.complextype.types.L1DerivedType input = new test.wsdl.interop5.complextype.types.L1DerivedType(); input.setBaseTypeMember1("echoBaseType_2"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L1DerivedType"); // Test operation test.wsdl.interop5.complextype.types.BaseType output = null; output = binding.echoL1DerivedTypeAsBaseType(input); // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); } public void test10ComplexTypeExtensionsPortEchoL2DerivedType1AsBaseType() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); test.wsdl.interop5.complextype.types.L2DerivedType1 input = new test.wsdl.interop5.complextype.types.L2DerivedType1(); input.setBaseTypeMember1("echoBaseType_3"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L2DerivedType1"); input.setL2DerivedType1Member(3); // Test operation test.wsdl.interop5.complextype.types.BaseType output = null; output = binding.echoL2DerivedType1AsBaseType(input); // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); } public void test11ComplexTypeExtensionsPortEchoBaseTypeAsL1DerivedType() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); test.wsdl.interop5.complextype.types.L1DerivedType input = new test.wsdl.interop5.complextype.types.L1DerivedType(); input.setBaseTypeMember1("echoBaseType_2"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L1DerivedType"); // Test operation test.wsdl.interop5.complextype.types.L1DerivedType output = null; output = binding.echoBaseTypeAsL1DerivedType(input); // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); } public void test12ComplexTypeExtensionsPortEchoBaseTypeAsL2DerivedType1() throws Exception { test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType binding; try { binding = new test.wsdl.interop5.complextype.ComplexTypeExtensionsServiceLocator().getComplexTypeExtensionsPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); test.wsdl.interop5.complextype.types.L2DerivedType1 input = new test.wsdl.interop5.complextype.types.L2DerivedType1(); input.setBaseTypeMember1("echoBaseType_3"); input.setBaseTypeMember2(2); input.setL1DerivedTypeMember("L2DerivedType1"); input.setL2DerivedType1Member(3); // Test operation test.wsdl.interop5.complextype.types.L2DerivedType1 output = null; output = binding.echoBaseTypeAsL2DerivedType1(input); // TBD - validate results assertEquals(output.getBaseTypeMember1(),input.getBaseTypeMember1()); assertEquals(output.getBaseTypeMember2(),input.getBaseTypeMember2()); assertEquals(output.getL1DerivedTypeMember(),input.getL1DerivedTypeMember()); assertEquals(output.getL2DerivedType1Member(),input.getL2DerivedType1Member()); } }
6,445
0
Create_ds/axis-axis1-java/test/wsdl/interop5
Create_ds/axis-axis1-java/test/wsdl/interop5/complextype/ComplexTypeExtensionsBindingImpl.java
/** * ComplexTypeExtensionsBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop5.complextype; public class ComplexTypeExtensionsBindingImpl implements test.wsdl.interop5.complextype.ComplexTypeExtensionsPortType{ public void echoBaseType_1(test.wsdl.interop5.complextype.types.holders.BaseTypeHolder param) throws java.rmi.RemoteException { } public void echoBaseType_2(test.wsdl.interop5.complextype.types.holders.BaseTypeHolder param) throws java.rmi.RemoteException { } public void echoBaseType_3(test.wsdl.interop5.complextype.types.holders.BaseTypeHolder param) throws java.rmi.RemoteException { } public void echoBaseType_4(test.wsdl.interop5.complextype.types.holders.BaseTypeHolder param) throws java.rmi.RemoteException { } public void echoBaseType_5(test.wsdl.interop5.complextype.types.holders.BaseTypeHolder param) throws java.rmi.RemoteException { } public void echoL1DerivedType_1(test.wsdl.interop5.complextype.types.holders.L1DerivedTypeHolder param) throws java.rmi.RemoteException { } public void echoL1DerivedType_2(test.wsdl.interop5.complextype.types.holders.L1DerivedTypeHolder param) throws java.rmi.RemoteException { } public void echoL2DerivedType1_1(test.wsdl.interop5.complextype.types.holders.L2DerivedType1Holder param) throws java.rmi.RemoteException { } public test.wsdl.interop5.complextype.types.BaseType echoL1DerivedTypeAsBaseType(test.wsdl.interop5.complextype.types.L1DerivedType param) throws java.rmi.RemoteException { test.wsdl.interop5.complextype.types.BaseType output = new test.wsdl.interop5.complextype.types.BaseType(); output.setBaseTypeMember1(param.getBaseTypeMember1()); output.setBaseTypeMember2(param.getBaseTypeMember2()); return output; } public test.wsdl.interop5.complextype.types.BaseType echoL2DerivedType1AsBaseType(test.wsdl.interop5.complextype.types.L2DerivedType1 param) throws java.rmi.RemoteException { test.wsdl.interop5.complextype.types.BaseType output = new test.wsdl.interop5.complextype.types.BaseType(); output.setBaseTypeMember1(param.getBaseTypeMember1()); output.setBaseTypeMember2(param.getBaseTypeMember2()); return output; } public test.wsdl.interop5.complextype.types.L1DerivedType echoBaseTypeAsL1DerivedType(test.wsdl.interop5.complextype.types.BaseType param) throws java.rmi.RemoteException { return (test.wsdl.interop5.complextype.types.L1DerivedType)param; } public test.wsdl.interop5.complextype.types.L2DerivedType1 echoBaseTypeAsL2DerivedType1(test.wsdl.interop5.complextype.types.BaseType param) throws java.rmi.RemoteException { return (test.wsdl.interop5.complextype.types.L2DerivedType1)param; } }
6,446
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/RoundtripPortTypeA.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; /** * Defines methods for RoundtripPortType * * @author Rich Scheuerle */ public interface RoundtripPortTypeA { public java.lang.String methodString(java.lang.String inString) throws java.rmi.RemoteException; public java.math.BigInteger methodBigInteger(java.math.BigInteger inInteger) throws java.rmi.RemoteException; public java.math.BigDecimal methodBigDecimal(java.math.BigDecimal inDecimal) throws java.rmi.RemoteException; public java.util.Calendar methodDateTime(java.util.Calendar inDateTime) throws java.rmi.RemoteException; public java.util.Date methodDate(java.util.Date inDateTime) throws java.rmi.RemoteException; public byte[] methodByteArray(byte[] inByteArray) throws java.rmi.RemoteException; public void methodAllTypesIn(java.lang.String string, java.math.BigInteger integer, java.math.BigDecimal decimal, java.util.Calendar dateTime, java.util.Date date, boolean _boolean, byte _byte, short _short, int _int, long _long, float _float, double _double, byte[] base64Binary, java.lang.Boolean soapBoolean, java.lang.Byte soapByte, java.lang.Short soapShort, java.lang.Integer soapInt, java.lang.Long soapLong, java.lang.Float soapFloat, java.lang.Double soapDouble, java.lang.Byte[] soapBase64) throws java.rmi.RemoteException; public int[] methodIntArrayInOut(int[] inIntArray) throws java.rmi.RemoteException; public void methodIntArrayIn(int[] inIntArray) throws java.rmi.RemoteException; public int[] methodIntArrayOut() throws java.rmi.RemoteException; public String[][] methodStringMArrayInOut(String[][] inStringArray) throws java.rmi.RemoteException; public void methodStringMArrayIn(String[][] inStringArray) throws java.rmi.RemoteException; public String[][] methodStringMArrayOut() throws java.rmi.RemoteException; public void methodBondInvestmentIn(BondInvestment bondInvestment) throws java.rmi.RemoteException; public BondInvestment methodBondInvestmentOut() throws java.rmi.RemoteException; public BondInvestment methodBondInvestmentInOut(BondInvestment bondInvestment) throws java.rmi.RemoteException; public float getRealtimeLastTradePrice(StockInvestment stockInvestment) throws java.rmi.RemoteException; public PreferredStockInvestment getDividends(PreferredStockInvestment preferredStock) throws java.rmi.RemoteException; public CallOptions[] methodCallOptions(CallOptions[] callOptions) throws java.rmi.RemoteException; } // RoundtripPortType
6,447
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; import junit.framework.TestCase; import test.wsdl.roundtrip.holders.BondInvestmentHolder; import javax.xml.rpc.ServiceException; import javax.xml.rpc.holders.StringHolder; import java.math.BigDecimal; import java.math.BigInteger; import java.rmi.RemoteException; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.TimeZone; /** * This class contains the test methods to verify that Java mapping * to XML/WSDL works as specified by the JAX-RPC specification. * * The following items are tested: * - Primitives * - Standard Java Classes * - Arrays * - Multiple Arrays * - JAX-RPC Value Types * - Nillables (when used with literal element declarations) * * @version 1.00 06 Feb 2002 * @author Brent Ulbricht */ public class RoundtripTestServiceTestCase extends TestCase { private RoundtripPortType binding = null; private RoundtripPortType binding2 = null; private static final double DOUBLE_DELTA = 0.0D; private static final float FLOAT_DELTA = 0.0F; /** * The Junit framework requires that each class that subclasses * TestCase define a constructor accepting a string. This method * can be used to specify a specific testXXXXX method in this * class to run. */ public RoundtripTestServiceTestCase(String name) { super(name); } // Constructor /** * The setUp method executes before each test method in this class * to get the binding. */ public void setUp() { try { binding = new RoundtripPortTypeServiceLocator().getRoundtripTest(); binding2 = new RoundtripPortTypeServiceLocator().getRoundtripTest2(); } catch (ServiceException jre) { fail("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); } // setUp /** * Test to insure that a JAX-RPC Value Type works correctly. StockInvestment * subclasses Investment and should pass data members in both the Investment * and StockInvestment classes across the wire correctly. */ public void testStockInvestment() throws Exception { StockInvestment stock = new StockInvestment(); stock.setName("International Business Machines"); stock.setId(1); stock.setTradeExchange("NYSE"); stock.setLastTradePrice(200.55F); float lastTradePrice = binding.getRealtimeLastTradePrice(stock); assertEquals("The expected and actual values did not match.", 201.25F, lastTradePrice, FLOAT_DELTA); // Make sure static field dontMapToWSDL is not mapped. try { (StockInvestment.class). getDeclaredMethod("getDontMapToWSDL", new Class[] {}); fail("Should not map static member dontMapToWSDL"); } catch (NoSuchMethodException e) { // Cool the method should not be in the class } // Make sure private field avgYearlyReturn is not mapped. try { (StockInvestment.class).getDeclaredMethod("getAvgYearlyReturn", new Class[] {}); fail("Should not map private member avgYearlyReturn"); } catch (NoSuchMethodException e) { // Cool the method should not be in the class } } // testStockInvestment /** * Like the above test, but uses the alternate port. */ public void testStockInvestmentWithPort2() throws Exception { StockInvestment stock = new StockInvestment(); stock.setName("International Business Machines"); stock.setId(1); stock.setTradeExchange("NYSE"); stock.setLastTradePrice(200.55F); float lastTradePrice = binding2.getRealtimeLastTradePrice(stock); assertEquals("The expected and actual values did not match.", 201.25F, lastTradePrice, FLOAT_DELTA); // Make sure static field dontMapToWSDL is not mapped. try { (StockInvestment.class).getDeclaredMethod("getDontMapToWSDL", new Class[] {}); fail("Should not map static member dontMapToWSDL"); } catch (NoSuchMethodException e) { // Cool the method should not be in the class } // Make sure private field avgYearlyReturn is not mapped. try { (StockInvestment.class).getDeclaredMethod("getAvgYearlyReturn", new Class[] {}); fail("Should not map private member avgYearlyReturn"); } catch (NoSuchMethodException e) { // Cool the method should not be in the class } } // testStockInvestmentWithPort2 /** * Test to insure that a JAX-RPC Value Type works correctly. PreferredStockInvestment * subclasses StockInvestment and should pass data members in both the Investment, * StockInvestment, and PreferredStockInvestment classes across the wire correctly. */ public void testPreferredStockInvestment() throws RemoteException { PreferredStockInvestment oldStock = new PreferredStockInvestment(); oldStock.setName("SOAP Inc."); oldStock.setId(202); oldStock.setTradeExchange("NASDAQ"); oldStock.setLastTradePrice(10.50F); oldStock.setDividendsInArrears(100.44D); oldStock.setPreferredYield(new BigDecimal("7.00")); PreferredStockInvestment newStock = binding.getDividends(oldStock); assertEquals("The expected and actual values did not match.", newStock.getName(), "AXIS Inc."); assertEquals("The expected and actual values did not match.", 203, newStock.getId()); assertEquals("The expected and actual values did not match.", "NASDAQ", newStock.getTradeExchange()); assertEquals("The expected and actual values did not match.", 101.44D, newStock.getDividendsInArrears(), DOUBLE_DELTA); assertEquals("The expected and actual values did not match.", new BigDecimal("8.00"), newStock.getPreferredYield()); assertEquals("The expected and actual values did not match.", 11.50F, newStock.getLastTradePrice(), FLOAT_DELTA); } // testPreferredStockInvestment /** * The BondInvestment class contains all the supported data members: * primitives, standard Java classes, arrays, and primitive wrapper * classes. This test insures that the data is transmitted across * the wire correctly. */ public void testRoundtripBondInvestment() throws RemoteException { CallOptions[] callOptions = new CallOptions[2]; callOptions[0] = new CallOptions(); Calendar date = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); date.setTimeZone(gmt); date.setTime(new Date(1013441507388L)); callOptions[0].setCallDate(date); callOptions[1] = new CallOptions(); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1013441507390L)); callOptions[1].setCallDate(date); HashMap map = new HashMap(); map.put("Test", "Test Works"); short[] shortArray = {(short) 30}; byte[] byteArray = {(byte) 1}; Short[] wrapperShortArray = {new Short((short) 23), new Short((short) 56)}; Byte[] wrapperByteArray = {new Byte((byte) 2), new Byte((byte) 15)}; BondInvestment sendValue = new BondInvestment(); sendValue.setMap(map); sendValue.setOptions(callOptions); sendValue.setOptions2(callOptions); sendValue.setOptions3(callOptions[0]); sendValue.setWrapperShortArray(wrapperShortArray); sendValue.setWrapperByteArray(wrapperByteArray); sendValue.setWrapperDouble(new Double(2323.232D)); sendValue.setWrapperFloat(new Float(23.023F)); sendValue.setWrapperInteger(new Integer(2093)); sendValue.setWrapperShort(new Short((short) 203)); sendValue.setWrapperByte(new Byte((byte) 20)); sendValue.setWrapperBoolean(new Boolean(true)); sendValue.setShortArray(shortArray); sendValue.setByteArray(byteArray); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1012937861996L)); sendValue.setCallableDate(date); sendValue.setBondAmount(new BigDecimal("2675.23")); sendValue.setPortfolioType(new BigInteger("2093")); sendValue.setTradeExchange("NYSE"); sendValue.setFiftyTwoWeekHigh(45.012D); sendValue.setLastTradePrice(87895.32F); sendValue.setYield(5475L); sendValue.setStockBeta(32); sendValue.setDocType((short) 35); sendValue.setTaxIndicator((byte) 3); BondInvestment actual = binding.methodBondInvestmentInOut(sendValue); date.setTime(new Date(1013441507308L)); assertEquals("Returned map is not correct.", actual.getMap().get("Test"), "Test Works"); assertEquals("The expected and actual values did not match.", date, actual.getOptions()[0].getCallDate()); date.setTime(new Date(1013441507328L)); assertEquals("The expected and actual values did not match.", date, actual.getOptions()[1].getCallDate()); assertEquals("The expected and actual values did not match.", new Short((short) 33), actual.getWrapperShortArray()[0]); assertEquals("The expected and actual values did not match.", new Short((short) 86), actual.getWrapperShortArray()[1]); assertEquals("The expected and actual values did not match.", new Byte((byte) 4), actual.getWrapperByteArray()[0]); assertEquals("The expected and actual values did not match.", new Byte((byte) 18), actual.getWrapperByteArray()[1]); assertEquals("The expected and actual values did not match.", new Double(33.232D), actual.getWrapperDouble()); assertEquals("The expected and actual values did not match.", new Float(2.23F), actual.getWrapperFloat()); assertEquals("The expected and actual values did not match.", new Integer(3), actual.getWrapperInteger()); assertEquals("The expected and actual values did not match.", new Short((short) 2), actual.getWrapperShort()); assertEquals("The expected and actual values did not match.", new Byte((byte) 21), actual.getWrapperByte()); assertEquals("The expected and actual values did not match.", new Boolean(false), actual.getWrapperBoolean()); assertEquals("The expected and actual values did not match.", (short) 36, actual.getShortArray()[0]); assertEquals("The expected and actual values did not match.", (byte) 7, actual.getByteArray()[0]); date.setTime(new Date(1012937862997L)); assertEquals("The expected and actual values did not match.", date, actual.getCallableDate()); assertEquals("The expected and actual values did not match.", new BigDecimal("2735.23"), actual.getBondAmount()); assertEquals("The expected and actual values did not match.", new BigInteger("21093"), actual.getPortfolioType()); assertEquals("The expected and actual values did not match.", new String("AMEX"), actual.getTradeExchange()); assertEquals("The expected and actual values did not match.", 415.012D, actual.getFiftyTwoWeekHigh(), DOUBLE_DELTA); assertEquals("The expected and actual values did not match.", 8795.32F, actual.getLastTradePrice(), FLOAT_DELTA); assertEquals("The expected and actual values did not match.", 575L, actual.getYield()); assertEquals("The expected and actual values did not match.", 3, actual.getStockBeta()); assertEquals("The expected and actual values did not match.", (short) 45, actual.getDocType()); assertEquals("The expected and actual values did not match.", (byte) 8, actual.getTaxIndicator()); } // testRoundtripBondInvestment /** * The BondInvestment class contains all the supported data members: * primitives, standard Java classes, arrays, and primitive wrapper * classes. This test insures that a BondInvestment class received * by a remote method contains the expected values. */ public void testBondInvestmentOut() throws RemoteException { BondInvestment actual = binding.methodBondInvestmentOut(); Calendar date = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); date.setTimeZone(gmt); date.setTime(new Date(1013441507308L)); assertEquals("Returned map is not correct.", actual.getMap().get("Test"), "Test Works"); assertEquals("The expected and actual values did not match.", date, actual.getOptions()[0].getCallDate()); date.setTime(new Date(1013441507328L)); assertEquals("The expected and actual values did not match.", date, actual.getOptions()[1].getCallDate()); assertEquals("The expected and actual values did not match.", new Short((short) 33), actual.getWrapperShortArray()[0]); assertEquals("The expected and actual values did not match.", new Short((short) 86), actual.getWrapperShortArray()[1]); assertEquals("The expected and actual values did not match.", new Byte((byte) 4), actual.getWrapperByteArray()[0]); assertEquals("The expected and actual values did not match.", new Byte((byte) 18), actual.getWrapperByteArray()[1]); assertEquals("The expected and actual values did not match.", new Double(33.232D), actual.getWrapperDouble()); assertEquals("The expected and actual values did not match.", new Float(2.23F), actual.getWrapperFloat()); assertEquals("The expected and actual values did not match.", new Integer(3), actual.getWrapperInteger()); assertEquals("The expected and actual values did not match.", new Short((short) 2), actual.getWrapperShort()); assertEquals("The expected and actual values did not match.", new Byte((byte) 21), actual.getWrapperByte()); assertEquals("The expected and actual values did not match.", new Boolean(false), actual.getWrapperBoolean()); assertEquals("The expected and actual values did not match.", (short) 36, actual.getShortArray()[0]); assertEquals("The expected and actual values did not match.", (byte) 7, actual.getByteArray()[0]); date.setTime(new Date(1012937862997L)); assertEquals("The expected and actual values did not match.", date, actual.getCallableDate()); assertEquals("The expected and actual values did not match.", new BigDecimal("2735.23"), actual.getBondAmount()); assertEquals("The expected and actual values did not match.", new BigInteger("21093"), actual.getPortfolioType()); assertEquals("The expected and actual values did not match.", new String("AMEX"), actual.getTradeExchange()); assertEquals("The expected and actual values did not match.", 415.012D, actual.getFiftyTwoWeekHigh(), DOUBLE_DELTA); assertEquals("The expected and actual values did not match.", 8795.32F, actual.getLastTradePrice(), FLOAT_DELTA); assertEquals("The expected and actual values did not match.", 575L, actual.getYield()); assertEquals("The expected and actual values did not match.", 3, actual.getStockBeta()); assertEquals("The expected and actual values did not match.", (short) 45, actual.getDocType()); assertEquals("The expected and actual values did not match.", (byte) 8, actual.getTaxIndicator()); } // testBondInvestmentOut /** * The BondInvestment class contains all the supported data members: * primitives, standard Java classes, arrays, and primitive wrapper * classes. This test insures that a remote method can recieve the * BondInvestment class and that its values match the expected values. */ public void testBondInvestmentIn() throws RemoteException { CallOptions[] callOptions = new CallOptions[2]; callOptions[0] = new CallOptions(); Calendar date = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); date.setTimeZone(gmt); date.setTime(new Date(1013441507388L)); callOptions[0].setCallDate(date); callOptions[1] = new CallOptions(); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1013441507390L)); callOptions[1].setCallDate(date); HashMap map = new HashMap(); map.put("Test", "Test Works"); short[] shortArray = {(short) 30}; byte[] byteArray = {(byte) 1}; Short[] wrapperShortArray = {new Short((short) 23), new Short((short) 56)}; Byte[] wrapperByteArray = {new Byte((byte) 2), new Byte((byte) 15)}; BondInvestment sendValue = new BondInvestment(); sendValue.setMap(map); sendValue.setOptions(callOptions); sendValue.setOptions2(callOptions); sendValue.setOptions3(callOptions[0]); sendValue.setWrapperShortArray(wrapperShortArray); sendValue.setWrapperByteArray(wrapperByteArray); sendValue.setWrapperDouble(new Double(2323.232D)); sendValue.setWrapperFloat(new Float(23.023F)); sendValue.setWrapperInteger(new Integer(2093)); sendValue.setWrapperShort(new Short((short) 203)); sendValue.setWrapperByte(new Byte((byte) 20)); sendValue.setWrapperBoolean(new Boolean(true)); sendValue.setShortArray(shortArray); sendValue.setByteArray(byteArray); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1012937861996L)); sendValue.setCallableDate(date); sendValue.setBondAmount(new BigDecimal("2675.23")); sendValue.setPortfolioType(new BigInteger("2093")); sendValue.setTradeExchange("NYSE"); sendValue.setFiftyTwoWeekHigh(45.012D); sendValue.setLastTradePrice(87895.32F); sendValue.setYield(5475L); sendValue.setStockBeta(32); sendValue.setDocType((short) 35); sendValue.setTaxIndicator((byte) 3); binding.methodBondInvestmentIn(sendValue); } // testBondInvestmentIn /** * Test the overloaded method getId with a BondInvestment. */ public void testBondInvestmentGetId() throws RemoteException { CallOptions[] callOptions = new CallOptions[2]; callOptions[0] = new CallOptions(); Calendar date = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); date.setTimeZone(gmt); date.setTime(new Date(1013441507388L)); callOptions[0].setCallDate(date); callOptions[1] = new CallOptions(); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1013441507390L)); callOptions[1].setCallDate(date); short[] shortArray = {(short) 30}; byte[] byteArray = {(byte) 1}; Short[] wrapperShortArray = {new Short((short) 23), new Short((short) 56)}; Byte[] wrapperByteArray = {new Byte((byte) 2), new Byte((byte) 15)}; BondInvestment sendValue = new BondInvestment(); sendValue.setOptions(callOptions); sendValue.setOptions2(callOptions); sendValue.setOptions3(callOptions[0]); sendValue.setWrapperShortArray(wrapperShortArray); sendValue.setWrapperByteArray(wrapperByteArray); sendValue.setWrapperDouble(new Double(2323.232D)); sendValue.setWrapperFloat(new Float(23.023F)); sendValue.setWrapperInteger(new Integer(2093)); sendValue.setWrapperShort(new Short((short) 203)); sendValue.setWrapperByte(new Byte((byte) 20)); sendValue.setWrapperBoolean(new Boolean(true)); sendValue.setShortArray(shortArray); sendValue.setByteArray(byteArray); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1012937861996L)); sendValue.setCallableDate(date); sendValue.setBondAmount(new BigDecimal("2675.23")); sendValue.setPortfolioType(new BigInteger("2093")); sendValue.setTradeExchange("NYSE"); sendValue.setFiftyTwoWeekHigh(45.012D); sendValue.setLastTradePrice(87895.32F); sendValue.setYield(5475L); sendValue.setStockBeta(32); sendValue.setDocType((short) 35); sendValue.setTaxIndicator((byte) 3); sendValue.setId(-123); int id = binding.getId(sendValue); assertEquals("The wrong id was sent back", -123, id); } // testBondInvestmentGetId /** * Test the overloaded method getId with a StockInvestment. */ public void testInvestmentGetId() throws RemoteException { StockInvestment stock = new StockInvestment(); stock.setName("International Business Machines"); stock.setId(1); stock.setTradeExchange("NYSE"); stock.setLastTradePrice(200.55F); // Temporarily commented out until I can get this to work. int id = binding.getId(stock); assertEquals("The wrong id was sent back", 1, id); } // testInvestmentGetId /** * Test to insure that a multiple array sent by a remote method can be * received and its values match the expected values. */ public void testMethodStringMArrayOut() throws RemoteException { String[][] expected = {{"Out-0-0"}, {"Out-1-0"}}; String[][] actual = binding.methodStringMArrayOut(); assertEquals("The expected and actual values did not match.", expected[0][0], actual[0][0]); assertEquals("The expected and actual values did not match.", expected[1][0], actual[1][0]); } // testMethodStringMArrayOut /** * Test to insure that a multiple array can be sent to a remote method. The * server matches the received array against its expected values. */ public void testMethodStringMArrayIn() throws RemoteException { String[][] sendArray = {{"In-0-0", "In-0-1"}, {"In-1-0", "In-1-1"}}; binding.methodStringMArrayIn(sendArray); } // testMethodStringMArrayIn /** * Test to insure that a multiple array matches the expected values on both * the client and server. */ public void testMethodStringMArrayInOut() throws RemoteException { String[][] sendArray = {{"Request-0-0", "Request-0-1"}, {"Request-1-0", "Request-1-1"}}; String[][] expected = {{"Response-0-0", "Response-0-1"}, {"Response-1-0", "Response-1-1"}}; String[][] actual = binding.methodStringMArrayInOut(sendArray); assertEquals("The expected and actual values did not match.", expected[0][0], actual[0][0]); assertEquals("The expected and actual values did not match.", expected[0][1], actual[0][1]); assertEquals("The expected and actual values did not match.", expected[1][0], actual[1][0]); assertEquals("The expected and actual values did not match.", expected[1][1], actual[1][1]); } // testMethodStringMArrayInOut /** * Test to insure that an int array can be sent by a remote method and * the received values match the expected values on the client. */ public void testMethodIntArrayOut() throws RemoteException { int[] expected = {3, 78, 102}; int[] actual = binding.methodIntArrayOut(); assertEquals("The expected and actual values did not match.", expected[0], actual[0]); assertEquals("The expected and actual values did not match.", expected[1], actual[1]); assertEquals("The expected and actual values did not match.", expected[2], actual[2]); } // testMethodIntArrayOut /** * Test to insure that an int array can be sent to a remote method. The server * checks the received array against its expected values. */ public void testMethodIntArrayIn() throws RemoteException { int[] sendValue = {91, 54, 47, 10}; binding.methodIntArrayIn(sendValue); } // testMethodIntArrayIn /** * Test to insure that an int array can roundtrip between the client * and server. The actual and expected values are compared on both * the client and server. */ public void testMethodIntArrayInOut() throws RemoteException { int[] sendValue = {90, 34, 45, 239, 45, 10}; int[] expected = {12, 39, 50, 60, 28, 39}; int[] actual = binding.methodIntArrayInOut(sendValue); assertEquals("The expected and actual values did not match.", expected[0], actual[0]); assertEquals("The expected and actual values did not match.", expected[1], actual[1]); assertEquals("The expected and actual values did not match.", expected[2], actual[2]); assertEquals("The expected and actual values did not match.", expected[3], actual[3]); assertEquals("The expected and actual values did not match.", expected[4], actual[4]); assertEquals("The expected and actual values did not match.", expected[5], actual[5]); } // testMethodIntArrayInOut /** * Test to insure that all the XML -> Java types can be sent to a remote * method. The server checks for the expected values. */ public void testMethodAllTypesIn() throws RemoteException { byte[] sendByteArray = {(byte) 5, (byte) 10, (byte) 12}; Byte[] sendWrapperByteArray = {new Byte((byte) 9), new Byte((byte) 7)}; Calendar dateTime = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); dateTime.setTimeZone(gmt); dateTime.setTime(new Date(1012937861986L)); binding.methodAllTypesIn(new String("Request methodAllTypesIn"), new BigInteger("545"), new BigDecimal("546.545"), dateTime, dateTime, true, (byte) 2, (short) 14, 234, 10900L, 23098.23F, 2098098.01D, sendByteArray, new Boolean(false), new Byte((byte) 11), new Short((short) 45), new Integer(101), new Long(232309L), new Float(67634.12F), new Double(892387.232D), sendWrapperByteArray); } // testMethodAllTypesIn /** * Test to insure that a primitive byte array matches the expected values on * both the client and server. */ public void testMethodByteArray() throws RemoteException { byte[] expected = {(byte) 5, (byte) 4}; byte[] sendByte = {(byte) 3, (byte) 9}; byte[] actual = binding.methodByteArray(sendByte); assertEquals("The expected and actual values did not match.", expected[0], actual[0]); assertEquals("The expected and actual values did not match.", expected[1], actual[1]); } // testMethodByteArray /** * Test to insure that a Calendar object matches the expected values * on both the client and server. */ public void testMethodDateTime() throws RemoteException { Calendar expected = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); expected.setTimeZone(gmt); expected.setTime(new Date(1012937861800L)); Calendar parameter = Calendar.getInstance(); parameter.setTimeZone(gmt); parameter.setTime(new Date(1012937861996L)); Calendar actual = binding.methodDateTime(parameter); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodDateTime /** * Just do the same thing that testMethodDateTime does. The REAL * test here is a compile test. Both Calendar and Date map to * xsd:dateTime. The original SEI in this roundtrip test contained * method: "Date methodDate(Date)". But taking that Java -> WSDL -> * Java should result in: "Calendar methodDate(Calendar)". If that * didn't happen, then the compile would fail. */ public void testMethodDate() throws RemoteException { Calendar expected = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); expected.setTimeZone(gmt); expected.setTime(new Date(1012937861800L)); Calendar parameter = Calendar.getInstance(); parameter.setTimeZone(gmt); parameter.setTime(new Date(1012937861996L)); Calendar actual = binding.methodDate(parameter); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodDate /** * Test to insure that a BigDecimal matches the expected values on * both the client and server. */ public void testMethodBigDecimal() throws RemoteException { BigDecimal expected = new BigDecimal("903483.304"); BigDecimal actual = binding.methodBigDecimal(new BigDecimal("3434.456")); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodBigDecimal /** * Test to insure that a BigInteger matches the expected values on * both the client and server. */ public void testMethodBigInteger() throws RemoteException { BigInteger expected = new BigInteger("2323"); BigInteger actual = binding.methodBigInteger(new BigInteger("8789")); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodBigInteger /** * Test to insure that a String matches the expected values on * both the client and server. */ public void testMethodString() throws RemoteException { String expected = "Response"; String actual = binding.methodString(new String("Request")); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodString /** * Test to insure that a primitive double matches the expected * values on both the client and server. */ public void testMethodDouble() throws RemoteException { double expected = 567.547D; double actual = binding.methodDouble(87502.002D); assertEquals("The expected and actual values did not match.", expected, actual, DOUBLE_DELTA); } // testMethodDouble /** * Test to insure that a primitive float matches the expected * values on both the client and server. */ public void testMethodFloat() throws RemoteException { float expected = 12325.545F; float actual = binding.methodFloat(8787.25F); assertEquals("The expected and actual values did not match.", expected, actual, FLOAT_DELTA); } // testMethodFloat /** * Test to insure that a primitive long matches the expected * values on both the client and server. */ public void testMethodLong() throws RemoteException { long expected = 787985L; long actual = binding.methodLong(45425L); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodLong /** * Test to insure that a primitive int matches the expected * values on both the client and server. */ public void testMethodInt() throws RemoteException { int expected = 10232; int actual = binding.methodInt(1215); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodInt /** * Test to insure that a primitive short matches the expected * values on both the client and server. */ public void testMethodShort() throws RemoteException { short expected = (short) 124; short actual = binding.methodShort((short) 302); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodShort /** * Test to insure that a primitive byte matches the expected * values on both the client and server. */ public void testMethodByte() throws RemoteException { byte expected = (byte) 35; byte actual = binding.methodByte((byte) 61); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodByte /** * Test to insure that a primitive boolean matches the expected * values on both the client and server. */ public void testMethodBoolean() throws RemoteException { boolean expected = false; boolean actual = binding.methodBoolean(true); assertEquals("The expected and actual values did not match.", expected, actual); } // testMethodBoolean /** * Test to insure that an array of a user defined class matches * the expected values on both the client and server. */ public void testMethodCallOptions() throws RemoteException { CallOptions[] callOptions = new CallOptions[1]; callOptions[0] = new CallOptions(); Calendar cal = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); cal.setTimeZone(gmt); cal.setTime(new Date(1013459984577L)); callOptions[0].setCallDate(cal); CallOptions[] actual = binding.methodCallOptions(callOptions); cal.setTime(new Date(1013459984507L)); assertEquals("The expected and actual values did not match.", cal, actual[0].getCallDate()); } // testMethodCallOptions /** * Test to insure that a wrapper Float object matches * the expected values on both the client and server. */ public void testMethodSoapFloat() throws RemoteException { Float actual = binding.methodSoapFloat(new Float(23423.234F)); assertEquals("The expected and actual values did not match.", new Float(232.23F), actual); } // testMethodSoapFloat /** * Test to insure that a wrapper Double object matches * the expected values on both the client and server. */ public void testMethodSoapDouble() throws RemoteException { Double actual = binding.methodSoapDouble(new Double(123423.234D)); assertEquals("The expected and actual values did not match.", new Double(2232.23D), actual); } // testMethodSoapDouble /** * Test to insure that a wrapper Boolean object matches * the expected values on both the client and server. */ public void testMethodSoapBoolean() throws RemoteException { Boolean actual = binding.methodSoapBoolean(new Boolean(true)); assertEquals("The expected and actual values did not match.", new Boolean(false), actual); } // testMethodSoapBoolean /** * Test to insure that a wrapper Byte object matches * the expected values on both the client and server. */ public void testMethodSoapByte() throws RemoteException { Byte actual = binding.methodSoapByte(new Byte((byte) 9)); assertEquals("The expected and actual values did not match.", new Byte((byte) 10), actual); } // testMethodSoapByte /** * Test to insure that a wrapper Short object matches * the expected values on both the client and server. */ public void testMethodSoapShort() throws RemoteException { Short actual = binding.methodSoapShort(new Short((short) 32)); assertEquals("The expected and actual values did not match.", new Short((short) 44), actual); } // testMethodSoapShort /** * Test to insure that a wrapper Integer object matches * the expected values on both the client and server. */ public void testMethodSoapInt() throws RemoteException { Integer actual = binding.methodSoapInt(new Integer(332)); assertEquals("The expected and actual values did not match.", new Integer(441), actual); } // testMethodSoapInt /** * Test to insure that a wrapper Long object matches * the expected values on both the client and server. */ public void testMethodSoapLong() throws RemoteException { Long actual = binding.methodSoapLong(new Long(3321L)); assertEquals("The expected and actual values did not match.", new Long(4412L), actual); } // testMethodSoapLong /** * Test to insure that a user defined exception can be * thrown and received. */ public void testInvalidTickerSymbol() throws RemoteException { try { binding.throwInvalidTickerException(); fail("Should have received an InvalidTickerSymbol exception."); } catch (InvalidTickerSymbol its) { // Test was successful assertEquals("The expected and actual values did not match.", "ABC", its.getTickerSymbol()); } } // testInvalidTickerSymbol /** * Test to insure that more than one user defined exception can be * defined in a method. */ public void testInvalidTradeExchange() throws RemoteException { try { binding.throwInvalidTradeExchange(); fail("TRY: Should have received an InvalidTradeExchange exception."); } catch (InvalidTradeExchange ite) { // Test was successful assertEquals("The expected and actual values did not match.", "XYZ", ite.getTradeExchange()); } catch (InvalidTickerSymbol its) { fail("ITS: Should have received an InvalidTradeExchange exception."); } catch (InvalidCompanyId ici) { fail("ICI: Should have received an InvalidTradeExchange exception."); } } // testInvalidTradeExchange /** * Make sure holder inout parameters can be round tripped. */ public void testHolderTest() throws RemoteException { StringHolder sh = new StringHolder("hi there"); BondInvestment bi = new BondInvestment(); BondInvestmentHolder bih = new BondInvestmentHolder(bi); binding.holderTest(sh, bih); } // testHolderTest } // End class RoundtripTestServiceTestCase
6,448
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/InvalidTickerSymbol.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; /** * The InvalidTickerSymbol class is used to test the ability of * Java2WSDL to correctly generate faults in the WSDL. * * @version 1.00 18 Feb 2002 * @author Brent Ulbricht */ public class InvalidTickerSymbol extends Exception { private String tickerSymbol; public InvalidTickerSymbol(String tickerSymbol) { this.tickerSymbol = tickerSymbol; } // Constructor public String getTickerSymbol() { return this.tickerSymbol; } // getTickerSymbol } // InvalidTickerSymbol
6,449
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/PreferredStockInvestment.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; import java.math.BigDecimal; /** * The PreferredStockInvestment class extends the StockInvestment * class so that we can verify that the Java2WSDL tool correctly * creates WSDL to allow data members in StockInvestment and Investment * to be accessed. * * @version 1.00 06 Feb 2002 * @author Brent Ulbricht */ public class PreferredStockInvestment extends StockInvestment implements java.io.Serializable { public BigDecimal preferredYield; private double dividendsInArrears; public PreferredStockInvestment() { } // Constructor public void setDividendsInArrears(double dividendsInArrears) { this.dividendsInArrears = dividendsInArrears; } // setDividendsInArrears public double getDividendsInArrears() { return this.dividendsInArrears; } // getDividendsInArrears } // PreferredStockInvestment
6,450
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/BondInvestment.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Calendar; import java.util.HashMap; /** * The BondInvestment class contains data members for all the * primitives, standard Java classes, and primitive wrapper * classes. This class is used to test that all the data * members transmit correctly over the wire. * * @version 1.00 06 Feb 2002 * @author Brent Ulbricht */ public class BondInvestment implements java.io.Serializable { private boolean taxableInvestment; public byte taxIndicator; public short docType; public int stockBeta; public long yield; public float lastTradePrice; public double fiftyTwoWeekHigh; private String tradeExchange; public BigInteger portfolioType; public BigDecimal bondAmount; public Calendar callableDate; public byte[] byteArray; private short[] shortArray; private Boolean wrapperBoolean; private Byte wrapperByte; private Short wrapperShort; public Integer wrapperInteger; public Float wrapperFloat; private Double wrapperDouble; public Byte[] wrapperByteArray; public Short[] wrapperShortArray; private CallOptions[] options; public Object options2; public Object options3; public int id; public HashMap map; public BondInvestment() { } // Constructor public void setTaxableInvestment(boolean taxableInvestment) { this.taxableInvestment = taxableInvestment; } // setTaxableInvestment public boolean getTaxableInvestment() { return this.taxableInvestment; } // getTaxableInvestment public void setTradeExchange(String tradeExchange) { this.tradeExchange = tradeExchange; } // setTradeExchange public String getTradeExchange() { return this.tradeExchange; } // getTradeExchange public void setShortArray(short[] shortArray) { this.shortArray = shortArray; } // getShortArray public short[] getShortArray() { return this.shortArray; } // setShortArray public void setWrapperBoolean(Boolean wrapperBoolean) { this.wrapperBoolean = wrapperBoolean; } // setWrapperBoolean public Boolean getWrapperBoolean() { return this.wrapperBoolean; } // getWrapperBoolean public void setWrapperByte(Byte wrapperByte) { this.wrapperByte = wrapperByte; } // setWrapperByte public Byte getWrapperByte() { return this.wrapperByte; } // getWrapperByte public void setWrapperShort(Short wrapperShort) { this.wrapperShort = wrapperShort; } // setWrapperShort public Short getWrapperShort() { return this.wrapperShort; } // getWrapperShort public void setWrapperDouble(Double wrapperDouble) { this.wrapperDouble = wrapperDouble; } // setWrapperDouble public Double getWrapperDouble() { return this.wrapperDouble; } // getWrapperDouble // List of fields that are XML attributes private static java.lang.String[] _attrs = new String[] { "taxIndicator", "docType", "stockBeta" }; /** * Return list of bean field names that are attributes */ public static java.lang.String[] getAttributeElements() { return _attrs; } public CallOptions getOptions(int i) { return options[i]; } public void setOptions(int i, CallOptions value) { if (options == null || options.length <= i) { CallOptions[] a = new CallOptions[i + 1]; if (options != null) { for(int j=0; j<options.length; j++) a[j] = options[j]; } options = a; } options[i] = value; } public CallOptions[] getOptions() { return options; } public void setOptions(CallOptions[] options) { this.options = options; } public HashMap getMap() { return map; } public void setMap(HashMap map) { this.map = map; } } // BondInvestment
6,451
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; import test.wsdl.roundtrip.holders.BondInvestmentHolder; import javax.xml.rpc.holders.StringHolder; import java.math.BigDecimal; import java.math.BigInteger; import java.rmi.RemoteException; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.TimeZone; /** * This class contains the implementations of the methods defined in the * RoundtripPortType interface. Most of the methods compare the actual * values received from the client against some expected values. * * @version 1.00 06 Feb 2002 * @author Brent Ulbricht */ public class RoundtripTestSoapBindingImpl implements RoundtripPortType { public float getRealtimeLastTradePrice(StockInvestment in0) throws RemoteException { if ((in0.getLastTradePrice() == 200.55F) && (in0.getTradeExchange().equals("NYSE")) && (in0.getName().equals("International Business Machines")) && (in0.getId() == 1)) { return 201.25F; } else { throw new RemoteException("Actual Value Did Not Match Expected Value."); } } // getRealtimeLastTradePrice public PreferredStockInvestment getDividends(PreferredStockInvestment in0) throws RemoteException { if ((in0.getLastTradePrice() == 10.50F) && (in0.getTradeExchange().equals("NASDAQ")) && (in0.getName().equals("SOAP Inc.")) && (in0.getId() == 202) && (in0.getDividendsInArrears() == 100.44D) && (in0.getPreferredYield().equals(new BigDecimal("7.00")))) { in0.setName("AXIS Inc."); in0.setId(203); in0.setTradeExchange("NASDAQ"); in0.setLastTradePrice(11.50F); in0.setDividendsInArrears(101.44D); in0.setPreferredYield(new BigDecimal("8.00")); return in0; } else { throw new RemoteException("Actual Value Did Not Match Expected Value."); } } // getDividend public BondInvestment methodBondInvestmentInOut(BondInvestment in0) throws RemoteException { short[] shortArray = {(short) 36}; byte[] byteArray = {(byte) 7}; CallOptions[] callOptions = new CallOptions[2]; callOptions[0] = new CallOptions(); Calendar date = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); date.setTimeZone(gmt); date.setTime(new Date(1013441507308L)); callOptions[0].setCallDate(date); callOptions[1] = new CallOptions(); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1013441507328L)); callOptions[1].setCallDate(date); HashMap map = new HashMap(); map.put("Test", "Test Works"); Short[] wrapperShortArray = {new Short((short) 33), new Short((short) 86)}; Byte[] wrapperByteArray = {new Byte((byte) 4), new Byte((byte) 18)}; BondInvestment sendValue = new BondInvestment(); sendValue.setMap(map); sendValue.setOptions(callOptions); sendValue.setOptions2(callOptions); sendValue.setOptions3(callOptions[0]); sendValue.setWrapperShortArray(wrapperShortArray); sendValue.setWrapperByteArray(wrapperByteArray); sendValue.setWrapperDouble(new Double(33.232D)); sendValue.setWrapperFloat(new Float(2.23F)); sendValue.setWrapperInteger(new Integer(3)); sendValue.setWrapperShort(new Short((short) 2)); sendValue.setWrapperByte(new Byte((byte) 21)); sendValue.setWrapperBoolean(new Boolean(false)); sendValue.setShortArray(shortArray); sendValue.setByteArray(byteArray); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1012937862997L)); sendValue.setCallableDate(date); sendValue.setBondAmount(new BigDecimal("2735.23")); sendValue.setPortfolioType(new BigInteger("21093")); sendValue.setTradeExchange("AMEX"); sendValue.setFiftyTwoWeekHigh(415.012D); sendValue.setLastTradePrice(8795.32F); sendValue.setYield(575L); sendValue.setStockBeta(3); sendValue.setDocType((short) 45); sendValue.setTaxIndicator((byte) 8); if ((in0.getStockBeta() == 32) && (in0.getDocType() == (short) 35) && (in0.getTaxIndicator() == (byte) 3)) ; else throw new RemoteException("Actual attribute values did not match expected values."); Calendar expectedDate0 = Calendar.getInstance(); expectedDate0.setTimeZone(gmt); expectedDate0.setTime(new Date(1013441507388L)); Calendar expectedDate1 = Calendar.getInstance(); expectedDate1.setTimeZone(gmt); expectedDate1.setTime(new Date(1013441507390L)); Calendar expectedDate2 = Calendar.getInstance(); expectedDate2.setTimeZone(gmt); expectedDate2.setTime(new Date(1013441507388L)); Calendar expectedDate3 = Calendar.getInstance(); expectedDate3.setTimeZone(gmt); expectedDate3.setTime(new Date(1013441507390L)); Calendar expectedDate4 = Calendar.getInstance(); expectedDate4.setTimeZone(gmt); expectedDate4.setTime(new Date(1012937861996L)); if ((in0.getMap().get("Test").equals("Test Works")) && (in0.getOptions()[0].getCallDate().equals(expectedDate0)) && (in0.getOptions()[1].getCallDate().equals(expectedDate1)) && (((CallOptions[])in0.getOptions2())[0].getCallDate().equals(expectedDate2)) && (((CallOptions[])in0.getOptions2())[1].getCallDate().equals(expectedDate3)) && (in0.getWrapperShortArray()[0].equals(new Short((short) 23))) && (in0.getWrapperShortArray()[1].equals(new Short((short) 56))) && (in0.getWrapperByteArray()[0].equals(new Byte((byte) 2))) && (in0.getWrapperByteArray()[1].equals(new Byte((byte) 15))) && (in0.getWrapperDouble().equals(new Double(2323.232D))) && (in0.getWrapperFloat().equals(new Float(23.023F))) && (in0.getWrapperInteger().equals(new Integer(2093))) && (in0.getWrapperShort().equals(new Short((short) 203))) && (in0.getWrapperByte().equals(new Byte((byte) 20))) && (in0.getWrapperBoolean().equals(new Boolean(true))) && (in0.getShortArray()[0] == (short) 30) && (in0.getByteArray()[0] == (byte) 1) && (in0.getCallableDate().equals(expectedDate4)) && (in0.getBondAmount().equals(new BigDecimal("2675.23"))) && (in0.getPortfolioType().equals(new BigInteger("2093"))) && (in0.getTradeExchange().equals("NYSE")) && (in0.getFiftyTwoWeekHigh() == 45.012D) && (in0.getLastTradePrice() == 87895.32F) && (in0.getYield() == 5475L) && (in0.getStockBeta() == 32) && (in0.getDocType() == (short) 35) && (in0.getTaxIndicator() == (byte) 3)) { return sendValue; } else { throw new RemoteException("Actual values did not match expected values."); } } // methodBondInvestmentInOut public BondInvestment methodBondInvestmentOut() throws RemoteException { short[] shortArray = {(short) 36}; byte[] byteArray = {(byte) 7}; CallOptions[] callOptions = new CallOptions[2]; callOptions[0] = new CallOptions(); Calendar date = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); date.setTimeZone(gmt); date.setTime(new Date(1013441507308L)); callOptions[0].setCallDate(date); callOptions[1] = new CallOptions(); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1013441507328L)); callOptions[1].setCallDate(date); Short[] wrapperShortArray = {new Short((short) 33), new Short((short) 86)}; Byte[] wrapperByteArray = {new Byte((byte) 4), new Byte((byte) 18)}; HashMap map = new HashMap(); map.put("Test", "Test Works"); BondInvestment sendValue = new BondInvestment(); sendValue.setMap(map); sendValue.setOptions(callOptions); sendValue.setOptions2(callOptions); sendValue.setOptions3(callOptions[0]); sendValue.setWrapperShortArray(wrapperShortArray); sendValue.setWrapperByteArray(wrapperByteArray); sendValue.setWrapperDouble(new Double(33.232D)); sendValue.setWrapperFloat(new Float(2.23F)); sendValue.setWrapperInteger(new Integer(3)); sendValue.setWrapperShort(new Short((short) 2)); sendValue.setWrapperByte(new Byte((byte) 21)); sendValue.setWrapperBoolean(new Boolean(false)); sendValue.setShortArray(shortArray); sendValue.setByteArray(byteArray); date = Calendar.getInstance(); date.setTimeZone(gmt); date.setTime(new Date(1012937862997L)); sendValue.setCallableDate(date); sendValue.setBondAmount(new BigDecimal("2735.23")); sendValue.setPortfolioType(new BigInteger("21093")); sendValue.setTradeExchange("AMEX"); sendValue.setFiftyTwoWeekHigh(415.012D); sendValue.setLastTradePrice(8795.32F); sendValue.setYield(575L); sendValue.setStockBeta(3); sendValue.setDocType((short) 45); sendValue.setTaxIndicator((byte) 8); return sendValue; } // methodBondInvestmentOut public void methodBondInvestmentIn(BondInvestment in0) throws RemoteException { Calendar expectedDate0 = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); expectedDate0.setTimeZone(gmt); expectedDate0.setTime(new Date(1013441507388L)); Calendar expectedDate1 = Calendar.getInstance(); expectedDate1.setTimeZone(gmt); expectedDate1.setTime(new Date(1013441507390L)); Calendar expectedDate2 = Calendar.getInstance(); expectedDate2.setTimeZone(gmt); expectedDate2.setTime(new Date(1013441507388L)); Calendar expectedDate3 = Calendar.getInstance(); expectedDate3.setTimeZone(gmt); expectedDate3.setTime(new Date(1013441507390L)); Calendar expectedDate4 = Calendar.getInstance(); expectedDate4.setTimeZone(gmt); expectedDate4.setTime(new Date(1012937861996L)); if (!((in0.getMap().get("Test").equals("Test Works")) && (in0.getOptions()[0].getCallDate().equals(expectedDate0)) && (in0.getOptions()[1].getCallDate().equals(expectedDate1)) && (((CallOptions[])in0.getOptions2())[0].getCallDate().equals(expectedDate2)) && (((CallOptions[])in0.getOptions2())[1].getCallDate().equals(expectedDate3)) && (in0.getWrapperShortArray()[0].equals(new Short((short) 23))) && (in0.getWrapperShortArray()[1].equals(new Short((short) 56))) && (in0.getWrapperByteArray()[0].equals(new Byte((byte) 2))) && (in0.getWrapperByteArray()[1].equals(new Byte((byte) 15))) && (in0.getWrapperDouble().equals(new Double(2323.232D))) && (in0.getWrapperFloat().equals(new Float(23.023F))) && (in0.getWrapperInteger().equals(new Integer(2093))) && (in0.getWrapperShort().equals(new Short((short) 203))) && (in0.getWrapperByte().equals(new Byte((byte) 20))) && (in0.getWrapperBoolean().equals(new Boolean(true))) && (in0.getShortArray()[0] == (short) 30) && (in0.getByteArray()[0] == (byte) 1) && (in0.getCallableDate().equals(expectedDate4)) && (in0.getBondAmount().equals(new BigDecimal("2675.23"))) && (in0.getPortfolioType().equals(new BigInteger("2093"))) && (in0.getTradeExchange().equals("NYSE")) && (in0.getFiftyTwoWeekHigh() == 45.012D) && (in0.getLastTradePrice() == 87895.32F) && (in0.getYield() == 5475L) && (in0.getStockBeta() == 32) && (in0.getDocType() == (short) 35) && (in0.getTaxIndicator() == (byte) 3))) { throw new RemoteException("Actual values did not match expected values."); } } // methodBondInvestmentIn public String[][] methodStringMArrayOut() throws RemoteException { String[][] sendArray = { {"Out-0-0"}, {"Out-1-0"}}; return sendArray; } // methodStringMArrayOut public void methodStringMArrayIn(String[][] in0) throws RemoteException { if (!((in0[0][0].equals("In-0-0")) && (in0[0][1].equals("In-0-1")) && (in0[1][0].equals("In-1-0")) && (in0[1][1].equals("In-1-1")))) { throw new RemoteException("The actual values did not match expected values."); } } // methodStringMArrayIn public String[][] methodStringMArrayInOut(String[][] in0) throws RemoteException { String[][] sendArray = { {"Response-0-0", "Response-0-1"}, {"Response-1-0", "Response-1-1"}}; if ((in0[0][0].equals("Request-0-0")) && (in0[0][1].equals("Request-0-1")) && (in0[1][0].equals("Request-1-0")) && (in0[1][1].equals("Request-1-1"))) { return sendArray; } else { throw new RemoteException("The actual values did not match expected values."); } } // methodStringMArrayInOut public int[] methodIntArrayOut() throws RemoteException { int[] returnByteArray = {3, 78, 102}; return returnByteArray; } // methodIntArrayOut public void methodIntArrayIn(int[] in0) throws RemoteException { if (!((in0[0] == 91) && (in0[1] == 54) && (in0[2] == 47) && (in0[3] == 10))) { throw new RemoteException("The actual values did not match expected values."); } } // methodIntArrayIn public int[] methodIntArrayInOut(int[] in0) throws RemoteException { int[] returnByteArray = {12, 39, 50, 60, 28, 39}; if ((in0[0] == 90) && (in0[1] == 34) && (in0[2] == 45) && (in0[3] == 239) && (in0[4] == 45) && (in0[5] == 10)) { return returnByteArray; } else { throw new RemoteException("The actual values did not match expected values."); } } // methodIntArrayIn public void methodAllTypesIn(String in0, BigInteger in1, BigDecimal in2, Calendar in35, Calendar in36, boolean in4, byte in5, short in6, int in7, long in8, float in9, double in10, byte[] in11, Boolean in13, Byte in14, Short in15, Integer in16, Long in17, Float in18, Double in19, Byte[] in12) throws RemoteException { Calendar expectedDateTime = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); expectedDateTime.setTimeZone(gmt); expectedDateTime.setTime(new Date(1012937861986L)); if (!((in0.equals(new String("Request methodAllTypesIn"))) && (in1.equals(new BigInteger("545"))) && (in2.equals(new BigDecimal("546.545"))) && (in35.equals(expectedDateTime)) && (in13.equals(new Boolean(false))) && (in14.equals(new Byte((byte) 11))) && (in15.equals(new Short((short) 45))) && (in16.equals(new Integer(101))) && (in17.equals(new Long(232309L))) && (in18.equals(new Float(67634.12F))) && (in19.equals(new Double(892387.232D))) && (in4) && (in5 == (byte) 2) && (in6 == (short) 14) && (in7 == 234) && (in8 == 10900L) && (in9 == 23098.23F) && (in10 == 2098098.01D) && (in11[0] == (byte) 5) && (in11[1] == (byte) 10) && (in11[2] == (byte) 12) && (in12[0].equals(new Byte((byte) 9))) && (in12[1].equals(new Byte((byte) 7))))) { throw new RemoteException("Expected values did not match actuals."); } } // methodAllTypesIn public byte[] methodByteArray(byte[] in0) throws RemoteException { byte[] returnByte = {(byte) 5, (byte) 4}; if ((in0[0] == (byte) 3) && (in0[1] == (byte) 9)) { return returnByte; } else { throw new RemoteException("Expecting a byte array with 3 and 9."); } } // methodByteArray public Calendar methodDateTime(Calendar in0) throws RemoteException { Calendar expectedDateTime = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); expectedDateTime.setTimeZone(gmt); expectedDateTime.setTime(new Date(1012937861996L)); if (in0.equals(expectedDateTime)) { Calendar dateTime = Calendar.getInstance(); dateTime.setTimeZone(gmt); dateTime.setTime(new Date(1012937861800L)); return dateTime; } else { throw new RemoteException("Expecting a Date value of " + expectedDateTime + "."); } } // methodDateTime public Calendar methodDate(Calendar in0) throws RemoteException { return methodDateTime(in0); } // methodDate public BigDecimal methodBigDecimal(BigDecimal in0) throws RemoteException { if (in0.equals(new BigDecimal("3434.456"))) { return new BigDecimal("903483.304"); } else { throw new RemoteException("Expecting a BigDecimal value of 3434.456."); } } // methodBigDecimal public BigInteger methodBigInteger(BigInteger in0) throws RemoteException { if (in0.equals(new BigInteger("8789"))) { return new BigInteger("2323"); } else { throw new RemoteException("Expecting a BigInteger value of 8789."); } } // methodBigInteger public String methodString(String in0) throws RemoteException { if (in0.equals("Request")) { return "Response"; } else { throw new RemoteException("Expecting a string value of \"Request\""); } } // methodString public double methodDouble(double in0) throws RemoteException { if (in0 == 87502.002D) { return 567.547D; } else { throw new RemoteException("Expecting a double value of 87502.002D"); } } // methodDouble public float methodFloat(float in0) throws RemoteException { if (in0 == 8787.25F) { return 12325.545F; } else { throw new RemoteException("Expecting a float value of 8787.25F"); } } // methodFloat public long methodLong(long in0) throws RemoteException { if (in0 == 45425L) { return 787985L; } else { throw new RemoteException("Expecting a long value of 45425L."); } } // methodLong public int methodInt(int in0) throws RemoteException { if (in0 == 1215) { return 10232; } else { throw new RemoteException("Expecting an int value of 1215."); } } // methodInt public short methodShort(short in0) throws RemoteException { if (in0 == (short) 302) { return(short) 124; } else { throw new RemoteException("Expecting a short value of 302."); } } // methodShort public byte methodByte(byte in0) throws RemoteException { if (in0 == (byte) 61) { return(byte) 35; } else { throw new RemoteException("Expecting a byte value of 61."); } } // methodByte public boolean methodBoolean(boolean in0) throws RemoteException { if (in0) { return false; } else { throw new RemoteException("Expecting a boolean value of true."); } } // methodBoolean public CallOptions[] methodCallOptions(CallOptions[] in0) throws RemoteException { Calendar dateTime = Calendar.getInstance(); TimeZone gmt = TimeZone.getTimeZone("GMT"); dateTime.setTimeZone(gmt); dateTime.setTime(new Date(1013459984577L)); if (in0[0].getCallDate().equals(dateTime)) { in0[0] = new CallOptions(); dateTime.setTime(new Date(1013459984507L)); in0[0].setCallDate(dateTime); return in0; } else { throw new RemoteException("Actual value did not match expected value."); } } // methodCallOptions public Float methodSoapFloat(Float in0) throws RemoteException { if (in0.equals(new Float(23423.234F))) { return new Float(232.23F); } else { throw new RemoteException("Expecting a float value of 23423.234F"); } } // methodSoapFloat public Double methodSoapDouble(Double in0) throws RemoteException { if (in0.equals(new Double(123423.234D))) { return new Double(2232.23D); } else { throw new RemoteException("Expecting a float value of 123423.234D"); } } // methodSoapDouble public Boolean methodSoapBoolean(Boolean in0) throws RemoteException { if (in0.equals(new Boolean(true))) { return new Boolean(false); } else { throw new RemoteException("Expecting a boolean value of true"); } } // methodSoapBoolean public Byte methodSoapByte(Byte in0) throws RemoteException { if (in0.equals(new Byte((byte) 9))) { return new Byte((byte) 10); } else { throw new RemoteException("Expecting a byte value of 9"); } } // methodSoapByte public Short methodSoapShort(Short in0) throws RemoteException { if (in0.equals(new Short((short) 32))) { return new Short((short) 44); } else { throw new RemoteException("Expecting a short value of 32"); } } // methodSoapShort public Integer methodSoapInt(Integer in0) throws RemoteException { if (in0.equals(new Integer(332))) { return new Integer(441); } else { throw new RemoteException("Expecting a short value of 332"); } } // methodSoapInt public Long methodSoapLong(Long in0) throws RemoteException { if (in0.equals(new Long(3321L))) { return new Long(4412L); } else { throw new RemoteException("Expecting a short value of 3321L"); } } // methodSoapLong public void throwInvalidTickerException() throws InvalidTickerSymbol, RemoteException { throw new InvalidTickerSymbol("ABC"); } // throwInvalidTickerSymbol public void throwInvalidTradeExchange() throws InvalidTickerSymbol, InvalidTradeExchange, InvalidCompanyId, RemoteException { throw new InvalidTradeExchange("XYZ"); } // throwInvalidTradeExchange public int getId(BondInvestment investment) throws java.rmi.RemoteException { return investment.getId(); } public int getId(Investment investment) throws java.rmi.RemoteException { return investment.getId(); } // This is a compile-time test, so we don't need any runtime test code. public void holderTest(StringHolder sh, BondInvestmentHolder bih) { } } // End class RoundtripTypesTestSoapBindingImpl
6,452
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/InvalidCompanyId.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; /** * The InvalidCompanyId class is used to test the ability of * Java2WSDL to correctly generate faults in the WSDL. * * @version 1.00 18 Feb 2002 * @author Brent Ulbricht */ public class InvalidCompanyId extends Exception { private int companyId; private InvalidCompanyId e; // This should not be put in the wsdl public InvalidCompanyId(int companyId) { this.companyId = companyId; } // Constructor public int getCompanyId() { return this.companyId; } // getCompanyId } // InvalidCompanyId
6,453
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/StockInvestment.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; /** * The StockInvestment class extends the Investment class so that * we can verify that the Java2WSDL tool correctly creates WSDL * to allow data members in Investment to be accessed. * * @version 1.00 06 Feb 2002 * @author Brent Ulbricht */ public class StockInvestment extends Investment implements java.io.Serializable { public float lastTradePrice; private String tradeExchange; private float stockBeta; private double fiftyTwoWeekHigh; public StockInvestment() { } // Constructor public String getTradeExchange() { return tradeExchange; } // getTradeExchange public void setTradeExchange(String tradeExchange) { this.tradeExchange = tradeExchange; } // setTradeExchange } // StockInvestment
6,454
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/RoundtripPortType.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; /** * The RoundtripPortType interface defines the methods necessary when * when implementing this interface. * * @version 1.00 06 Feb 2002 * @author Brent Ulbricht * @author Rich Scheuerle */ // Some of the methods are inherited, to test inherted interface processing public interface RoundtripPortType extends RoundtripPortTypeA, RoundtripPortTypeB { public boolean methodBoolean(boolean inBoolean) throws java.rmi.RemoteException; public byte methodByte(byte inByte) throws java.rmi.RemoteException; public short methodShort(short inShort) throws java.rmi.RemoteException; public int methodInt(int inInt) throws java.rmi.RemoteException; public long methodLong(long inLong) throws java.rmi.RemoteException; public float methodFloat(float inFloat) throws java.rmi.RemoteException; public double methodDouble(double inDouble) throws java.rmi.RemoteException; } // RoundtripPortType
6,455
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/InvalidTradeExchange.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; /** * The InvalidTradeExchange class is used to test the ability of * Java2WSDL to correctly generate faults in the WSDL. * * @version 1.00 18 Feb 2002 * @author Brent Ulbricht */ public class InvalidTradeExchange extends Exception { public String tradeExchange; public InvalidTradeExchange(String tradeExchange) { this.tradeExchange = tradeExchange; } // Constructor public String getTradeExchange() { return this.tradeExchange; } // getTradeExchange } // InvalidTradeExchange
6,456
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/Investment.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; /** * The Investment class is the base class for other * types of investment classes. The main purpose of this * class is to insure that when other classes subclass * that the data members in Investment can be accessed * and transmit correctly across the wire. * * @version 1.00 06 Feb 2002 * @author Brent Ulbricht */ public abstract class Investment implements java.io.Serializable { public static int dontMapToWSDL; // This should not be mapped to the WSDL public String name; private int id; private double avgYearlyReturn; // This should not be mapped to the WSDL public Investment() { } // Constructor public int getId() { return id; } // getId public void setId(int id) { this.id = id; } // setId public float calcAvgYearlyReturn() { return 0.0F; } // calcAvgYearlyReturn } // End class Investment
6,457
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/CallOptions.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; import java.util.Calendar; /** * The CallOptions class is just a class to determine how * Java2WSDL will generate WSDL for user defined classes. * * @version 1.00 06 Feb 2002 * @author Brent Ulbricht */ public class CallOptions { private double callPrice = 103.30; public Calendar callDate; public static void main(String[] args) { } // main } // CallOptions
6,458
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/roundtrip/RoundtripPortTypeB.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip; import test.wsdl.roundtrip.holders.BondInvestmentHolder; import javax.xml.rpc.holders.StringHolder; /** * The RoundtripPortTypeB defines methods for RoundtripPortType * * @author Rich Scheuerle */ public interface RoundtripPortTypeB { public java.lang.Float methodSoapFloat(java.lang.Float inSoapFloat) throws java.rmi.RemoteException; public java.lang.Double methodSoapDouble(java.lang.Double inSoapDouble) throws java.rmi.RemoteException; public java.lang.Boolean methodSoapBoolean(java.lang.Boolean inSoapBoolean) throws java.rmi.RemoteException; public java.lang.Byte methodSoapByte(java.lang.Byte inSoapByte) throws java.rmi.RemoteException; public java.lang.Short methodSoapShort(java.lang.Short inSoapShort) throws java.rmi.RemoteException; public java.lang.Integer methodSoapInt(java.lang.Integer inSoapInt) throws java.rmi.RemoteException; public java.lang.Long methodSoapLong(java.lang.Long inSoapLong) throws java.rmi.RemoteException; public void throwInvalidTickerException() throws InvalidTickerSymbol, java.rmi.RemoteException; public void throwInvalidTradeExchange() throws InvalidCompanyId, InvalidTradeExchange, InvalidTickerSymbol, java.rmi.RemoteException; // Overloading test public int getId(BondInvestment investment) throws java.rmi.RemoteException; public int getId(Investment investment) throws java.rmi.RemoteException; public void holderTest(StringHolder sh, BondInvestmentHolder bih); } // RoundtripPortType
6,459
0
Create_ds/axis-axis1-java/test/wsdl/roundtrip
Create_ds/axis-axis1-java/test/wsdl/roundtrip/holders/BondInvestmentHolder.java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.roundtrip.holders; import test.wsdl.roundtrip.BondInvestment; import javax.xml.rpc.holders.Holder; public final class BondInvestmentHolder implements Holder { /** Field _value */ public BondInvestment value; /** * Constructor BondInvestmentHolder */ public BondInvestmentHolder() {} /** * Constructor BondInvestmentHolder * * @param value */ public BondInvestmentHolder(BondInvestment value) { this.value = value; } }
6,460
0
Create_ds/axis-axis1-java/test/wsdl
Create_ds/axis-axis1-java/test/wsdl/interop3/Interop3TestCase.java
package test.wsdl.interop3; import junit.framework.TestSuite; import junit.textui.TestRunner; import org.apache.axis.utils.ClassUtils; import java.io.FileInputStream; import java.lang.reflect.Field; import java.net.URL; import java.util.Iterator; import java.util.Properties; public class Interop3TestCase { public static void usage() { System.out.println("java test.wsdl.interop3.Interop3TestCase <URL property file>"); } // usage public static void main(String[] args) { try { if (args.length != 1) { usage(); System.exit(0); } Properties props = new Properties(); props.load(new FileInputStream(args[0])); Iterator it = props.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); URL value = new URL((String) props.get(key)); try { Class test = ClassUtils.forName(key); Field urlField = test.getField("url"); urlField.set(null, value); TestRunner.run(new TestSuite(test)); } catch (Throwable t) { System.err.println("Failure running " + key); t.printStackTrace(); } } } catch (Throwable t) { } } // main } // class Interop3TestCase
6,461
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/compound1/SoapInteropCompound1BindingImpl.java
/** * SoapInteropCompound1BindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.interop3.compound1; public class SoapInteropCompound1BindingImpl implements test.wsdl.interop3.compound1.SoapInteropCompound1PortType { public test.wsdl.interop3.compound1.xsd.Person echoPerson(test.wsdl.interop3.compound1.xsd.Person xPerson) throws java.rmi.RemoteException { return xPerson; } public test.wsdl.interop3.compound1.xsd.Document echoDocument(test.wsdl.interop3.compound1.xsd.Document xDocument) throws java.rmi.RemoteException { return xDocument; } }
6,462
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/compound1/Compound1TestCase.java
package test.wsdl.interop3.compound1; import test.wsdl.interop3.compound1.xsd.Document; import test.wsdl.interop3.compound1.xsd.Person; import java.net.URL; /* <!-- SOAP Builder's round III web services --> <!-- interoperability testing: import1 --> <!-- (see http://www.whitemesa.net/r3/plan.html) --> <!-- Step 1. Start with predefined WSDL --> <!-- Step 2. Generate client from predefined WSDL --> <!-- Step 3. Test generated client against --> <!-- pre-built server --> <!-- Step 4. Generate server from predefined WSDL --> <!-- Step 5. Test generated client against --> <!-- generated server --> <!-- Step 6. Generate second client from --> <!-- generated server's WSDL (some clients --> <!-- can do this dynamically) --> <!-- Step 7. Test second generated client against --> <!-- generated server --> <!-- Step 8. Test second generated client against --> <!-- pre-built server --> */ public class Compound1TestCase extends junit.framework.TestCase { public static URL url; public Compound1TestCase(String name) { super(name); } protected void setUp() throws Exception { } public void testStep3() { SoapInteropCompound1PortType binding; try { if (url != null) { binding = new Compound1Locator().getSoapInteropCompound1Port(url); } else { binding = new Compound1Locator().getSoapInteropCompound1Port(); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { Document doc = new Document(); doc.setValue("some value"); doc.setID("myID"); Document newDoc = binding.echoDocument(doc); assertEquals("Documents didn't match!", newDoc, doc); Person person = new Person(); person.setAge(33); person.setMale(true); person.setName("Frodo"); person.setID(2.345F); Person newPerson = binding.echoPerson(person); assertEquals("Returned Person didn't match!", newPerson, person); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } /* public void testStep5() { SoapInteropCompound1PortType binding; try { binding = new Compound1Locator().getSoapInteropCompound1Port(new java.net.URL("http://localhost:8080/axis/services/SoapInteropImport1Port")); } catch (Throwable t) { throw new junit.framework.AssertionFailedError("Throwable caught: " + t); } assertTrue("binding is null", binding != null); try { Document doc = new Document(); doc.setValue("some value"); doc.setID("myID"); Document newDoc = binding.echoDocument(doc); assertEquals("Step 5 IDs didn't match!", doc.getID(), newDoc.getID()); assertEquals("Step 5 values didn't match!", doc.getValue(), newDoc.getValue()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } /* public void testStep7() { test.wsdl.interop3.import1.step6.definitions.SoapInteropImport1PortType binding; try { binding = new SoapInteropImport1PortTypeServiceLocator().getSoapInteropImport1Port(); } catch (Throwable t) { throw new junit.framework.AssertionFailedError("Throwable caught: " + t); } assertTrue("binding is null", binding != null); try { String value = null; value = binding.echoString(new String()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } /* doesn't work yet public void testStep8() { test.wsdl.interop3.import1.step6.definitions.SoapInteropImport1PortType binding; try { binding = new SoapInteropImport1PortTypeServiceLocator().getSoapInteropImport1Port(new java.net.URL("http://mssoapinterop.org/stkV3/wsdl/import2.wsdl")); } catch (Throwable t) { throw new junit.framework.AssertionFailedError("Throwable caught: " + t); } assertTrue("binding is null", binding != null); try { java.lang.String value = null; value = binding.echoString(new java.lang.String()); } catch (java.rmi.RemoteException re) { re.printStackTrace(); throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } */ public static void main(String[] args) { if (args.length == 1) { try { url = new URL(args[0]); } catch (Exception e) { } } junit.textui.TestRunner.run(new junit.framework.TestSuite(Compound1TestCase.class)); } // main }
6,463
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/import1/Import1TestCase.java
package test.wsdl.interop3.import1; import test.wsdl.interop3.import1.definitions.SoapInteropImport1PortType; import java.net.URL; /* <!-- SOAP Builder's round III web services --> <!-- interoperability testing: import1 --> <!-- (see http://www.whitemesa.net/r3/plan.html) --> <!-- Step 1. Start with predefined WSDL --> <!-- Step 2. Generate client from predefined WSDL --> <!-- Step 3. Test generated client against --> <!-- pre-built server --> <!-- Step 4. Generate server from predefined WSDL --> <!-- Step 5. Test generated client against --> <!-- generated server --> <!-- Step 6. Generate second client from --> <!-- generated server's WSDL (some clients --> <!-- can do this dynamically) --> <!-- Step 7. Test second generated client against --> <!-- generated server --> <!-- Step 8. Test second generated client against --> <!-- pre-built server --> */ public class Import1TestCase extends junit.framework.TestCase { public static URL url = null; public Import1TestCase(String name) { super(name); } public void testStep3() { SoapInteropImport1PortType binding; try { if (url == null) { binding = new Import1Locator().getSoapInteropImport1Port(); } else { binding = new Import1Locator().getSoapInteropImport1Port(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { String value = "import1 test string"; String result = binding.echoString(value); assertEquals("Strings didn't match", value, result); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } /* doesn't work yet public void testStep8() { test.wsdl.interop3.import1.step6.definitions.SoapInteropImport1PortType binding; try { binding = new SoapInteropImport1PortTypeServiceLocator().getSoapInteropImport1Port(new java.net.URL("http://mssoapinterop.org/stkV3/wsdl/import2.wsdl")); } catch (Throwable t) { throw new junit.framework.AssertionFailedError("Throwable caught: " + t); } assertTrue("binding is null", binding != null); try { java.lang.String value = null; value = binding.echoString(new java.lang.String()); } catch (java.rmi.RemoteException re) { re.printStackTrace(); throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } */ public static void main(String[] args) { if (args.length == 1) { try { url = new URL(args[0]); } catch (Exception e) { } } junit.textui.TestRunner.run(new junit.framework.TestSuite(Import1TestCase.class)); } // main }
6,464
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/import1/SoapInteropImport1BindingImpl.java
/** * SoapInteropImport1BindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.interop3.import1; public class SoapInteropImport1BindingImpl implements test.wsdl.interop3.import1.definitions.SoapInteropImport1PortType { public java.lang.String echoString(java.lang.String x) throws java.rmi.RemoteException { return x; } }
6,465
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/rpcEnc/WSDLInteropTestRpcEncPortBindingImpl.java
/** * WSDLInteropTestRpcEncPortBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.interop3.rpcEnc; public class WSDLInteropTestRpcEncPortBindingImpl implements test.wsdl.interop3.rpcEnc.WSDLInteropTestRpcEncPortType { public java.lang.String echoString(java.lang.String param0) throws java.rmi.RemoteException { return param0; } public java.lang.String[] echoStringArray(java.lang.String[] param0) throws java.rmi.RemoteException { return param0; } public test.wsdl.interop3.rpcEnc.xsd.SOAPStruct echoStruct(test.wsdl.interop3.rpcEnc.xsd.SOAPStruct param0) throws java.rmi.RemoteException { return param0; } public void echoVoid() throws java.rmi.RemoteException { } }
6,466
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/rpcEnc/RpcEncTestCase.java
package test.wsdl.interop3.rpcEnc; import test.wsdl.interop3.rpcEnc.xsd.SOAPStruct; import java.net.URL; /* <!-- SOAP Builder's round III web services --> <!-- interoperability testing: import1 --> <!-- (see http://www.whitemesa.net/r3/plan.html) --> <!-- Step 1. Start with predefined WSDL --> <!-- Step 2. Generate client from predefined WSDL --> <!-- Step 3. Test generated client against --> <!-- pre-built server --> <!-- Step 4. Generate server from predefined WSDL --> <!-- Step 5. Test generated client against --> <!-- generated server --> <!-- Step 6. Generate second client from --> <!-- generated server's WSDL (some clients --> <!-- can do this dynamically) --> <!-- Step 7. Test second generated client against --> <!-- generated server --> <!-- Step 8. Test second generated client against --> <!-- pre-built server --> */ public class RpcEncTestCase extends junit.framework.TestCase { static URL url; public RpcEncTestCase(String name) { super(name); } protected void setUp() throws Exception { } public void testStep3() throws Exception { WSDLInteropTestRpcEncPortType binding; try { if (url != null) { binding = new WSDLInteropTestRpcEncServiceLocator().getWSDLInteropTestRpcEncPort(url); } else { binding = new WSDLInteropTestRpcEncServiceLocator().getWSDLInteropTestRpcEncPort(); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); String str = "Hello there!"; String [] strArray = new String [] { "1", "two", "trois" }; assertEquals("echoString results differ", binding.echoString(str), str); String [] resArray = binding.echoStringArray(strArray); assertEquals("String array lengths differ", strArray.length, resArray.length); for (int i = 0; i < strArray.length; i++) { assertEquals("Array members at index " + i + " differ", strArray[i], resArray[i]); } SOAPStruct struct = new SOAPStruct(); struct.setVarFloat(3.14159F); struct.setVarInt(69); struct.setVarString("Struct-o-rama"); assertTrue("Structs weren't equal", struct.equals(binding.echoStruct(struct))); } public static void main(String[] args) { if (args.length == 1) { try { url = new URL(args[0]); } catch (Exception e) { } } junit.textui.TestRunner.run(new junit.framework.TestSuite(RpcEncTestCase.class)); } // main }
6,467
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/docLitParam/DocLitParamTestCase.java
package test.wsdl.interop3.docLitParam; import test.wsdl.interop3.docLitParam.xsd.ArrayOfstring_Literal; import test.wsdl.interop3.docLitParam.xsd.SOAPStruct; import java.net.URL; /* <!-- SOAP Builder's round III web services --> <!-- interoperability testing: import1 --> <!-- (see http://www.whitemesa.net/r3/plan.html) --> <!-- Step 1. Start with predefined WSDL --> <!-- Step 2. Generate client from predefined WSDL --> <!-- Step 3. Test generated client against --> <!-- pre-built server --> <!-- Step 4. Generate server from predefined WSDL --> <!-- Step 5. Test generated client against --> <!-- generated server --> <!-- Step 6. Generate second client from --> <!-- generated server's WSDL (some clients --> <!-- can do this dynamically) --> <!-- Step 7. Test second generated client against --> <!-- generated server --> <!-- Step 8. Test second generated client against --> <!-- pre-built server --> */ public class DocLitParamTestCase extends junit.framework.TestCase { static URL url; public DocLitParamTestCase(String name) { super(name); } protected void setUp() throws Exception { } public void testStep3() throws Exception { WSDLInteropTestDocLitPortType binding; try { if (url != null) { binding = new WSDLInteropTestDocLitServiceLocator().getWSDLInteropTestDocLitParamPort(url); } else { binding = new WSDLInteropTestDocLitServiceLocator().getWSDLInteropTestDocLitParamPort(); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); String str = "Hello there!"; String [] strArray = new String [] { "1", "two", "trois" }; ArrayOfstring_Literal param = new ArrayOfstring_Literal(); param.setString(strArray); assertEquals("echoString results differ", binding.echoString(str), str); String [] resArray = binding.echoStringArray(param).getString(); assertEquals("String array lengths differ", strArray.length, resArray.length); for (int i = 0; i < strArray.length; i++) { assertEquals("Array members at index " + i + " differ", strArray[i], resArray[i]); } SOAPStruct struct = new SOAPStruct(); struct.setVarFloat(3.14159F); struct.setVarInt(69); struct.setVarString("Struct-o-rama"); assertTrue("Structs weren't equal", struct.equals(binding.echoStruct(struct))); } public static void main(String[] args) { if (args.length == 1) { try { url = new URL(args[0]); } catch (Exception e) { } } junit.textui.TestRunner.run(new junit.framework.TestSuite(DocLitParamTestCase.class)); } // main }
6,468
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/docLitParam/WSDLInteropTestDocLitPortBindingImpl.java
/** * WSDLInteropTestDocLitPortBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.interop3.docLitParam; public class WSDLInteropTestDocLitPortBindingImpl implements test.wsdl.interop3.docLitParam.WSDLInteropTestDocLitPortType { public java.lang.String echoString(java.lang.String param0) throws java.rmi.RemoteException { return param0; } public test.wsdl.interop3.docLitParam.xsd.ArrayOfstring_Literal echoStringArray(test.wsdl.interop3.docLitParam.xsd.ArrayOfstring_Literal param0) throws java.rmi.RemoteException { return param0; } public test.wsdl.interop3.docLitParam.xsd.SOAPStruct echoStruct(test.wsdl.interop3.docLitParam.xsd.SOAPStruct param0) throws java.rmi.RemoteException { return param0; } public void echoVoid() throws java.rmi.RemoteException { } }
6,469
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/compound2/Compound2TestCase.java
package test.wsdl.interop3.compound2; import test.wsdl.interop3.compound2.Compound2Locator; import test.wsdl.interop3.compound2.SoapInteropCompound2PortType; import test.wsdl.interop3.compound2.xsd.Employee; import test.wsdl.interop3.compound2.xsd.Person; import java.net.URL; /* <!-- SOAP Builder's round III web services --> <!-- interoperability testing: import1 --> <!-- (see http://www.whitemesa.net/r3/plan.html) --> <!-- Step 1. Start with predefined WSDL --> <!-- Step 2. Generate client from predefined WSDL --> <!-- Step 3. Test generated client against --> <!-- pre-built server --> <!-- Step 4. Generate server from predefined WSDL --> <!-- Step 5. Test generated client against --> <!-- generated server --> <!-- Step 6. Generate second client from --> <!-- generated server's WSDL (some clients --> <!-- can do this dynamically) --> <!-- Step 7. Test second generated client against --> <!-- generated server --> <!-- Step 8. Test second generated client against --> <!-- pre-built server --> */ public class Compound2TestCase extends junit.framework.TestCase { static URL url; public Compound2TestCase(String name) { super(name); } protected void setUp() throws Exception { } public void testStep3() { SoapInteropCompound2PortType binding; try { if (url != null) { binding = new Compound2Locator().getSoapInteropCompound2Port(url); } else { binding = new Compound2Locator().getSoapInteropCompound2Port(); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { Employee emp = new Employee(); Person person = new Person(); person.setMale(true); person.setName("Joe Blow"); emp.setPerson(person); emp.setID(314159); emp.setSalary(100000.50); Employee result = binding.echoEmployee(emp); if (!emp.equals(result)) { System.out.println("Expected:"); System.out.println(printEmployee(emp)); System.out.println("Received:"); System.out.println(printEmployee(result)); } assertTrue("Results did not match", result.equals(emp)); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } String printEmployee(Employee e) { String result = new String(); result += " ID: " + e.getID() + "\r\n"; result += " Salary: " + e.getSalary() + "\r\n"; Person p = e.getPerson(); result += " Person:\r\n"; result += " Name: " + p.getName() + "\r\n"; result += " Male: " + p.isMale() + "\r\n"; return result; } public static void main(String[] args) { if (args.length == 1) { try { url = new URL(args[0]); } catch (Exception e) { } } junit.textui.TestRunner.run(new junit.framework.TestSuite(Compound2TestCase.class)); } // main }
6,470
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/compound2/SoapInteropCompound2BindingImpl.java
/** * SoapInteropCompound2BindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.interop3.compound2; public class SoapInteropCompound2BindingImpl implements test.wsdl.interop3.compound2.SoapInteropCompound2PortType { public test.wsdl.interop3.compound2.xsd.Employee echoEmployee(test.wsdl.interop3.compound2.xsd.Employee xEmployee) throws java.rmi.RemoteException { return xEmployee; } }
6,471
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/emptysa/SoapInteropEmptySABindingImpl.java
/** * SoapInteropEmptySABindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop3.emptysa; public class SoapInteropEmptySABindingImpl implements test.wsdl.interop3.emptysa.SoapInteropEmptySAPortType{ public java.lang.String echoString(java.lang.String a) throws java.rmi.RemoteException { return a; } }
6,472
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/emptysa/EmptySATestCase.java
/** * EmptySATestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop3.emptysa; import java.net.URL; public class EmptySATestCase extends junit.framework.TestCase { public static URL url = null; public static void main(String[] args) throws Exception { if (args.length == 1) { url = new URL(args[0]); } junit.textui.TestRunner.run(new junit.framework.TestSuite(EmptySATestCase.class)); } // main public EmptySATestCase(java.lang.String name) throws Exception { super(name); if (url == null) { url = new URL(new EmptySALocator().getSoapInteropEmptySAPortAddress()); } } public void test1SoapInteropEmptySAPortEchoString() throws Exception { test.wsdl.interop3.emptysa.SoapInteropEmptySAPortType binding; try { binding = new test.wsdl.interop3.emptysa.EmptySALocator().getSoapInteropEmptySAPort(); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation java.lang.String value = null; String expected = "empty SOAP Action"; value = binding.echoString(expected); // validate results assertEquals(expected, value); } }
6,473
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/import3/SoapInteropImport3BindingImpl.java
/** * SoapInteropImport3BindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.interop3.import3; public class SoapInteropImport3BindingImpl implements test.wsdl.interop3.import3.SoapInteropImport3PortType { public test.wsdl.interop3.import3.xsd.SOAPStruct echoStruct(test.wsdl.interop3.import3.xsd.SOAPStruct inputStruct) throws java.rmi.RemoteException { return inputStruct; } public test.wsdl.interop3.import3.xsd.SOAPStruct[] echoStructArray(test.wsdl.interop3.import3.xsd.SOAPStruct[] inputArray) throws java.rmi.RemoteException { return inputArray; } }
6,474
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/import3/Import3TestCase.java
package test.wsdl.interop3.import3; import test.wsdl.interop3.import3.xsd.SOAPStruct; import java.net.URL; /* <!-- SOAP Builder's round III web services --> <!-- interoperability testing: import3 --> <!-- (see http://www.whitemesa.net/r3/plan.html) --> <!-- Step 1. Start with predefined WSDL --> <!-- Step 2. Generate client from predefined WSDL --> <!-- Step 3. Test generated client against --> <!-- pre-built server --> <!-- Step 4. Generate server from predefined WSDL --> <!-- Step 5. Test generated client against --> <!-- generated server --> <!-- Step 6. Generate second client from --> <!-- generated server's WSDL (some clients --> <!-- can do this dynamically) --> <!-- Step 7. Test second generated client against --> <!-- generated server --> <!-- Step 8. Test second generated client against --> <!-- pre-built server --> */ public class Import3TestCase extends junit.framework.TestCase { public static URL url; public Import3TestCase(String name) { super(name); } public void testStep3EchoStruct() { SoapInteropImport3PortType binding; try { if (url == null) { binding = new Import3Locator().getSoapInteropImport3Port(); } else { binding = new Import3Locator().getSoapInteropImport3Port(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { SOAPStruct value = new SOAPStruct(); value.setVarString("import2 string"); value.setVarInt(5); value.setVarFloat(4.5F); SOAPStruct result = binding.echoStruct(value); assertEquals("String members didn't match", value.getVarString(), result.getVarString()); assertEquals("int members didn't match", value.getVarInt(), result.getVarInt()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void testStep3EchoStructArray() { SoapInteropImport3PortType binding; try { if (url == null) { binding = new Import3Locator().getSoapInteropImport3Port(); } else { binding = new Import3Locator().getSoapInteropImport3Port(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { SOAPStruct[] value = null; value = binding.echoStructArray(new SOAPStruct[0]); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public static void main(String[] args) { if (args.length == 1) { try { url = new URL(args[0]); } catch (Exception e) { } } junit.textui.TestRunner.run(new junit.framework.TestSuite(Import3TestCase.class)); } // main }
6,475
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/InteropTestDocLitImpl.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE; /** * * @author Glyn Normington <glyn@apache.org> */ public class InteropTestDocLitImpl implements InteropTestDocLit { public InteropTestDocLitImpl() throws java.rmi.RemoteException { } public String echoString(String a) throws java.rmi.RemoteException { return a; } public String[] echoStringArray(String[] a) throws java.rmi.RemoteException { return a; } public SOAPStruct echoStruct(SOAPStruct a) throws java.rmi.RemoteException { return a; } public void echoVoid() throws java.rmi.RemoteException { } }
6,476
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/InteropTestRpcEnc.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE; /** * This test is part of the SOAP Builders round III interoperability testing * effort described at http://www.whitemesa.net/r3/plan.html. * * The test is in group E which requires a service (this class) coding by hand * which implements the operations, parameters, and binding style/use described * in a WSDL file available from the above web site. The WSDL file is used * only as a pseudo-code description of the service. * * Next WSDL is generated from the service and the WSDL used to create a * client which is then used to invoke the service. Other vendors should * also be able to use the same, generated WSDL to invoke the service. * * This interface is a JAX-RPC service definition interface as defined * by the JAX-RPC spec., especially chapter 5. * * @author Glyn Normington <glyn@apache.org> */ public interface InteropTestRpcEnc extends java.rmi.Remote { public String echoString(String param0) throws java.rmi.RemoteException; public String[] echoStringArray(String[] param0) throws java.rmi.RemoteException; public SOAPStruct echoStruct(SOAPStruct param0) throws java.rmi.RemoteException; public void echoVoid() throws java.rmi.RemoteException; }
6,477
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/List.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE; /** * Test linked list used by the WSDLInteropTestDocLitService. * * @author Glyn Normington <glyn@apache.org> */ public class List { // items of the structure. String permits nulls. private int varInt; private String varString; private List child; /** * null constructor */ public List() {} /** * convenience constructor that sets all of the fields */ public List(int i, String s, List c) { this.varInt = i; this.varString = s; this.child = c; } /** * bean getter for VarInt */ public int getVarInt() { return varInt; } /** * bean setter for VarInt */ public void setVarInt(int varInt) { this.varInt = varInt; } /** * bean getter for VarString */ public String getVarString() { return varString; } /** * bean setter for VarString */ public void setVarString(String varString) { this.varString = varString; } /** * bean getter for Child */ public List getChild() { return child; } /** * bean setter for Child */ public void setChild(List c) { this.child = c; } /** * Equality comparison. */ public boolean equals(Object object) { if (!(object instanceof List)) return false; List that = (List)object; if (this.varInt != that.varInt) return false; if (this.varString == null) { if (that.varString != null) return false; } else { if (!this.varString.equals(that.varString)) return false; } if (this.child == null) { if (that.child != null) return false; } else { if (!this.child.equals(that.child)) return false; } return true; } /** * Printable representation */ public String toString() { return "{" + varInt + ", \"" + varString + "\", " + (child == null ? null :child.toString()) + "}"; } }
6,478
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/InteropTestList.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE; /** * This test is part of the SOAP Builders round III interoperability testing * effort described at http://www.whitemesa.net/r3/plan.html. * * The test is in group E which requires a service (this class) coding by hand * which implements the operations, parameters, and binding style/use described * in a WSDL file available from the above web site. The WSDL file is used * only as a pseudo-code description of the service. * * Next WSDL is generated from the service and the WSDL used to create a * client which is then used to invoke the service. Other vendors should * also be able to use the same, generated WSDL to invoke the service. * * This interface is a JAX-RPC service definition interface as defined * by the JAX-RPC spec., especially chapter 5. * * @author Glyn Normington <glyn@apache.org> */ public interface InteropTestList extends java.rmi.Remote { public List echoLinkedList(List param0) throws java.rmi.RemoteException; }
6,479
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/InteropTestRpcEncImpl.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE; /** * * @author Glyn Normington <glyn@apache.org> */ public class InteropTestRpcEncImpl implements InteropTestRpcEnc { public InteropTestRpcEncImpl() throws java.rmi.RemoteException { } public String echoString(String param0) throws java.rmi.RemoteException { return param0; } public String[] echoStringArray(String[] param0) throws java.rmi.RemoteException { return param0; } public SOAPStruct echoStruct(SOAPStruct param0) throws java.rmi.RemoteException { return param0; } public void echoVoid() throws java.rmi.RemoteException { } }
6,480
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/InteropTestDocLit.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE; /** * This test is part of the SOAP Builders round III interoperability testing * effort described at http://www.whitemesa.net/r3/plan.html. * * The test is in group E which requires a service (this class) coding by hand * which implements the operations, parameters, and binding style/use described * in a WSDL file available from the above web site. The WSDL file is used * only as a pseudo-code description of the service. * * Next WSDL is generated from the service and the WSDL used to create a * client which is then used to invoke the service. Other vendors should * also be able to use the same, generated WSDL to invoke the service. * * This interface is a JAX-RPC service definition interface as defined * by the JAX-RPC spec., especially chapter 5. * * @author Glyn Normington <glyn@apache.org> */ public interface InteropTestDocLit extends java.rmi.Remote { public String echoString(String a) throws java.rmi.RemoteException; public String[] echoStringArray(String[] a) throws java.rmi.RemoteException; public SOAPStruct echoStruct(SOAPStruct a) throws java.rmi.RemoteException; public void echoVoid() throws java.rmi.RemoteException; }
6,481
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/SOAPStruct.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE; /** * Test structure used by the WSDLInteropTestDocLitService. * Note: this implementation does not allow null values for varInt or varFloat. * * @author Glyn Normington <glyn@apache.org> * @author Sam Ruby <rubys@us.ibm.com> */ public class SOAPStruct { // items of the structure. String permits nulls. private float varFloat; private int varInt; private String varString; /** * null constructor */ public SOAPStruct() {} /** * convenience constructor that sets all of the fields */ public SOAPStruct(float f, int i, String s) { this.varFloat = f; this.varInt = i; this.varString = s; } /** * bean getter for VarInt */ public int getVarInt() { return varInt; } /** * bean setter for VarInt */ public void setVarInt(int varInt) { this.varInt = varInt; } /** * bean getter for VarString */ public String getVarString() { return varString; } /** * bean setter for VarString */ public void setVarString(String varString) { this.varString = varString; } /** * bean getter for VarFloat */ public float getVarFloat() { return varFloat; } /** * bean setter for VarFloat */ public void setVarFloat(float varFloat) { this.varFloat=varFloat; } /** * Equality comparison. */ public boolean equals(Object object) { if (!(object instanceof SOAPStruct)) return false; SOAPStruct that = (SOAPStruct)object; if (this.varInt != that.varInt) return false; if (this.varFloat != that.varFloat) return false; if (this.varString == null) { if (that.varString != null) return false; } else { if (!this.varString.equals(that.varString)) return false; } return true; } /** * Printable representation */ public String toString() { return "{" + varInt + ", \"" + varString + "\", " + varFloat + "}"; } }
6,482
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/InteropTestListImpl.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE; /** * * @author Glyn Normington <glyn@apache.org> */ public class InteropTestListImpl implements InteropTestList { public List echoLinkedList(List param0) throws java.rmi.RemoteException { return param0; } }
6,483
0
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/client/InteropTestRpcEncServiceTestCase.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * This file was based on a testcase auto-generated from WSDL by the * Apache Axis Wsdl2java emitter. * * @author Glyn Normington <glyn@apache.org> */ package test.wsdl.interop3.groupE.client; import junit.framework.AssertionFailedError; import java.net.URL; public class InteropTestRpcEncServiceTestCase extends junit.framework.TestCase { public static URL url; public InteropTestRpcEncServiceTestCase(String name) { super(name); } public void testInteropTestRpcEncEchoString() { InteropTestRpcEnc binding; try { if (url == null) { binding = new InteropTestRpcEncServiceLocator().getInteropTestRpcEnc(); } else { binding = new InteropTestRpcEncServiceLocator().getInteropTestRpcEnc(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { String input = "a string"; String value = binding.echoString(input); if (!value.equals(input)) { throw new AssertionFailedError("String echo failed"); } } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } public void testInteropTestRpcEncEchoStringArray() { InteropTestRpcEnc binding; try { if (url == null) { binding = new InteropTestRpcEncServiceLocator().getInteropTestRpcEnc(); } else { binding = new InteropTestRpcEncServiceLocator().getInteropTestRpcEnc(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { String[] input = {"string 1", "string 2"}; String[] value = binding.echoStringArray(input); boolean equal = true; if (input.length != value.length) { equal = false; } else { for (int i = 0; i < value.length; i++) { if (!input[i].equals(value[i])) { equal = false; } } } if (!equal) { throw new AssertionFailedError("StringArray echo failed"); } } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } public void testInteropTestRpcEncEchoStruct() { InteropTestRpcEnc binding; try { if (url == null) { binding = new InteropTestRpcEncServiceLocator().getInteropTestRpcEnc(); } else { binding = new InteropTestRpcEncServiceLocator().getInteropTestRpcEnc(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { SOAPStruct input = new SOAPStruct(); input.setVarFloat(3.142f); input.setVarInt(3); input.setVarString("Pi"); SOAPStruct value = binding.echoStruct(input); if (value.getVarFloat() != input.getVarFloat() || value.getVarInt() != input.getVarInt() || !value.getVarString().equals(input.getVarString())) { throw new AssertionFailedError("Struct echo failed"); } } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } public void testInteropTestRpcEncEchoVoid() { InteropTestRpcEnc binding; try { if (url == null) { binding = new InteropTestRpcEncServiceLocator().getInteropTestRpcEnc(); } else { binding = new InteropTestRpcEncServiceLocator().getInteropTestRpcEnc(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { binding.echoVoid(); } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } }
6,484
0
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/client/InteropTestListServiceTestCase.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * This file was based on a testcase auto-generated from WSDL by the * Apache Axis Wsdl2java emitter. * * @author Glyn Normington <glyn@apache.org> */ package test.wsdl.interop3.groupE.client; import junit.framework.AssertionFailedError; import java.net.URL; public class InteropTestListServiceTestCase extends junit.framework.TestCase { public static URL url; public InteropTestListServiceTestCase(String name) { super(name); } public void testInteropTestListEchoLinkedList() { InteropTestList binding; try { if (url == null) { binding = new InteropTestListServiceLocator().getInteropTestList(); } else { binding = new InteropTestListServiceLocator().getInteropTestList(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { List node1 = new List(); node1.setVarInt(1); node1.setVarString("last"); List node2 = new List(); node2.setVarInt(2); node2.setVarString("middle"); node2.setChild(node1); List list = new List(); list.setVarInt(3); list.setVarString("first"); list.setChild(node2); List value = binding.echoLinkedList(list); List vnode2 = value.getChild(); List vnode1 = null; if (vnode2 != null) { vnode1 = vnode2.getChild(); } if (value.getVarInt() != list.getVarInt() || !value.getVarString().equals(list.getVarString()) || vnode2 == null || vnode2.getVarInt() != node2.getVarInt() || !vnode2.getVarString().equals(node2.getVarString()) || vnode1 == null || vnode1.getVarInt() != node1.getVarInt() || !vnode1.getVarString().equals(node1.getVarString()) || vnode1.getChild() != null) { throw new AssertionFailedError("List echo failed"); } } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } }
6,485
0
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/client/InteropTestDocLitServiceTestCase.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * This file was based on a testcase auto-generated from WSDL by the * Apache Axis Wsdl2java emitter. * * @author Glyn Normington <glyn@apache.org> */ package test.wsdl.interop3.groupE.client; import junit.framework.AssertionFailedError; public class InteropTestDocLitServiceTestCase extends junit.framework.TestCase { public static java.net.URL url; public InteropTestDocLitServiceTestCase(String name) { super(name); } public void testInteropTestDocLitEchoString() { InteropTestDocLit binding; try { if (url == null) { binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(); } else { binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { String input = "a string"; String value = binding.echoString(input); if (!value.equals(input)) { throw new AssertionFailedError("String echo failed"); } } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } public void testInteropTestDocLitEchoStringArray() { InteropTestDocLit binding; try { if (url == null) { binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(); } else { binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { String[] input = {"string 1", "string 2"}; String[] value = binding.echoStringArray(input); boolean equal = true; if (input.length != value.length) { equal = false; } else { for (int i = 0; i < value.length; i++) { if (!input[i].equals(value[i])) { equal = false; } } } if (!equal) { throw new AssertionFailedError("StringArray echo failed"); } } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } public void testInteropTestDocLitEchoStruct() { InteropTestDocLit binding; try { binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(); } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { SOAPStruct input = new SOAPStruct(); input.setVarFloat(3.142f); input.setVarInt(3); input.setVarString("Pi"); SOAPStruct value = binding.echoStruct(input); if (value.getVarFloat() != input.getVarFloat() || value.getVarInt() != input.getVarInt() || !value.getVarString().equals(input.getVarString())) { throw new AssertionFailedError("Struct echo failed"); } } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } public void testInteropTestDocLitEchoVoid() { InteropTestDocLit binding; try { binding = new InteropTestDocLitServiceLocator().getInteropTestDocLit(); } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { binding.echoVoid(); } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } }
6,486
0
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE
Create_ds/axis-axis1-java/test/wsdl/interop3/groupE/client/InteropTestListServiceTestClient.java
/* * Copyright 2002-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.wsdl.interop3.groupE.client; import org.apache.axis.AxisFault; import org.apache.axis.encoding.ser.BeanDeserializerFactory; import org.apache.axis.encoding.ser.BeanSerializerFactory; import org.apache.axis.types.HexBinary; import org.apache.axis.utils.Options; import org.apache.axis.utils.XMLUtils; import org.w3c.dom.Document; import javax.wsdl.Definition; import javax.wsdl.factory.WSDLFactory; import javax.wsdl.xml.WSDLReader; import javax.xml.namespace.QName; import javax.xml.rpc.Service; import java.io.PrintWriter; import java.io.StringWriter; import java.net.URL; import java.util.Date; import java.util.Iterator; import java.util.Map; import java.util.Set; /** * Test Client for part of interop group 3E. See the main entrypoint * for more details on usage. * * @author Glyn Normington <glyn@apache.org> */ public abstract class InteropTestListServiceTestClient { public static URL url; private static final String NS = "http://soapinterop.org/WSDLInteropTestList"; private static final QName OPQN = new QName(NS, "echoLinkedList"); private static final String LISTNS = "http://soapinterop.org/xsd"; private static final QName LISTQN = new QName(LISTNS, "List"); private boolean addMethodToAction = false; private String soapAction = "http://soapinterop.org/"; private org.apache.axis.client.Call call = null; private Definition wsdl = null; private QName serviceQN = null; /** * Determine if two objects are equal. Handles nulls and recursively * verifies arrays are equal. Accepts dates within a tolerance of * 999 milliseconds. */ protected boolean equals(Object obj1, Object obj2) { if (obj1 == null || obj2 == null) return (obj1 == obj2); if (obj1.equals(obj2)) return true; // For comparison purposes, get the array of bytes representing // the HexBinary object. if (obj1 instanceof HexBinary) { obj1 = ((HexBinary) obj1).getBytes(); } if (obj2 instanceof HexBinary) { obj2 = ((HexBinary) obj2).getBytes(); } if (obj1 instanceof Date && obj2 instanceof Date) if (Math.abs(((Date)obj1).getTime()-((Date)obj2).getTime())<1000) return true; if ((obj1 instanceof Map) && (obj2 instanceof Map)) { Map map1 = (Map)obj1; Map map2 = (Map)obj2; Set keys1 = map1.keySet(); Set keys2 = map2.keySet(); if (!(keys1.equals(keys2))) return false; // Check map1 is a subset of map2. Iterator i = keys1.iterator(); while (i.hasNext()) { Object key = i.next(); if (!equals(map1.get(key), map2.get(key))) return false; } // Check map2 is a subset of map1. Iterator j = keys2.iterator(); while (j.hasNext()) { Object key = j.next(); if (!equals(map1.get(key), map2.get(key))) return false; } return true; } if ((obj1 instanceof List) && (obj2 instanceof List)) { List l1 = (List)obj1; List l2 = (List)obj2; if (l1.getVarInt() != l2.getVarInt()) return false; if (l1.getVarString() == null) { if (l2.getVarString() != null) return false; } else { if (!l1.getVarString().equals(l2.getVarString())) return false; } if (l1.getChild() == null) { if (l2.getChild() != null) return false; } else { if (!equals(l1.getChild(), l2.getChild())) return false; } } else { return false; // type mismatch or unsupported type } return true; } /** * Set up the call object. */ public void setURL(String url) throws AxisFault { try { Document doc = XMLUtils.newDocument(new URL(url).toString()); WSDLReader reader = WSDLFactory.newInstance().newWSDLReader(); reader.setFeature("javax.wsdl.verbose", false); wsdl = reader.readWSDL(null, doc); Service service = new org.apache.axis.client. Service(new URL(url), getServiceQName()); call = (org.apache.axis.client.Call)service. createCall(getPortQName(wsdl), OPQN); call.registerTypeMapping(List.class, LISTQN, BeanSerializerFactory.class, BeanDeserializerFactory.class, false); call.setReturnType(LISTQN); } catch (Exception exp) { throw AxisFault.makeFault(exp); } } /** * Introspect the WSDL to obtain a service name. * The WSDL must define one service. */ private QName getServiceQName() { serviceQN = (QName)wsdl.getServices(). keySet().iterator().next(); return new QName(serviceQN.getNamespaceURI(), serviceQN.getLocalPart()); } /** * Introspect the specified WSDL to obtain a port name. * The WSDL must define one port name. */ private QName getPortQName(Definition wsdl) { if (serviceQN == null) { getServiceQName(); } String port = (String)wsdl.getService(serviceQN).getPorts().keySet(). iterator().next(); return new QName(serviceQN.getNamespaceURI(), port); } /** * Execute the test */ public void execute() throws Exception { { Object input = null; try { List node1 = new List(); node1.setVarInt(1); node1.setVarString("last"); List node2 = new List(); node2.setVarInt(2); node2.setVarString("middle"); node2.setChild(node1); List list = new List(); list.setVarInt(3); list.setVarString("first"); list.setChild(node2); input = list; Object output = call.invoke(new Object[] {input}); verify("echoLinkedList", input, output); } catch (Exception e) { verify("echoLinkedList", input, e); } } } /** * Verify that the object sent was, indeed, the one you got back. * Subclasses are sent to override this with their own output. */ protected abstract void verify(String method, Object sent, Object gotBack); /** * Main entry point. Tests a variety of echo methods and reports * on their results. * * Arguments are of the form: * -h localhost -p 8080 -s /soap/servlet/rpcrouter * -h indicates the host * -p indicates the port * -s indicates the service part of the URI * * Alternatively a URI may be passed thus: * -l completeuri */ public static void main(String args[]) throws Exception { Options opts = new Options(args); boolean testPerformance = opts.isFlagSet('k') > 0; // set up tests so that the results are sent to System.out InteropTestListServiceTestClient client; if (testPerformance) { client = new InteropTestListServiceTestClient() { public void verify(String method, Object sent, Object gotBack) { } }; } else { client = new InteropTestListServiceTestClient() { public void verify(String method, Object sent, Object gotBack) { String message; if (this.equals(sent, gotBack)) { message = "OK"; } else { if (gotBack instanceof Exception) { if (gotBack instanceof AxisFault) { message = "Fault: " + ((AxisFault)gotBack). getFaultString(); } else { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); message = "Exception: "; ((Exception)gotBack). printStackTrace(pw); message += sw.getBuffer().toString(); } } else { message = "Fail:" + gotBack + " expected " + sent; } } // Line up the output String tab = ""; int l = method.length(); while (l < 25) { tab += " "; l++; } System.out.println(method + tab + " " + message); } }; } // set up the call object client.setURL(opts.getURL()); if (testPerformance) { long startTime = System.currentTimeMillis(); for (int i = 0; i < 10; i++) { client.execute(); } long stopTime = System.currentTimeMillis(); System.out.println("That took " + (stopTime - startTime) + " milliseconds"); } else { client.execute(); } } }
6,487
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/docLit/DocLitTestCase.java
package test.wsdl.interop3.docLit; import test.wsdl.interop3.docLit.xsd.ArrayOfstring_literal; import test.wsdl.interop3.docLit.xsd.SOAPStruct; import java.net.URL; /* <!-- SOAP Builder's round III web services --> <!-- interoperability testing: import1 --> <!-- (see http://www.whitemesa.net/r3/plan.html) --> <!-- Step 1. Start with predefined WSDL --> <!-- Step 2. Generate client from predefined WSDL --> <!-- Step 3. Test generated client against --> <!-- pre-built server --> <!-- Step 4. Generate server from predefined WSDL --> <!-- Step 5. Test generated client against --> <!-- generated server --> <!-- Step 6. Generate second client from --> <!-- generated server's WSDL (some clients --> <!-- can do this dynamically) --> <!-- Step 7. Test second generated client against --> <!-- generated server --> <!-- Step 8. Test second generated client against --> <!-- pre-built server --> */ public class DocLitTestCase extends junit.framework.TestCase { static URL url; public DocLitTestCase(String name) { super(name); } protected void setUp() throws Exception { } public void testStep3() throws Exception { WSDLInteropTestDocLitPortType binding; try { if (url != null) { binding = new WSDLInteropTestDocLitServiceLocator().getWSDLInteropTestDocLitPort(url); } else { binding = new WSDLInteropTestDocLitServiceLocator().getWSDLInteropTestDocLitPort(); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertNotNull("binding is null", binding); String str = "Hello there!"; String [] strArray = new String [] { "1", "two", "trois" }; ArrayOfstring_literal param = new ArrayOfstring_literal(); param.setString(strArray); assertEquals("echoString results differ", binding.echoString(str), str); String [] resArray = binding.echoStringArray(param).getString(); assertEquals("String array lengths differ", strArray.length, resArray.length); for (int i = 0; i < strArray.length; i++) { assertEquals("Array members at index " + i + " differ", strArray[i], resArray[i]); } SOAPStruct struct = new SOAPStruct(); struct.setVarFloat(3.14159F); struct.setVarInt(69); struct.setVarString("Struct-o-rama"); assertTrue("Structs weren't equal", struct.equals(binding.echoStruct(struct))); // test echoVoid binding.echoVoid(); } public static void main(String[] args) { if (args.length == 1) { try { url = new URL(args[0]); } catch (Exception e) { } } junit.textui.TestRunner.run(new junit.framework.TestSuite(DocLitTestCase.class)); } // main }
6,488
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/docLit/WSDLInteropTestDocLitPortBindingImpl.java
/** * WSDLInteropTestDocLitPortBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.interop3.docLit; public class WSDLInteropTestDocLitPortBindingImpl implements test.wsdl.interop3.docLit.WSDLInteropTestDocLitPortType { public java.lang.String echoString(java.lang.String echoStringParam) throws java.rmi.RemoteException { return echoStringParam; } public test.wsdl.interop3.docLit.xsd.ArrayOfstring_literal echoStringArray(test.wsdl.interop3.docLit.xsd.ArrayOfstring_literal echoStringArrayParam) throws java.rmi.RemoteException { return echoStringArrayParam; } public test.wsdl.interop3.docLit.xsd.SOAPStruct echoStruct(test.wsdl.interop3.docLit.xsd.SOAPStruct echoStructParam) throws java.rmi.RemoteException { return echoStructParam; } public void echoVoid() throws java.rmi.RemoteException { } }
6,489
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/import2/SoapInteropImport2BindingImpl.java
/** * SoapInteropImport2BindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.interop3.import2; public class SoapInteropImport2BindingImpl implements test.wsdl.interop3.import2.definitions.SoapInteropImport2PortType { public test.wsdl.interop3.import2.xsd.SOAPStruct echoStruct(test.wsdl.interop3.import2.xsd.SOAPStruct inputStruct) throws java.rmi.RemoteException { return inputStruct; } }
6,490
0
Create_ds/axis-axis1-java/test/wsdl/interop3
Create_ds/axis-axis1-java/test/wsdl/interop3/import2/Import2TestCase.java
package test.wsdl.interop3.import2; import test.wsdl.interop3.import2.definitions.SoapInteropImport2PortType; import test.wsdl.interop3.import2.xsd.SOAPStruct; import java.net.URL; /* <!-- SOAP Builder's round III web services --> <!-- interoperability testing: import2 --> <!-- (see http://www.whitemesa.net/r3/plan.html) --> <!-- Step 1. Start with predefined WSDL --> <!-- Step 2. Generate client from predefined WSDL --> <!-- Step 3. Test generated client against --> <!-- pre-built server --> <!-- Step 4. Generate server from predefined WSDL --> <!-- Step 5. Test generated client against --> <!-- generated server --> <!-- Step 6. Generate second client from --> <!-- generated server's WSDL (some clients --> <!-- can do this dynamically) --> <!-- Step 7. Test second generated client against --> <!-- generated server --> <!-- Step 8. Test second generated client against --> <!-- pre-built server --> */ public class Import2TestCase extends junit.framework.TestCase { public static URL url; public Import2TestCase(String name) { super(name); } public void testStep3() { SoapInteropImport2PortType binding; try { if (url == null) { binding = new Import2Locator().getSoapInteropImport2Port(); } else { binding = new Import2Locator().getSoapInteropImport2Port(url); } } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { SOAPStruct value = new SOAPStruct(); value.setVarString("import2 string"); value.setVarInt(5); value.setVarFloat(4.5F); SOAPStruct result = binding.echoStruct(value); assertEquals("String members didn't match", value.getVarString(), result.getVarString()); assertEquals("int members didn't match", value.getVarInt(), result.getVarInt()); //assertEquals("float members didn't match", value.getVarFloat(), result.getVarFloat()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } /* doesn't work yet public void testStep8() { SoapInteropImport2PortType binding; try { binding = new SoapInteropImport2PortTypeServiceLocator().getSoapInteropImport2Port(new java.net.URL("http://mssoapinterop.org/stkV3/wsdl/import2.wsdl")); } catch (Throwable t) { throw new junit.framework.AssertionFailedError("Throwable caught: " + t); } assertTrue("binding is null", binding != null); try { SOAPStruct value = null; value = binding.echoStruct(new SOAPStruct()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } */ /* Not working right now. public void testAbsoluteStep3() { test.wsdl.interop3.absimport2.definitions.SoapInteropImport2PortType binding; try { binding = new test.wsdl.interop3.absimport2.Import2Locator().getSoapInteropImport2Port(); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { test.wsdl.interop3.absimport2.xsd.SOAPStruct value = null; value = binding.echoStruct(new test.wsdl.interop3.absimport2.xsd.SOAPStruct()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void testAbsoluteStep5() { test.wsdl.interop3.absimport2.definitions.SoapInteropImport2PortType binding; try { binding = new test.wsdl.interop3.absimport2.Import2Locator().getSoapInteropImport2Port(new java.net.URL("http://localhost:8080/axis/services/SoapInteropImport2Port")); } catch (Throwable t) { throw new junit.framework.AssertionFailedError("Throwable caught: " + t); } assertTrue("binding is null", binding != null); try { test.wsdl.interop3.absimport2.xsd.SOAPStruct value = null; value = binding.echoStruct(new test.wsdl.interop3.absimport2.xsd.SOAPStruct()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void testAbsoluteStep7() { test.wsdl.interop3.absimport2.step6.definitions.SoapInteropImport2PortType binding; try { binding = new test.wsdl.interop3.absimport2.step6.definitions.SoapInteropImport2PortTypeServiceLocator().getSoapInteropImport2Port(); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { test.wsdl.interop3.absimport2.step6.xsd.SOAPStruct value = null; value = binding.echoStruct(new test.wsdl.interop3.absimport2.step6.xsd.SOAPStruct()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } */ /* doesn't work yet public void testAbsoluteStep8() { SoapInteropImport2PortType binding; try { binding = new SoapInteropImport2PortTypeServiceLocator().getSoapInteropImport2Port(new java.net.URL("http://mssoapinterop.org/stkV3/wsdl/import2.wsdl")); } catch (Throwable t) { throw new junit.framework.AssertionFailedError("Throwable caught: " + t); } assertTrue("binding is null", binding != null); try { SOAPStruct value = null; value = binding.echoStruct(new SOAPStruct()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } */ public static void main(String[] args) { if (args.length == 1) { try { url = new URL(args[0]); } catch (Exception e) { } } junit.textui.TestRunner.run(new junit.framework.TestSuite(Import2TestCase.class)); } // main }
6,491
0
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/dime
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/dime/doc/AttachmentsBindingImpl.java
/** * AttachmentsBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop4.groupG.dime.doc; import org.apache.axis.Message; import org.apache.axis.AxisEngine; import java.util.Collection; public class AttachmentsBindingImpl implements test.wsdl.interop4.groupG.dime.doc.AttachmentsPortType{ public org.apache.axis.attachments.OctetStream echoAttachment(org.apache.axis.attachments.OctetStream in) throws java.rmi.RemoteException { return in; } public org.apache.axis.attachments.OctetStream[] echoAttachments(org.apache.axis.attachments.OctetStream[] item) throws java.rmi.RemoteException { return item; } public byte[] echoAttachmentAsBase64(org.apache.axis.attachments.OctetStream in) throws java.rmi.RemoteException { return in.getBytes(); } public org.apache.axis.attachments.OctetStream echoBase64AsAttachment(byte[] in) throws java.rmi.RemoteException { Message response = AxisEngine.getCurrentMessageContext().getResponseMessage(); response.getAttachmentsImpl().setSendType(org.apache.axis.attachments.Attachments.SEND_TYPE_DIME); return new org.apache.axis.attachments.OctetStream(in); } public void echoUnrefAttachments() throws java.rmi.RemoteException { org.apache.axis.Message reqMsg = AxisEngine.getCurrentMessageContext().getRequestMessage(); Collection attachments = reqMsg.getAttachmentsImpl().getAttachments(); org.apache.axis.Message respMsg = AxisEngine.getCurrentMessageContext().getResponseMessage(); respMsg.getAttachmentsImpl().setAttachmentParts(attachments); } public java.lang.String echoAttachmentAsString(java.lang.String in) throws java.rmi.RemoteException { return in; } }
6,492
0
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/dime
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/dime/doc/DimeDOCInteropTestCase.java
/** * DimeDOCInteropTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop4.groupG.dime.doc; import java.net.URL; import java.util.Arrays; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.io.ByteArrayInputStream; import org.apache.axis.attachments.OctetStream; import org.apache.axis.client.Call; import javax.activation.DataSource; import javax.activation.DataHandler; public class DimeDOCInteropTestCase extends junit.framework.TestCase { public DimeDOCInteropTestCase(java.lang.String name) { super(name); } public void testDimeDOCSoapPortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getServiceName()); assertTrue(service != null); } protected void setUp() throws Exception { if(url == null) { url = new URL(new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPortAddress()); } } public void test1DimeDOCSoapPortEchoAttachment() throws Exception { test.wsdl.interop4.groupG.dime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation OctetStream input = new OctetStream("EchoAttachment".getBytes()); OctetStream output = null; output = binding.echoAttachment(input); // TBD - validate results assertTrue(Arrays.equals(input.getBytes(), output.getBytes())); } public void test2DimeDOCSoapPortEchoAttachments() throws Exception { test.wsdl.interop4.groupG.dime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); OctetStream[] input = new OctetStream[2]; input[0] = new OctetStream("EchoAttachments0".getBytes()); input[1] = new OctetStream("EchoAttachments1".getBytes()); // Test operation OctetStream[] output = null; output = binding.echoAttachments(input); // TBD - validate results assertTrue(Arrays.equals(input[0].getBytes(), output[0].getBytes())); assertTrue(Arrays.equals(input[1].getBytes(), output[1].getBytes())); } public void test3DimeDOCSoapPortEchoAttachmentAsBase64() throws Exception { test.wsdl.interop4.groupG.dime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); OctetStream input = new OctetStream("EchoAttachmentAsBase64".getBytes()); // Test operation byte[] output = null; output = binding.echoAttachmentAsBase64(input); // TBD - validate results assertTrue(Arrays.equals(input.getBytes(), output)); } public void test4DimeDOCSoapPortEchoBase64AsAttachment() throws Exception { test.wsdl.interop4.groupG.dime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); byte[] input = "EchoBase64AsAttachment".getBytes(); // Test operation OctetStream output = null; output = binding.echoBase64AsAttachment(input); // TBD - validate results assertTrue(Arrays.equals(input, output.getBytes())); } public void test5DimeDOCSoapPortEchoUnrefAttachments() throws Exception { test.wsdl.interop4.groupG.dime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); class Src implements DataSource{ InputStream m_src; String m_type; public Src(InputStream data, String type){ m_src=data; m_type=type; } public String getContentType(){ return m_type; } public InputStream getInputStream() throws IOException{ m_src.reset(); return m_src; } public String getName(){ return "Some-Data"; } public OutputStream getOutputStream(){ throw new UnsupportedOperationException("I don't give output streams"); } } ByteArrayInputStream ins=new ByteArrayInputStream("EchoUnrefAttachments".getBytes()); DataHandler dh=new DataHandler(new Src(ins,"application/octetstream")); ((org.apache.axis.client.Stub)binding).addAttachment(dh); ((org.apache.axis.client.Stub)binding)._setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, Call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME); // Test operation binding.echoUnrefAttachments(); // TBD - validate results Object attachments[] = ((org.apache.axis.client.Stub)binding).getAttachments(); assertEquals(1, attachments.length); } public void test6DimeDOCSoapPortEchoAttachmentAsString() throws Exception { test.wsdl.interop4.groupG.dime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); java.lang.String input = "EchoAttachmentAsString"; // Test operation java.lang.String output = null; output = binding.echoAttachmentAsString(input); // TBD - validate results assertEquals(input, output); } public static URL url = null; public static void main(String[] args) throws Exception { if (args.length == 1) { url = new URL(args[0]); } else { url = new URL(new test.wsdl.interop4.groupG.dime.doc.DimeDOCInteropLocator().getDimeDOCSoapPortAddress()); } junit.textui.TestRunner.run(new junit.framework.TestSuite(DimeDOCInteropTestCase.class)); } // main }
6,493
0
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/dime
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/dime/rpc/DimeRPCInteropTestCase.java
/** * DimeRPCInteropTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop4.groupG.dime.rpc; import org.apache.axis.attachments.OctetStream; import org.apache.axis.client.Call; import javax.activation.DataSource; import javax.activation.DataHandler; import java.net.URL; import java.util.Arrays; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.io.ByteArrayInputStream; public class DimeRPCInteropTestCase extends junit.framework.TestCase { public DimeRPCInteropTestCase(java.lang.String name) { super(name); } public void testDimeRPCSoapPortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getDimeRPCSoapPortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getServiceName()); assertTrue(service != null); } protected void setUp() throws Exception { if(url == null) { url = new URL(new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getDimeRPCSoapPortAddress()); } } public void test1DimeRPCSoapPortEchoAttachment() throws Exception { test.wsdl.interop4.groupG.dime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getDimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation OctetStream input = new OctetStream("EchoAttachment".getBytes()); OctetStream output = null; output = binding.echoAttachment(input); // TBD - validate results assertTrue(Arrays.equals(input.getBytes(), output.getBytes())); } public void test2DimeRPCSoapPortEchoAttachments() throws Exception { test.wsdl.interop4.groupG.dime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getDimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); OctetStream[] input = new OctetStream[2]; input[0] = new OctetStream("EchoAttachments0".getBytes()); input[1] = new OctetStream("EchoAttachments1".getBytes()); // Test operation OctetStream[] output = null; output = binding.echoAttachments(input); // TBD - validate results assertTrue(Arrays.equals(input[0].getBytes(), output[0].getBytes())); assertTrue(Arrays.equals(input[1].getBytes(), output[1].getBytes())); } public void test3DimeRPCSoapPortEchoAttachmentAsBase64() throws Exception { test.wsdl.interop4.groupG.dime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getDimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); OctetStream input = new OctetStream("EchoAttachmentAsBase64".getBytes()); // Test operation byte[] output = null; output = binding.echoAttachmentAsBase64(input); // TBD - validate results assertTrue(Arrays.equals(input.getBytes(), output)); } public void test4DimeRPCSoapPortEchoBase64AsAttachment() throws Exception { test.wsdl.interop4.groupG.dime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getDimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); byte[] input = "EchoBase64AsAttachment".getBytes(); // Test operation OctetStream output = null; output = binding.echoBase64AsAttachment(input); // TBD - validate results assertTrue(Arrays.equals(input, output.getBytes())); } public void test5DimeRPCSoapPortEchoUnrefAttachments() throws Exception { test.wsdl.interop4.groupG.dime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getDimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); class Src implements DataSource{ InputStream m_src; String m_type; public Src(InputStream data, String type){ m_src=data; m_type=type; } public String getContentType(){ return m_type; } public InputStream getInputStream() throws IOException{ m_src.reset(); return m_src; } public String getName(){ return "Some-Data"; } public OutputStream getOutputStream(){ throw new UnsupportedOperationException("I don't give output streams"); } } ByteArrayInputStream ins=new ByteArrayInputStream("EchoUnrefAttachments".getBytes()); DataHandler dh=new DataHandler(new Src(ins,"application/octetstream")); ((org.apache.axis.client.Stub)binding).addAttachment(dh); ((org.apache.axis.client.Stub)binding)._setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, Call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME); // Test operation binding.echoUnrefAttachments(); // TBD - validate results Object attachments[] = ((org.apache.axis.client.Stub)binding).getAttachments(); assertEquals(1, attachments.length); } public void test6DimeRPCSoapPortEchoAttachmentAsString() throws Exception { test.wsdl.interop4.groupG.dime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.dime.rpc.DimeRPCInteropLocator().getDimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); java.lang.String input = "EchoAttachmentAsString"; // Test operation java.lang.String output = null; output = binding.echoAttachmentAsString(input); // TBD - validate results assertEquals(input, output); } public static URL url = null; }
6,494
0
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/dime
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/dime/rpc/AttachmentsBindingImpl.java
/** * AttachmentsBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop4.groupG.dime.rpc; import org.apache.axis.AxisEngine; import org.apache.axis.Message; import java.util.Collection; public class AttachmentsBindingImpl implements test.wsdl.interop4.groupG.dime.rpc.AttachmentsPortType{ public org.apache.axis.attachments.OctetStream echoAttachment(org.apache.axis.attachments.OctetStream in) throws java.rmi.RemoteException { return in; } public org.apache.axis.attachments.OctetStream[] echoAttachments(org.apache.axis.attachments.OctetStream in[]) throws java.rmi.RemoteException { return in; } public byte[] echoAttachmentAsBase64(org.apache.axis.attachments.OctetStream in) throws java.rmi.RemoteException { return in.getBytes(); } public org.apache.axis.attachments.OctetStream echoBase64AsAttachment(byte[] in) throws java.rmi.RemoteException { Message response = AxisEngine.getCurrentMessageContext().getResponseMessage(); response.getAttachmentsImpl().setSendType(org.apache.axis.attachments.Attachments.SEND_TYPE_DIME); return new org.apache.axis.attachments.OctetStream(in); } public void echoUnrefAttachments() throws java.rmi.RemoteException { org.apache.axis.Message reqMsg = AxisEngine.getCurrentMessageContext().getRequestMessage(); Collection attachments = reqMsg.getAttachmentsImpl().getAttachments(); org.apache.axis.Message respMsg = AxisEngine.getCurrentMessageContext().getResponseMessage(); respMsg.getAttachmentsImpl().setAttachmentParts(attachments); } public java.lang.String echoAttachmentAsString(java.lang.String in) throws java.rmi.RemoteException { return in; } }
6,495
0
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/mime
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/mime/doc/AttachmentsBindingImpl.java
/** * AttachmentsBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop4.groupG.mime.doc; public class AttachmentsBindingImpl implements test.wsdl.interop4.groupG.mime.doc.AttachmentsPortType{ public org.apache.axis.attachments.OctetStream echoAttachment(org.apache.axis.attachments.OctetStream in) throws java.rmi.RemoteException { return in; } public org.apache.axis.attachments.OctetStream[] echoAttachments(org.apache.axis.attachments.OctetStream item[]) throws java.rmi.RemoteException { return item; } public test.wsdl.interop4.groupG.mime.doc.xsd.Binary echoAttachmentAsBase64(org.apache.axis.attachments.OctetStream in) throws java.rmi.RemoteException { return new test.wsdl.interop4.groupG.mime.doc.xsd.Binary(in.getBytes()); } public org.apache.axis.attachments.OctetStream echoBase64AsAttachment(test.wsdl.interop4.groupG.mime.doc.xsd.Binary in) throws java.rmi.RemoteException { return new org.apache.axis.attachments.OctetStream(in.get_value()); } }
6,496
0
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/mime
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/mime/doc/MimeDOCInteropTestCase.java
/** * MimeDOCInteropTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop4.groupG.mime.doc; import org.apache.axis.attachments.OctetStream; import java.util.Arrays; import java.net.URL; public class MimeDOCInteropTestCase extends junit.framework.TestCase { public MimeDOCInteropTestCase(java.lang.String name) { super(name); } public void testMimeDOCSoapPortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.interop4.groupG.mime.doc.MimeDOCInteropLocator().getMimeDOCSoapPortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.interop4.groupG.mime.doc.MimeDOCInteropLocator().getServiceName()); assertTrue(service != null); } protected void setUp() throws Exception { if(url == null) { url = new URL(new test.wsdl.interop4.groupG.mime.doc.MimeDOCInteropLocator().getMimeDOCSoapPortAddress()); } } public void test1MimeDOCSoapPortEchoAttachment() throws Exception { test.wsdl.interop4.groupG.mime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.mime.doc.MimeDOCInteropLocator().getMimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation OctetStream input = new OctetStream("EchoAttachment".getBytes()); OctetStream output = null; output = binding.echoAttachment(input); // TBD - validate results assertTrue(Arrays.equals(input.getBytes(), output.getBytes())); } public void test2MimeDOCSoapPortEchoAttachments() throws Exception { test.wsdl.interop4.groupG.mime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.mime.doc.MimeDOCInteropLocator().getMimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); OctetStream[] input = new OctetStream[2]; input[0] = new OctetStream("EchoAttachments0".getBytes()); input[1] = new OctetStream("EchoAttachments1".getBytes()); // Test operation OctetStream[] output = null; output = binding.echoAttachments(input); // TBD - validate results assertTrue(Arrays.equals(input[0].getBytes(), output[0].getBytes())); assertTrue(Arrays.equals(input[1].getBytes(), output[1].getBytes())); } public void test3MimeDOCSoapPortEchoAttachmentAsBase64() throws Exception { test.wsdl.interop4.groupG.mime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.mime.doc.MimeDOCInteropLocator().getMimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); OctetStream input = new OctetStream("EchoAttachmentAsBase64".getBytes()); // Test operation test.wsdl.interop4.groupG.mime.doc.xsd.Binary output = null; output = binding.echoAttachmentAsBase64(input); // TBD - validate results assertTrue(Arrays.equals(input.getBytes(), output.get_value())); } public void test4MimeDOCSoapPortEchoBase64AsAttachment() throws Exception { test.wsdl.interop4.groupG.mime.doc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.mime.doc.MimeDOCInteropLocator().getMimeDOCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); byte[] input = "EchoBase64AsAttachment".getBytes(); // Test operation OctetStream output = null; output = binding.echoBase64AsAttachment(new test.wsdl.interop4.groupG.mime.doc.xsd.Binary(input)); // TBD - validate results assertTrue(Arrays.equals(input, output.getBytes())); } public static URL url = null; public static void main(String[] args) throws Exception { if (args.length == 1) { url = new URL(args[0]); } else { url = new URL(new test.wsdl.interop4.groupG.mime.doc.MimeDOCInteropLocator().getMimeDOCSoapPortAddress()); } junit.textui.TestRunner.run(new junit.framework.TestSuite(MimeDOCInteropTestCase.class)); } // main }
6,497
0
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/mime
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/mime/rpc/AttachmentsBindingImpl.java
/** * AttachmentsBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop4.groupG.mime.rpc; import org.apache.axis.attachments.OctetStream; public class AttachmentsBindingImpl implements test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType{ public OctetStream echoAttachment(OctetStream in) throws java.rmi.RemoteException { return in; } public OctetStream[] echoAttachments(OctetStream in[]) throws java.rmi.RemoteException { return in; } public byte[] echoAttachmentAsBase64(OctetStream in) throws java.rmi.RemoteException { return in.getBytes(); } public OctetStream echoBase64AsAttachment(byte[] in) throws java.rmi.RemoteException { return new OctetStream(in); } }
6,498
0
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/mime
Create_ds/axis-axis1-java/test/wsdl/interop4/groupG/mime/rpc/MimeRPCInteropTestCase.java
/** * MimeRPCInteropTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.interop4.groupG.mime.rpc; import org.apache.axis.attachments.OctetStream; import java.util.Arrays; import java.net.URL; public class MimeRPCInteropTestCase extends junit.framework.TestCase { public MimeRPCInteropTestCase(java.lang.String name) { super(name); } public void testMimeRPCSoapPortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getServiceName()); assertTrue(service != null); } protected void setUp() throws Exception { if(url == null) { url = new URL(new test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPortAddress()); } } public void test1MimeRPCSoapPortEchoAttachment() throws Exception { test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if (jre.getLinkedCause() != null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Test operation OctetStream input = new OctetStream("EchoAttachment".getBytes()); OctetStream output = null; output = binding.echoAttachment(input); // TBD - validate results assertTrue(Arrays.equals(input.getBytes(), output.getBytes())); } public void test2MimeRPCSoapPortEchoAttachments() throws Exception { test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if (jre.getLinkedCause() != null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); OctetStream[] input = new OctetStream[2]; input[0] = new OctetStream("EchoAttachments0".getBytes()); input[1] = new OctetStream("EchoAttachments1".getBytes()); // Test operation OctetStream[] output = null; output = binding.echoAttachments(input); // TBD - validate results assertTrue(Arrays.equals(input[0].getBytes(), output[0].getBytes())); assertTrue(Arrays.equals(input[1].getBytes(), output[1].getBytes())); } public void test3MimeRPCSoapPortEchoAttachmentAsBase64() throws Exception { test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if (jre.getLinkedCause() != null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); OctetStream input = new OctetStream("EchoAttachmentAsBase64".getBytes()); // Test operation byte[] output = null; output = binding.echoAttachmentAsBase64(input); // TBD - validate results assertTrue(Arrays.equals(input.getBytes(), output)); } public void test4MimeRPCSoapPortEchoBase64AsAttachment() throws Exception { test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType binding; try { binding = new test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPort(url); } catch (javax.xml.rpc.ServiceException jre) { if (jre.getLinkedCause() != null) jre.getLinkedCause().printStackTrace(); throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); byte[] input = "EchoBase64AsAttachment".getBytes(); // Test operation OctetStream output = null; output = binding.echoBase64AsAttachment(input); // TBD - validate results assertTrue(Arrays.equals(input, output.getBytes())); } public static URL url = null; public static void main(String[] args) throws Exception { if (args.length == 1) { url = new URL(args[0]); } else { url = new URL(new test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPortAddress()); } junit.textui.TestRunner.run(new junit.framework.TestSuite(MimeRPCInteropTestCase.class)); } // main }
6,499