Package xsul.wsif

Examples of xsul.wsif.WSIFMessage


     * @param serviceName
     * @return The list of concreate WSDL QNames.
     * @throws ComponentRegistryException
     */
    public String[] findService(String serviceName) throws ComponentRegistryException {
        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, serviceName } },
                SEARCH_SERVICE_INSTANCE);
        return findArrayValue(RESULTS, (WSIFMessageElement) response).toArray(new String[] {});
    }
View Full Code Here


     * @param serviceName
     * @return The list of abstract WSDL QNames.
     * @throws ComponentRegistryException
     */
    public String[] findServiceDesc(String serviceName) throws ComponentRegistryException {
        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, serviceName } },
                SEARCH_SERVIE);
        return findArrayValue(RESULTS, (WSIFMessageElement) response).toArray(new String[] {});
    }
View Full Code Here

     * @param wsdlQName
     * @return The AWSDL.
     * @throws ComponentRegistryException
     */
    public String getAbstractWsdl(String wsdlQName) throws ComponentRegistryException {
        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, wsdlQName } },
                GET_ABSTRACT_WSDL);
        return (String) response.getObjectPart(DESC_AS_STRING);
    }
View Full Code Here

     * @return
     * @throws XBayaException
     */
    public synchronized boolean invoke() throws XBayaException {
        try {
            WSIFMessage inputMessage = this.invoker.getInputs();
            logger.info("inputMessage: " + XMLUtil.xmlElementToString((XmlElement) inputMessage));
            this.notifier.invokingService(inputMessage);

            ExecutorService executor = Executors.newSingleThreadExecutor();
            this.result = executor.submit(new Callable<Boolean>() {
                @SuppressWarnings("boxing")
                public Boolean call() {
                    try {
                        boolean success = GenericInvoker.this.invoker.invoke();
                        if (success) {
                            // Send notification
                            WSIFMessage outputMessage = GenericInvoker.this.invoker.getOutputs();
                            // An implementation of WSIFMessage,
                            // WSIFMessageElement, implements toString(), which
                            // serialize the message XML.
                            logger.info("outputMessage: " + outputMessage);
                            GenericInvoker.this.notifier.serviceFinished(outputMessage);
                        } else {
                            WSIFMessage faultMessage = GenericInvoker.this.invoker.getFault();
                            // An implementation of WSIFMessage,
                            // WSIFMessageElement, implements toString(), which
                            // serialize the message XML.
                            logger.info("received fault: " + faultMessage);
                            GenericInvoker.this.notifier.receivedFault(faultMessage);
View Full Code Here

                }
            }
            // Wait for the job to finish.
            Boolean success = this.result.get();
            if (success == false) {
                WSIFMessage faultMessage = this.invoker.getFault();
                String message = "Error in a service: ";
                // An implementation of WSIFMessage,
                // WSIFMessageElement, implements toString(), which
                // serialize the message XML.
                message += faultMessage.toString();
                throw new XBayaException(message);
            }
        } catch (InterruptedException e) {
            logger.error(e.getMessage(), e);
        } catch (ExecutionException e) {
View Full Code Here

            throws ComponentRegistryException {

        WSIFPort port = wclient.getPort();

        WSIFOperation operation = port.createOperation(opName);
        WSIFMessage outputMessage = operation.createOutputMessage();
        WSIFMessage faultMessage = operation.createFaultMessage();
        String messageName = operation.createInputMessage().getName();
        XmlElement inputMsgElem = builder.newFragment(this.requestNS, messageName);

        for (int i = 0; i < args.length; i++) {
            createMessage((String) args[i][0], args[i][1], inputMsgElem);
View Full Code Here

     * @throws XBayaException
     */
    public WsdlDefinitions createService(String serviceQName) throws XBayaException {
        logger.debug(serviceQName);
        try {
            WSIFMessage inputMessage = this.gFacOperation.createInputMessage();
            WSIFMessage outputMessage = this.gFacOperation.createOutputMessage();
            WSIFMessage faultMessage = this.gFacOperation.createFaultMessage();

            inputMessage.setObjectPart(SERVICE_QNAME_PART, serviceQName);
            inputMessage.setObjectPart(SECURITY_PART, SECURITY_NONE);

            logger.info("inputMessage: " + inputMessage);
            boolean success = this.gFacOperation.executeRequestResponseOperation(inputMessage, outputMessage,
                    faultMessage);
            if (!success) {
                // An implementation of WSIFMessage, WSIFMessageElement,
                // implements toString(), which serialize the message XML.
                String message = "Failed to create a service: " + faultMessage.toString();
                throw new XBayaException(message);
            }

            String wsdl = (String) outputMessage.getObjectPart(WSDL_PART);
            logger.info("WSDL: " + wsdl);
View Full Code Here

    public void shutdownService() throws XBayaException {
        WSIFService service = WSIFServiceFactory.newInstance().getService(this.serviceDefinitions);
        WSIFPort port = service.getPort();
        WSIFOperation operation = port.createOperation(SHUTDOWN_OPERATION);

        WSIFMessage inputMessage = operation.createInputMessage();
        WSIFMessage outputMessage = operation.createOutputMessage();
        WSIFMessage faultMessage = operation.createFaultMessage();

        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
        if (!success) {
            // An implementation of WSIFMessage, WSIFMessageElement,
            // implements toString(), which serialize the message XML.
            String message = "Failed to shutdown the service: " + faultMessage.toString();
            throw new XBayaException(message);
        }
    }
View Full Code Here

     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke()
     */
    public synchronized boolean invoke() throws XBayaException {

        try {
            WSIFMessage inputMessage = super.getInputs();
            logger.info("inputMessage: " + XMLUtil.xmlElementToString((XmlElement) inputMessage));
            this.notifier.invokingService(inputMessage);

            ExecutorService executor = Executors.newSingleThreadExecutor();
            this.result = executor.submit(new Callable<Boolean>() {
                @SuppressWarnings("boxing")
                public Boolean call() {
                    try {
                        boolean success = WorkflowInvokerWrapperForGFacInvoker.super.invoke();
                        if (success) {
                            // Send notification
                            WSIFMessage outputMessage = WorkflowInvokerWrapperForGFacInvoker.super.getOutputs();
                            // An implementation of WSIFMessage,
                            // WSIFMessageElement, implements toString(), which
                            // serialize the message XML.
                            logger.info("outputMessage: " + outputMessage);
                            WorkflowInvokerWrapperForGFacInvoker.this.notifier.serviceFinished(outputMessage);
                        } else {
                            WSIFMessage faultMessage = WorkflowInvokerWrapperForGFacInvoker.super.getFault();
                            // An implementation of WSIFMessage,
                            // WSIFMessageElement, implements toString(), which
                            // serialize the message XML.
                            logger.info("received fault: " + faultMessage);
                            WorkflowInvokerWrapperForGFacInvoker.this.notifier.receivedFault(faultMessage);
View Full Code Here

                }
            }
            // Wait for the job to finish.
            Boolean success = this.result.get();
            if (success == false) {
                WSIFMessage faultMessage = super.getFault();
                String message = "Error in a service: ";
                // An implementation of WSIFMessage,
                // WSIFMessageElement, implements toString(), which
                // serialize the message XML.
                message += faultMessage.toString();
                throw new XBayaException(message);
            }
        } catch (InterruptedException e) {
            logger.error(e.getMessage(), e);
        } catch (ExecutionException e) {
View Full Code Here

TOP

Related Classes of xsul.wsif.WSIFMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.