Java Code Examples for org.apache.axis2.AxisFault#printStackTrace()

The following examples show how to use org.apache.axis2.AxisFault#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ServiceInvoker.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
public void setInvokerName(String invokerName) {
    this.invokerName = invokerName;

    if (statefull) {
        client.getOptions().setManageSession(true);
        client.getOptions().setAction("setClientName");

        OMElement cName = fac.createOMElement("cName", null);
        cName.setText(invokerName);

        try {
            OMElement response = client.sendReceive(cName);
            System.out.println(response.getText());
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }
    }
}
 
Example 2
Source File: ServiceInvoker.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
public void setInvokerName(String invokerName) {
    this.invokerName = invokerName;

    if (statefull) {
        client.getOptions().setManageSession(true);
        client.getOptions().setAction("setClientName");

        OMElement cName = fac.createOMElement("cName", null);
        cName.setText(invokerName);

        try {
            OMElement response = client.sendReceive(cName);
            System.out.println(response.getText());
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }
    }
}
 
Example 3
Source File: AbstractBinaryDataServiceTest.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
private void storeBinaryData(String id, byte[] data) throws Exception {
	Map<String, String> params = new HashMap<String, String>();
	params.put("id", id);
	params.put("data", new String(Base64.encodeBase64(data), DBConstants.DEFAULT_CHAR_SET_TYPE));
	try {
           TestUtils.checkForService(this.epr);
		assertNotNull(TestUtils.callOperation(this.epr, "store_binary_data_op",
				params));
	} catch (AxisFault e) {
		// ignore for now
		if (!MySQLDMLServiceTest.INCOMING_MESSAGE_IS_NULL_ERROR.equals(e.getReason())) {
			e.printStackTrace();
			throw e;
		}
	}
}
 
Example 4
Source File: ServiceInvoker.java    From product-ei with Apache License 2.0 6 votes vote down vote up
public void setInvokerName(String invokerName) {
    this.invokerName = invokerName;

    if (statefull) {
        client.getOptions().setManageSession(true);
        client.getOptions().setAction("setClientName");

        OMElement cName = fac.createOMElement("cName", null);
        cName.setText(invokerName);

        try {
            OMElement response = client.sendReceive(cName);
            System.out.println(response.getText());
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }
    }
}
 
Example 5
Source File: ServiceInvoker.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
public ServiceInvoker(String epr, String operation) {

        this.operation = operation;

        Options options = new Options();
        options.setTo(new EndpointReference(epr));
        options.setAction(operation);

        try {
            ConfigurationContext configContext = ConfigurationContextFactory.
                    createConfigurationContextFromFileSystem("client_repo", null);

            client = new ServiceClient(configContext, null);
            options.setTimeOutInMilliSeconds(10000000);

            client.setOptions(options);
            client.engageModule("addressing");

        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }

        fac = OMAbstractFactory.getOMFactory();
        msg = fac.createOMElement("SampleMsg", null);

        OMElement load = fac.createOMElement("load", null);
        load.setText("1000");
        msg.addChild(load);
    }
 
Example 6
Source File: ServiceInvoker.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
public ServiceInvoker(String epr, String operation) {

        this.operation = operation;

        Options options = new Options();
        options.setTo(new EndpointReference(epr));
        options.setAction(operation);

        try {
            ConfigurationContext configContext = ConfigurationContextFactory.
                    createConfigurationContextFromFileSystem("client_repo", null);

            client = new ServiceClient(configContext, null);
            options.setTimeOutInMilliSeconds(10000000);

            client.setOptions(options);
            client.engageModule("addressing");

        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }

        fac = OMAbstractFactory.getOMFactory();
        msg = fac.createOMElement("SampleMsg", null);

        OMElement load = fac.createOMElement("load", null);
        load.setText("1000");
        msg.addChild(load);
    }
 
Example 7
Source File: ServiceInvoker.java    From product-ei with Apache License 2.0 5 votes vote down vote up
public ServiceInvoker(String epr, String operation) {

        this.operation = operation;

        Options options = new Options();
        options.setTo(new EndpointReference(epr));
        options.setAction(operation);

        try {
            ConfigurationContext configContext = ConfigurationContextFactory.
                    createConfigurationContextFromFileSystem("client_repo", null);

            client = new ServiceClient(configContext, null);
            options.setTimeOutInMilliSeconds(10000000);

            client.setOptions(options);
            client.engageModule("addressing");

        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }

        fac = OMAbstractFactory.getOMFactory();
        msg = fac.createOMElement("SampleMsg", null);

        OMElement load = fac.createOMElement("load", null);
        load.setText("1000");
        msg.addChild(load);
    }
 
Example 8
Source File: DiscoveryMgtUtils.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
/**
 * Check whether service discovery is enabled in the configuration. This method first checks
 * whether the DiscoveryConstants.DISCOVERY_PROXY parameter is set in the given AxisConfiguration.
 * If not it checks whether service discovery status is set to 'true' in the configuration
 * registry. If discovery is enabled in the registry configuration, this method will also
 * add the corresponding parameter to AxisConfiguration.
 *
 * @param axisConfig AxisConfiguration
 * @return service discovery status
 * @throws RegistryException if an error occurs while accessing the registry
 */
public static boolean isServiceDiscoveryEnabled(AxisConfiguration axisConfig) throws RegistryException {
    Parameter parameter = getDiscoveryParam(axisConfig);
    if (parameter != null) {
        return true;
    }

    String path = DISCOVERY_CONFIG_ROOT + DISCOVERY_PUBLISHER_CONFIG;

    Registry registry = PrivilegedCarbonContext.getThreadLocalCarbonContext().
            getRegistry(RegistryType.SYSTEM_CONFIGURATION);
    if (registry.resourceExists(path)) {
        Resource publisherConfig = registry.get(path);
        String status = publisherConfig.getProperty(DISCOVERY_PUBLISHER_STATUS);
        publisherConfig.discard();
        boolean enabled = JavaUtils.isTrueExplicitly(status);

        if (enabled) {
            String discoveryProxyURL = getDiscoveryProxyURL(registry);
            try {
                Parameter discoveryProxyParam =
                        ParameterUtil.createParameter(DiscoveryConstants.DISCOVERY_PROXY,
                                                      discoveryProxyURL);
                axisConfig.addParameter(discoveryProxyParam);
            } catch (AxisFault axisFault) {
                axisFault.printStackTrace();  //TODO
            }
        }
        return enabled;
    }

    return false;
}
 
Example 9
Source File: WebServiceTopicMap.java    From wandora with GNU General Public License v3.0 5 votes vote down vote up
public void setWebService(String service){
    try{
        if(service==null || service.length()==0) setWebService((TopicMapServiceStub)null);
        else setWebService(new TopicMapServiceStub(service));
        clearTopicMapIndexes();
    }catch(AxisFault af){
        af.printStackTrace();
    }catch(TopicMapException tme){
        tme.printStackTrace();
    }
}
 
Example 10
Source File: BDReportServlet.java    From carbon-commons with Apache License 2.0 4 votes vote down vote up
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws
                                                                                        Exception {
    String dataSource = request.getParameter("dataSource");
    String reportName = request.getParameter("reportName");
    String reportType = request.getParameter("reportType");
    String params = request.getParameter("hidden_param");

    String downloadFileName = null;

    if (reportType.equals("pdf")) {
        response.setContentType("application/pdf");
        downloadFileName = reportName + ".pdf";
    } else if (reportType.equals("excel")) {
        response.setContentType("application/vnd.ms-excel");
        downloadFileName = reportName + ".xls";
    } else if (reportType.equals("html")) {
        response.setContentType("text/html");
    } else {
        throw new ReportingException("requested report type can not be support");
    }

    if (downloadFileName != null) {
        response.setHeader("Content-Disposition", "attachment; filename=\"" + downloadFileName + "\"");
    }
    ReportBean reportBean = new ReportBean();
    reportBean.setTemplateName(reportName);
    reportBean.setReportType(reportType);
    reportBean.setDataSourceName(dataSource);


    String serverURL = CarbonUIUtil.getServerURL(request.getSession().getServletContext(), request.getSession());
    ConfigurationContext configurationContext = (ConfigurationContext) request.getSession().getServletContext().
            getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
    String cookie = (String) request.getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
    DBReportingServiceClient dbReportingServiceClient = null;
    try {
        dbReportingServiceClient = new DBReportingServiceClient(cookie, serverURL, configurationContext);
    } catch (AxisFault axisFault) {
        axisFault.printStackTrace();
    }
    List<ReportParamMap> reportParamMapsList = new ArrayList<ReportParamMap>();
    String[] parmCollection = params.split("\\|");

    for (String inputParam : parmCollection) {
        if (inputParam != null && !"".equals(inputParam)) {
            ReportParamMap reportParamMap = new ReportParamMap();
            String[] input = inputParam.split("\\=");
            reportParamMap.setParamKey(input[0]);
            reportParamMap.setParamValue(input[1]);
            reportParamMapsList.add(reportParamMap);
        }
    }

    try {
        DataHandler dataHandler = null;
        if (dbReportingServiceClient != null) {
            dataHandler = dbReportingServiceClient.getReport(reportBean,reportParamMapsList.toArray(new ReportParamMap[reportParamMapsList.size()]));
        }
        ServletOutputStream outputStream = response.getOutputStream();
        if (dataHandler != null) {
            dataHandler.writeTo(outputStream);
        }
    } catch (Exception e) {
        log.error("Failed to handle report request ",e);
        throw e;
    }

}