/**************************************************************** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * @author: Copyright (C) Tim Carver * ***************************************************************/ package ext.jemboss.soap; import java.io.*; import java.util.*; import ext.jemboss.JembossParams; import javax.swing.JOptionPane; //AXIS import org.apache.axis.client.Call; import org.apache.axis.client.Service; import javax.xml.namespace.QName; import org.apache.axis.encoding.XMLType; /** * * Make a axis call to a private server, using the default service * */ public class PrivateRequest { /** results from calling the web service */ private Hashtable proganswer; /** * * @param mysettings jemboss properties * @param method method to call * @param args arguments * @throws JembossSoapException if authentication fails * */ public PrivateRequest(JembossParams mysettings, String method, Vector args) throws JembossSoapException { this(mysettings, mysettings.getPrivateSoapService(), method, args); } /** * * @param mysettings jemboss properties * @param service service to call * @param method method to call * @throws JembossSoapException If authentication fails * */ public PrivateRequest(JembossParams mysettings, String service, String method) throws JembossSoapException { this(mysettings, service, method, (Vector) null); } /** * * @param mysettings jemboss properties * @param service service to call * @param method method to call * @param args arguments * @throws JembossSoapException if authentication fails */ public PrivateRequest(JembossParams mysettings, String service, String method, Vector args) throws JembossSoapException { try { String endpoint = mysettings.getPublicSoapURL()+"/"+service; org.apache.axis.client.Service serv = new org.apache.axis.client.Service(); Call call = (Call) serv.createCall(); QName qn = new QName(service, method); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName(new QName(service, method)); call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP12_ENC); int nargs = 0; Object params[] = null; if(args != null) { if(mysettings.getUseAuth()) nargs = args.size()+2; else nargs = args.size()+1; params = new Object[nargs]; Enumeration e = args.elements(); for(int i=0;i