package at.gv.egovernment.moa.spss.client.call; import java.rmi.RemoteException; import java.util.Vector; import javax.xml.namespace.QName; import javax.xml.rpc.Call; import javax.xml.rpc.Service; import javax.xml.rpc.ServiceException; import javax.xml.rpc.ServiceFactory; import org.apache.axis.message.SOAPBodyElement; import org.w3c.dom.Element; /** * @author Patrick Peck * @version $Id$ */ public class MOACaller { protected Element doCall(QName serviceName, Element request, String endPoint) throws RemoteException, ServiceException, Exception { Service service = ServiceFactory.newInstance().createService(serviceName); Call call = service.createCall(); SOAPBodyElement body = new SOAPBodyElement(request); SOAPBodyElement[] params = new SOAPBodyElement[] {body}; Vector responses; SOAPBodyElement response; call.setTargetEndpointAddress(endPoint); responses = (Vector) call.invoke(params); response = (SOAPBodyElement) responses.get(0); return response.getAsDOM(); } }