當前位置: 首頁>>代碼示例>>Java>>正文


Java WSDLException類代碼示例

本文整理匯總了Java中javax.wsdl.WSDLException的典型用法代碼示例。如果您正苦於以下問題:Java WSDLException類的具體用法?Java WSDLException怎麽用?Java WSDLException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WSDLException類屬於javax.wsdl包,在下文中一共展示了WSDLException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPortTypeOperations

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * 參考SoapMessageBuilder.SoapMessageBuilder(URL wsdlUrl)方法
 * 獲取portType中的所有operation
 *
 * @param wsdlUrl
 * @return
 */
private static List<Operation> getPortTypeOperations(String wsdlUrl) {
    List<Operation> operationList = new ArrayList();
    try {
        WSDLReader reader = new WSDLReaderImpl();
        reader.setFeature("javax.wsdl.verbose", false);
        Definition definition = reader.readWSDL(wsdlUrl.toString());
        Map<String, PortTypeImpl> defMap = definition.getAllPortTypes();
        Collection<PortTypeImpl> collection = defMap.values();
        for (PortTypeImpl portType : collection) {
            operationList.addAll(portType.getOperations());
        }
    } catch (WSDLException e) {
        System.out.println("get wsdl operation fail.");
        e.printStackTrace();
    }
    return operationList;
}
 
開發者ID:wuxinshui,項目名稱:boosters,代碼行數:25,代碼來源:OperatonUtils.java

示例2: isConnectionException

import javax.wsdl.WSDLException; //導入依賴的package包/類
public static boolean isConnectionException(Throwable t)
{
	if (t != null)
	{
		Throwable cause = t.getCause();
		if (cause != null && cause instanceof ServiceConstructionException)
		{
			Throwable causeCause = cause.getCause();
			if (causeCause != null && causeCause instanceof WSDLException)
			{
				Throwable causeCauseCaise = causeCause.getCause();
				if (causeCauseCaise != null && causeCauseCaise instanceof ConnectException) return(true);
			}
		}
	}

	return(false);
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:19,代碼來源:CxfClientUtilsOld.java

示例3: validateVersion

import javax.wsdl.WSDLException; //導入依賴的package包/類
void validateVersion(String wsdlUrl) {
    WSDLLocator locator = new BasicAuthWSDLLocator(wsdlUrl, null, null);
    WSDLFactory wsdlFactory;
    Definition serviceDefinition;
    try {
        wsdlFactory = WSDLFactory.newInstance();
        WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
        // avoid importing external documents
        wsdlReader.setExtensionRegistry(new WSVersionExtensionRegistry());
        serviceDefinition = wsdlReader.readWSDL(locator);
        Element versionElement = serviceDefinition
                .getDocumentationElement();
        if (!CTMGApiVersion.version.equals(versionElement.getTextContent())) {
            LOGGER.warn("Web service mismatches and the version value, expected: "
                    + CTMGApiVersion.version
                    + " and the one got from wsdl: "
                    + versionElement.getTextContent());
        }
    } catch (WSDLException e) {
        LOGGER.warn("Remote wsdl cannot be retrieved from CT_MG. [Cause: "
                + e.getMessage() + "]", e);
    }

}
 
開發者ID:servicecatalog,項目名稱:development,代碼行數:25,代碼來源:BesDAO.java

示例4: getOperationServiceAdapter

import javax.wsdl.WSDLException; //導入依賴的package包/類
public static OperationServiceAdapter getOperationServiceAdapter(
        TechnicalProductOperation operation, Integer wsTimeout,
        String username, String password) throws IOException,
        WSDLException, ParserConfigurationException {

    String target = operation.getActionUrl();
    if (Strings.isEmpty(target)) {
        throw new SaaSSystemException(
                String.format(
                        "Failed to retrieve service endpoint for service operation '%s', as the target is not defined.",
                        Long.valueOf(operation.getKey())));
    }
    WSPortConnector portConnector = new WSPortConnector(target, username,
            password);

    SupportedOperationVersions supportedVersion = getSupportedVersion(portConnector);
    OperationServiceAdapter adapter = getAdapterForVersion(supportedVersion);
    final Object port = portConnector.getPort(
            supportedVersion.getLocalWSDL(),
            supportedVersion.getServiceClass(), wsTimeout);
    adapter.setOperationService(port);
    return adapter;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:24,代碼來源:OperationServiceAdapterFactory.java

示例5: getServiceClient

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * Creates the operation service adapter that delegates to the real the
 * port. If a provisioning user is specified, basic authentication will be
 * used.
 * 
 * @param op
 *            the {@link TechnicalProductOperation} to get the action url
 *            from
 * @return the {@link OperationService}
 * @throws IOException
 * @throws ParserConfigurationException
 * @throws WSDLException
 */
protected OperationService getServiceClient(TechnicalProductOperation op)
        throws IOException, WSDLException, ParserConfigurationException {

    TechnicalProduct techProduct = op.getTechnicalProduct();
    String username = techProduct.getProvisioningUsername();
    String password = techProduct.getProvisioningPassword();

    // Get the timeout value for the outgoing WS call from the configuration
    // settings
    Integer wsTimeout = Integer
            .valueOf(cs.getConfigurationSetting(ConfigurationKey.WS_TIMEOUT,
                    Configuration.GLOBAL_CONTEXT).getValue());

    return OperationServiceAdapterFactory.getOperationServiceAdapter(op,
            wsTimeout, username, password);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:30,代碼來源:ApplicationServiceBean.java

示例6: WSPortConnector

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * Creates an instance of port connector.
 * 
 * @param remoteWsdlUrl
 *            The URL at which the WSDL can be accessed.
 * @param userName
 *            The userName to be used for authentication. <code>null</code>
 *            if no authentication is required.
 * @param password
 *            The password for the user. <code>null</code> if not required.
 * @param host
 *            optional - if specified, this host will be used instead the
 *            one from the wsdl
 * 
 * @throws IOException
 * @throws WSDLException
 */
public WSPortConnector(String remoteWsdlUrl, String userName,
        String password, String host) throws IOException, WSDLException {
    this.userName = userName;
    this.password = password;
    URL url = new URL(remoteWsdlUrl);
    if (requiresUserAuthentication(userName, password)) {
        url = BasicAuthLoader.load(url, userName, password);
    }

    WSDLLocator locator = new BasicAuthWSDLLocator(remoteWsdlUrl, userName,
            password);

    try {
        details = getServiceDetails(locator, host);
    } finally {
        locator.close();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:36,代碼來源:WSPortConnector.java

示例7: handleRegisterCustomer

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * Sends a notification on registration of a customer to the receiver
 * specified in the trigger definition.
 * 
 * @param process
 *            The current process to be handled.
 * @param facade
 *            Localizer facade to determine translated reason.
 * @throws ParserConfigurationException
 * @throws WSDLException
 * @throws IOException
 */
private void handleRegisterCustomer(TriggerProcess process,
        LocalizerFacade facade) throws IOException, WSDLException,
        ParserConfigurationException {
    INotificationServiceAdapter serviceClient = getServiceClient(process
            .getTriggerDefinition());
    VOTriggerProcess vo = TriggerProcessAssembler.toVOTriggerProcess(
            process, facade);
    VOOrganization organization = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.ORGANIZATION),
            VOOrganization.class);
    VOUserDetails user = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.USER),
            VOUserDetails.class);
    Properties organizationProperties = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.ORGANIZATION_PROPERTIES),
            Properties.class);
    serviceClient.onRegisterCustomer(VOConverter.convertToApi(vo),
            VOConverter.convertToApi(organization),
            VOConverter.convertToApi(user), organizationProperties);

    updateProcessState(process);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:35,代碼來源:TriggerProcessListener.java

示例8: handleModifySubscription

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * Sends a notification on the modification of a subscription to the
 * receiver specified in the trigger definition.
 * 
 * @param process
 *            The current process to be handled.
 * @param facade
 *            Localizer facade to determine translated reason.
 * @throws ParserConfigurationException
 * @throws WSDLException
 * @throws IOException
 */
private void handleModifySubscription(TriggerProcess process,
        LocalizerFacade facade) throws IOException, WSDLException,
        ParserConfigurationException {
    INotificationServiceAdapter serviceClient = getServiceClient(process
            .getTriggerDefinition());
    VOTriggerProcess vo = TriggerProcessAssembler.toVOTriggerProcess(
            process, facade);
    VOSubscription subscription = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.SUBSCRIPTION),
            VOSubscription.class);
    List<VOParameter> modifiedParameters = ParameterizedTypes
            .list(getParamValue(
                    process.getParamValueForName(TriggerProcessParameterName.PARAMETERS),
                    List.class), VOParameter.class);
    serviceClient.onModifySubscription(VOConverter.convertToApi(vo),
            VOConverter.convertToApi(subscription), VOCollectionConverter
                    .convertList(modifiedParameters,
                            org.oscm.vo.VOParameter.class));

    updateProcessState(process);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:34,代碼來源:TriggerProcessListener.java

示例9: handleUpgradeSubscription

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * Sends a notification on the upgrade of a subscription to the receiver
 * specified in the trigger definition.
 * 
 * @param process
 *            The current process to be handled.
 * @param facade
 *            Localizer facade to determine translated reason.
 * @throws ParserConfigurationException
 * @throws WSDLException
 * @throws IOException
 */
private void handleUpgradeSubscription(TriggerProcess process,
        LocalizerFacade facade) throws IOException, WSDLException,
        ParserConfigurationException {
    INotificationServiceAdapter serviceClient = getServiceClient(process
            .getTriggerDefinition());
    VOTriggerProcess vo = TriggerProcessAssembler.toVOTriggerProcess(
            process, facade);
    VOSubscription current = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.SUBSCRIPTION),
            VOSubscription.class);
    VOService newProduct = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.PRODUCT),
            VOService.class);
    serviceClient.onUpgradeSubscription(VOConverter.convertToApi(vo),
            VOConverter.convertToApi(current),
            VOConverter.convertToApi(newProduct));

    updateProcessState(process);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:32,代碼來源:TriggerProcessListener.java

示例10: handleUnsubscribeFromProduct

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * Sends a notification on the unsubscribe operation.
 * 
 * @param process
 *            The current trigger process to be handled.
 * @param facade
 *            Localizer facade to determine translated reason.
 * @throws ParserConfigurationException
 * @throws WSDLException
 * @throws IOException
 */
private void handleUnsubscribeFromProduct(TriggerProcess process,
        LocalizerFacade facade) throws IOException, WSDLException,
        ParserConfigurationException {
    INotificationServiceAdapter serviceClient = getServiceClient(process
            .getTriggerDefinition());
    VOTriggerProcess vo = TriggerProcessAssembler.toVOTriggerProcess(
            process, facade);
    String subId = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.SUBSCRIPTION),
            String.class);
    serviceClient.onUnsubscribeFromProduct(VOConverter.convertToApi(vo),
            subId);

    updateProcessState(process);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:27,代碼來源:TriggerProcessListener.java

示例11: handleDeactivateProduct

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * Sends a notification on the deactivation of a product to the receiver
 * specified in the trigger definition.
 * 
 * @param process
 *            The current trigger process to be handled.
 * @param facade
 *            Localizer facade to determine translated reason.
 * @throws ParserConfigurationException
 * @throws WSDLException
 * @throws IOException
 */
private void handleDeactivateProduct(TriggerProcess process,
        LocalizerFacade facade) throws IOException, WSDLException,
        ParserConfigurationException {
    INotificationServiceAdapter serviceClient = getServiceClient(process
            .getTriggerDefinition());
    VOTriggerProcess vo = TriggerProcessAssembler.toVOTriggerProcess(
            process, facade);
    VOService product = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.PRODUCT),
            VOService.class);
    serviceClient.onDeactivateProduct(VOConverter.convertToApi(vo),
            VOConverter.convertToApi(product));

    updateProcessState(process);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:28,代碼來源:TriggerProcessListener.java

示例12: handleActivateProduct

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * Sends a notification on the activation of a product to the receiver
 * specified in the trigger definition.
 * 
 * @param process
 *            The current trigger process to be handled.
 * @param facade
 *            Localizer facade to determine translated reason.
 * @throws ParserConfigurationException
 * @throws WSDLException
 * @throws IOException
 */
private void handleActivateProduct(TriggerProcess process,
        LocalizerFacade facade) throws IOException, WSDLException,
        ParserConfigurationException {
    INotificationServiceAdapter serviceClient = getServiceClient(process
            .getTriggerDefinition());
    VOTriggerProcess vo = TriggerProcessAssembler.toVOTriggerProcess(
            process, facade);
    VOService product = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.PRODUCT),
            VOService.class);
    serviceClient.onActivateProduct(VOConverter.convertToApi(vo),
            VOConverter.convertToApi(product));

    updateProcessState(process);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:28,代碼來源:TriggerProcessListener.java

示例13: handleSubscriptionTermination

import javax.wsdl.WSDLException; //導入依賴的package包/類
private void handleSubscriptionTermination(TriggerProcess process,
        LocalizerFacade facade) throws IOException, WSDLException,
        ParserConfigurationException {
    INotificationServiceAdapter serviceClient = getServiceClient(process
            .getTriggerDefinition());
    VOTriggerProcess vo = TriggerProcessAssembler.toVOTriggerProcess(
            process, facade);
    String subscriptionId = getParamValue(
            process.getParamValueForName(TriggerProcessParameterName.SUBSCRIPTION),
            String.class);
    Invariants.assertNotNull(subscriptionId,
            "mandatory parameter 'subscriptionId' not set");

    VONotificationBuilder builder = new VONotificationBuilder();
    builder.addParameter(VOProperty.SUBSCRIPTION_SUBSCRIPTION_ID,
            subscriptionId);
    VONotification notification = builder.build();

    serviceClient.onSubscriptionTermination(VOConverter.convertToApi(vo),
            notification);
    updateProcessState(process);
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:23,代碼來源:TriggerProcessListener.java

示例14: addWsdLDocumentation

import javax.wsdl.WSDLException; //導入依賴的package包/類
private static void addWsdLDocumentation(Definition definition, WSDLElement wsdlElement, String documentation) {
if (documentation.equals(""))
	return;

  	try {
	Document doc = new WSDLWriterImpl().getDocument(definition);
	Element element = doc.createElementNS("http://schemas.xmlsoap.org/wsdl/","documentation");
	element.setPrefix("wsdl");
	String cdataValue = documentation;
	cdataValue = cdataValue.replaceAll("<!\\[CDATA\\[", "&lt;!\\[CDATA\\[");
	cdataValue = cdataValue.replaceAll("\\]\\]>", "\\]\\]&gt;");
	element.appendChild(doc.createCDATASection(cdataValue));
	wsdlElement.setDocumentationElement(element);
} catch (WSDLException e) {
	e.printStackTrace();
}
  }
 
開發者ID:convertigo,項目名稱:convertigo-engine,代碼行數:18,代碼來源:WebServiceServlet.java

示例15: createPorts

import javax.wsdl.WSDLException; //導入依賴的package包/類
/**
 * The method creates ports based on provided definitions.
 * @param files Definitions used to create new ports.
 * @param generateResponse Boolean value for if a default response should be generated for each new operation
 * @return List of ports generated from the provided definitions.
 * @throws WSDLException Throws an WSDLException if WSDL parsing failed.
 */
private List<SoapPortDto> createPorts(final List<File> files, final boolean generateResponse) throws WSDLException {
    try {
        final List<SoapPortDto> soapPorts = new ArrayList<>();
        final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setValidating(false);
        documentBuilderFactory.setNamespaceAware(true);

        for(File file : files){
            final DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            final Document document = documentBuilder.parse(file);
            document.getDocumentElement().normalize();

            final List<SoapPortDto> fileSoapPorts = getSoapPorts(document, generateResponse);
            soapPorts.addAll(fileSoapPorts);
        }
        return soapPorts;
    } catch (Exception e) {
        throw new IllegalArgumentException("Unable parse WSDL file", e);
    }
}
 
開發者ID:castlemock,項目名稱:castlemock,代碼行數:28,代碼來源:CreateSoapPortsService.java


注:本文中的javax.wsdl.WSDLException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。