diff options
author | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-07-18 07:19:15 +0000 |
---|---|---|
committer | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-07-18 07:19:15 +0000 |
commit | a14de9592f27182b8b3ef7dfe3950ce4a9c843e0 (patch) | |
tree | 4cb2968dc180fbef2e2ca43df81e9b9ca5469e3e /spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/moainvoker | |
parent | ac3296bb205048da5a1e4494dd4956f4312cf948 (diff) | |
download | moa-id-spss-tags/Build-ID-1_2_0_D10.tar.gz moa-id-spss-tags/Build-ID-1_2_0_D10.tar.bz2 moa-id-spss-tags/Build-ID-1_2_0_D10.zip |
This commit was manufactured by cvs2svn to create tagtags/Build-ID-1_2_0_D10
'Build-ID-1_2_0_D10'.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build-ID-1_2_0_D10@383 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/moainvoker')
-rw-r--r-- | spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/moainvoker/MOAInvoker.java | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/moainvoker/MOAInvoker.java b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/moainvoker/MOAInvoker.java deleted file mode 100644 index e89d255f0..000000000 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/moainvoker/MOAInvoker.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Created on 19.11.2003 - * - * (c) Stabsstelle IKT-Strategie des Bundes - */ -package at.gv.egovernment.moa.spss.slinterface.moainvoker; - -import java.io.IOException; -import java.io.OutputStream; -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.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.XMLSerializer; -import org.w3c.dom.Document; - -import at.gv.egovernment.moa.spss.slinterface.Constants; - -/** - * @author Gregor Karlinger (mailto:gregor.karlinger@cio.gv.at) - */ -public class MOAInvoker -{ - /** - * Invokes MOA SP. - * - * @param request The XML request to be sent to MOA SP. - * - * @param endpoint The endpoint of the SOAP service where to send the XML request to. - * - * @return the XML response from the service. - * - * @throws Exception if getting the XML response from the SOAP response body fails. - * - * @throws RemoteException if MOA SP signals an error. - * - * @throws ServiceException if the SOAP client invoking MOA SP signals an error. - */ - public static Document invokeSP(Document request, String endpoint) - throws Exception, RemoteException, ServiceException - { - QName serviceQName = new QName(Constants.MI_SP_QNAME_); - return invoke(request, endpoint, serviceQName); - } - - /* ---------------------------------------------------------------------------------------------------- */ - - private static Document invoke(Document request, String endpoint, QName serviceQName) throws Exception - { - // Instantiate AXIS service - Service service = ServiceFactory.newInstance().createService(serviceQName); - - // Create and configure service call - Call call = service.createCall(); - call.setTargetEndpointAddress(endpoint); - - // Create SOAP body - SOAPBodyElement body = new SOAPBodyElement(request.getDocumentElement()); - SOAPBodyElement[] params = new SOAPBodyElement[] {body}; - - // Make call - Vector responses = (Vector) call.invoke(params); - - // Get response - SOAPBodyElement responseBody = (SOAPBodyElement) responses.get(0); - Document response = responseBody.getAsDocument(); - return response; - } - - /* ---------------------------------------------------------------------------------------------------- */ - - public static void serializeDocument(Document doc, OutputStream out) throws IOException - { - OutputFormat format = new OutputFormat(doc); - - format.setLineSeparator("\n"); - format.setIndenting(false); - format.setPreserveSpace(true); - format.setOmitXMLDeclaration(false); - format.setEncoding("UTF-8"); - - XMLSerializer serializer = new XMLSerializer(out, format); - serializer.serialize(doc); - } -} |