当前位置: 首页>>代码示例>>Java>>正文


Java ServiceException类代码示例

本文整理汇总了Java中javax.xml.rpc.ServiceException的典型用法代码示例。如果您正苦于以下问题:Java ServiceException类的具体用法?Java ServiceException怎么用?Java ServiceException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ServiceException类属于javax.xml.rpc包,在下文中一共展示了ServiceException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProxyPortQNameClass

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
 * @param args Method call arguments
 * @return Returns the correct Port
 * @throws ServiceException if port's QName is an unknown Port (not defined in WSDL).
 */
@SuppressWarnings("unchecked")
private Object getProxyPortQNameClass(Object[] args)
throws ServiceException {
    QName name = (QName) args[0];
    String nameString = name.getLocalPart();
    Class<?> serviceendpointClass = (Class<?>) args[1];

    for (Iterator<QName> ports = service.getPorts(); ports.hasNext();) {
        QName portName = ports.next();
        String portnameString = portName.getLocalPart();
        if (portnameString.equals(nameString)) {
            return service.getPort(name, serviceendpointClass);
        }
    }

    // no ports have been found
    throw new ServiceException("Port-component-ref : " + name + " not found");
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:24,代码来源:ServiceProxy.java

示例2: getProxyPortQNameClass

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
 * @param args Method call arguments
 * @return Returns the correct Port
 * @throws ServiceException if port's QName is an unknown Port (not defined in WSDL).
 */
private Object getProxyPortQNameClass(Object[] args)
throws ServiceException {
    QName name = (QName) args[0];
    String nameString = name.getLocalPart();
    Class serviceendpointClass = (Class) args[1];

    for (Iterator ports = service.getPorts(); ports.hasNext();) {
        QName portName = (QName) ports.next();
        String portnameString = portName.getLocalPart();
        if (portnameString.equals(nameString)) {
            return service.getPort(name, serviceendpointClass);
        }
    }

    // no ports have been found
    throw new ServiceException("Port-component-ref : " + name + " not found");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:ServiceProxy.java

示例3: getArtifactTypes

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
 * Queries the server and returns a list of artifact types.
 * 
 * @return
 * @throws ServiceException
 * @throws WSException
 * @throws RemoteException
 */
public Collection<TrackerArtifactType> getArtifactTypes()
        throws ServiceException, WSException, RemoteException {
    EngineConfiguration config = mClient.getEngineConfiguration();
    MetadataService service = new MetadataServiceLocator(config);
    URL portAddress = mClient.constructServiceURL("/tracker/Metadata");
    Metadata theService = service.getMetadataService(portAddress);
    ArtifactType[] artifactTypes = theService.getArtifactTypes();
    String key;
    for (ArtifactType type : artifactTypes) {
        key = TrackerUtil.getKey(type.getNamespace(), type.getTagName());
        if (repositoryData == null)
            repositoryData = new TrackerClientData();
        if (repositoryData.getArtifactTypeFromKey(key) == null)
            repositoryData.addArtifactType(new TrackerArtifactType(type));
    }

    return repositoryData.getArtifactTypes();
}
 
开发者ID:jonico,项目名称:core,代码行数:27,代码来源:TrackerWebServicesClient.java

示例4: getMetaDataForArtifact

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
 * Get the metadata for the given artifact. The metadata contains the valid
 * values for attributes and the valid operations that can be performed on
 * the attribute
 * 
 * @param namespace
 * @param artifactType
 * @param artifactId
 * @return
 * @throws ServiceException
 * @throws WSException
 * @throws RemoteException
 */
public ArtifactTypeMetadata getMetaDataForArtifact(String namespace,
        String artifactType, String artifactId) throws ServiceException,
        WSException, RemoteException {
    EngineConfiguration config = mClient.getEngineConfiguration();
    MetadataService service = new MetadataServiceLocator(config);
    URL portAddress = mClient.constructServiceURL("/tracker/Metadata");
    Metadata theService = service.getMetadataService(portAddress);
    TrackerUtil.debug("getMetaDataForArtifact():" + artifactId);
    ArtifactTypeMetadata metaData = theService.getMetadataForArtifact(
            new ArtifactType(artifactType, namespace, ""), artifactId);
    TrackerUtil.debug("getMetaDataForArtifact():done ");
    TrackerArtifactType type = repositoryData
            .getArtifactTypeFromKey(TrackerUtil.getKey(namespace,
                    artifactType));
    if (type == null) {
        type = new TrackerArtifactType(metaData.getArtifactType()
                .getDisplayName(), metaData.getArtifactType().getTagName(),
                metaData.getArtifactType().getNamespace());
    }
    type.populateAttributes(metaData);
    repositoryData.addArtifactType(type);

    return metaData;
}
 
开发者ID:jonico,项目名称:core,代码行数:38,代码来源:TrackerWebServicesClient.java

示例5: postAttachment

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
 * Attach a file to a PT artifact
 * 
 * @param taskId
 * @param comment
 * @param attachment
 * @throws ServiceException
 * @throws WSException
 * @throws RemoteException
 */
public long postAttachment(String taskId, String comment,
        DataSource attachment) throws ServiceException, WSException,
        RemoteException {
    EngineConfiguration config = mClient.getEngineConfiguration();
    AttachmentService service = new AttachmentServiceLocator(config);
    URL portAddress = mClient.constructServiceURL("/tracker/Attachment");
    AttachmentManager theService = service
            .getAttachmentService(portAddress);
    DataHandler attachmentHandler = new DataHandler(attachment);

    theService.addAttachment(taskId, attachment.getName(), comment,
            attachment.getContentType(), attachmentHandler);
    long[] ids = theService.getAttachmentIds(taskId);
    Arrays.sort(ids);
    return ids[ids.length - 1];
}
 
开发者ID:jonico,项目名称:core,代码行数:27,代码来源:TrackerWebServicesClient.java

示例6: Connection

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
 * Alternative constructor for test classes
 * 
 * @param serverUrl
 * @param userName
 * @param password
 * @throws ServiceException
 * @throws MalformedURLException
 */
public Connection(String serverUrl, String userName, String password)
        throws ServiceException, MalformedURLException {
    this.username = userName;
    this.password = password;

    Service service = Service.create(new URL(serverUrl), new QName(
            "http://api2.scrumworks.danube.com/",
            "ScrumWorksAPIBeanService"));

    endpoint = service.getPort(ScrumWorksAPIService.class);
    ((BindingProvider) endpoint).getRequestContext().put(
            BindingProvider.USERNAME_PROPERTY, username);
    ((BindingProvider) endpoint).getRequestContext().put(
            BindingProvider.PASSWORD_PROPERTY, password);

}
 
开发者ID:jonico,项目名称:core,代码行数:26,代码来源:Connection.java

示例7: main

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
 * @param args
 * @throws ServiceException
 * @throws RemoteException
 */
public static void main(String[] args) throws ServiceException,
        RemoteException {
    Connection tfcon = Connection.getConnection("https://forge.collab.net",
            "", "", null, null, null, false);
    TrackerClient trackerClient = tfcon.getTrackerClient();
    // end point
    // https://scrumworks.danube.com/scrumworks-api/scrumworks?wsdl
    ScrumWorksServiceLocator locator = new ScrumWorksServiceLocator();
    locator.setScrumWorksEndpointPortEndpointAddress("https://scrumworks.danube.com/scrumworks-api/scrumworks");
    ScrumWorksEndpoint endpoint = locator.getScrumWorksEndpointPort();
    ((ScrumWorksEndpointBindingStub) endpoint).setUsername("");
    ((ScrumWorksEndpointBindingStub) endpoint).setPassword("");
    ProductWSO product = endpoint.getProductByName("SWP-TF Integration");
    BacklogItemWSO[] pbis = endpoint.getActiveBacklogItems(product);

    for (BacklogItemWSO pbi : pbis) {
        trackerClient.createArtifact("tracker2119", pbi.getTitle(),
                pbi.getDescription(), null, null, "Open", null, 2,
                pbi.getEstimate() == null ? 0 : pbi.getEstimate(),
                pbi.getEstimate() == null ? 0 : pbi.getEstimate(), false,
                0, false, null, null, null, null, new FieldValues(), null,
                null, null);
    }
}
 
开发者ID:jonico,项目名称:core,代码行数:30,代码来源:TFSWPAdhocIntegration.java

示例8: SWPTester

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @throws IOException
 *             if the property file can not be accessed
 * @throws FileNotFoundException
 *             if the property file can not be found
 * @throws ServiceException
 */
public SWPTester() throws FileNotFoundException, IOException,
        ServiceException {
    Properties prop = new Properties();
    prop.load(new FileInputStream(PROPERTY_FILE));

    setSwpUserName(prop.getProperty(SWP_USER_NAME));
    setSwpPassword(prop.getProperty(SWP_PASSWORD));
    setSwpServerUrl(prop.getProperty(SWP_SERVER_URL));
    setSwpProduct(prop.getProperty(SWP_PRODUCT));

    ccfMaxWaitTime = Integer.parseInt(prop.getProperty(CCF_MAX_WAIT_TIME));
    ccfRetryInterval = Integer.parseInt(prop
            .getProperty(CCF_RETRY_INTERVAL));

    Service service = Service.create(new URL(getSwpServerUrl()), new QName(
            "http://api2.scrumworks.danube.com/",
            "ScrumWorksAPIBeanService"));
    endpoint = service.getPort(ScrumWorksAPIService.class);
    setUserNameAndPassword("administrator", "password");
}
 
开发者ID:jonico,项目名称:core,代码行数:30,代码来源:SWPTester.java

示例9: ifNoDifferentIssuesThenCreate

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
private void ifNoDifferentIssuesThenCreate() throws RemoteException, ServiceException, MalformedURLException {

        findDifferentIssues();

        if (fixedIssue == null) {
            fixedIssue = app.soap().addIssue(
                    new Issue()
                            .withProject(project)
                            .withSummary("Fixed issue sample")
                            .withDescription("Пример закрытого(исправленного) баг-репорта")
                            .withResolution(getFixedResolution())
            );
        }

        if (notfixedIssue == null) {
            notfixedIssue = app.soap().addIssue(
                    new Issue()
                            .withProject(project)
                            .withSummary("Notfixed issue sample")
                            .withDescription("Пример открытого(неисправленного) баг-репорта")
                            .withResolution(getNotfixedResolution())
            );
        }

    }
 
开发者ID:webarchitect609,项目名称:jstudy,代码行数:26,代码来源:FakeForeignSystemTests.java

示例10: createMetadataBinding

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
public MetadataBindingStub createMetadataBinding(final SfdcConfig aConfig)
        throws CommanderException {
    PartnerBindingResult partnerBinding = createPartnerBinding(aConfig);
    MetadataServiceLocator metaDataSL = new MetadataServiceLocator();
    SessionHeader sh = new SessionHeader();
    sh.setSessionId(partnerBinding.getLoginResult().getSessionId());

    MetadataBindingStub metaBinding;
    try {
        metaBinding = (MetadataBindingStub) metaDataSL.getMetadata();
        metaBinding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,
                partnerBinding.getLoginResult().getMetadataServerUrl());

        metaBinding.setHeader(metaDataSL.getServiceName().getNamespaceURI(),
                "SessionHeader", sh);
    } catch (ServiceException e) {
        throw new CommanderException(
                "Could not instanciate Metadata Connection from Partner connection",
                e);
    }
    return metaBinding;
}
 
开发者ID:jwiesel,项目名称:sfdcCommander,代码行数:23,代码来源:SfdcConnectionPool.java

示例11: createMassSpecAPI

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
/**
    * Create a Mass Spec API handle.
    * 
    * @return the newly created handle.
    * @throws IOException
    *             if there were any problems.
    */
   private static MassSpecAPISoap createMassSpecAPI() throws IOException {

LOG.finest("Create mass-spec API handle...");

// Create API handles.
final MassSpecAPISoap handle;
try {
    handle = new MassSpecAPILocator().getMassSpecAPISoap();
} catch (ServiceException e) {
    LOG.log(Level.WARNING,
	    "Problem initializing ChemSpider Mass-Spec API", e);
    throw new IOException("Problem initializing ChemSpider API", e);
}
return handle;
   }
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:23,代码来源:ChemSpiderGateway.java

示例12: getImageInformation

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
public String getImageInformation(AbstractImagingURN imagingUrn)
throws MalformedURLException, ServiceException, RemoteException, ConnectionException
{
	TransactionContext transactionContext = TransactionContextFactory.get();
	
	logger.info("getImageInformation, Transaction [" + transactionContext.getTransactionId() + "] initiated, image Urn '" + imagingUrn.toString() + "'");
	ImageFederationMetadata imageMetadata = getImageMetadataService();
	
	// if the metadata connection parameters is not null and the metadata connection parameters
	// specifies a user ID then set the UID/PWD parameters as XML parameters, which should
	// end up as a BASIC auth parameter in the HTTP header
	setMetadataCredentials(imageMetadata);
	
	ClassLoader loader = Thread.currentThread().getContextClassLoader();
	Thread.currentThread().setContextClassLoader(ImageXChangeHttpCommonsSender.class.getClassLoader());
	String result = imageMetadata.getImageInformation(imagingUrn.toString(), transactionContext.getTransactionId());
	Thread.currentThread().setContextClassLoader(loader);
	logger.info("getImageInformation, Transaction [" + transactionContext.getTransactionId() + "] returned response of length [" + (result == null ? "null" : result.length()) + "] bytes.");
	return result;
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:21,代码来源:FederationProxy.java

示例13: getImageSystemGlobalNode

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
public String getImageSystemGlobalNode(AbstractImagingURN imagingUrn)
throws MalformedURLException, ServiceException, RemoteException, ConnectionException
{
	TransactionContext transactionContext = TransactionContextFactory.get();
	
	logger.info("getImageSystemGlobalNode, Transaction [" + transactionContext.getTransactionId() + "] initiated, image Urn '" + imagingUrn.toString() + "'");
	ImageFederationMetadata imageMetadata = getImageMetadataService();
	
	// if the metadata connection parameters is not null and the metadata connection parameters
	// specifies a user ID then set the UID/PWD parameters as XML parameters, which should
	// end up as a BASIC auth parameter in the HTTP header
	setMetadataCredentials(imageMetadata);
	
	ClassLoader loader = Thread.currentThread().getContextClassLoader();
	Thread.currentThread().setContextClassLoader(ImageXChangeHttpCommonsSender.class.getClassLoader());
	String result = imageMetadata.getImageSystemGlobalNode(imagingUrn.toString(), transactionContext.getTransactionId());
	Thread.currentThread().setContextClassLoader(loader);
	logger.info("getImageSystemGlobalNode, Transaction [" + transactionContext.getTransactionId() + "] returned response of length [" + (result == null ? "null" : result.length()) + "] bytes.");
	return result;
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:21,代码来源:FederationProxy.java

示例14: getImageDevFields

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
public String getImageDevFields(AbstractImagingURN imagingUrn, String flags)
throws MalformedURLException, ServiceException, RemoteException, ConnectionException
{
	TransactionContext transactionContext = TransactionContextFactory.get();
	
	logger.info("getImageDevFields, Transaction [" + transactionContext.getTransactionId() + "] initiated, image Urn '" + imagingUrn.toString() + "'");
	ImageFederationMetadata imageMetadata = getImageMetadataService();
	
	// if the metadata connection parameters is not null and the metadata connection parameters
	// specifies a user ID then set the UID/PWD parameters as XML parameters, which should
	// end up as a BASIC auth parameter in the HTTP header
	setMetadataCredentials(imageMetadata);
	
	ClassLoader loader = Thread.currentThread().getContextClassLoader();
	Thread.currentThread().setContextClassLoader(ImageXChangeHttpCommonsSender.class.getClassLoader());
	String result = imageMetadata.getImageDevFields(imagingUrn.toString(), flags, transactionContext.getTransactionId());
	Thread.currentThread().setContextClassLoader(loader);
	logger.info("getImageDevFields, Transaction [" + transactionContext.getTransactionId() + "] returned response of length [" + (result == null ? "null" : result.length()) + "] bytes.");
	return result;
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:21,代码来源:FederationProxy.java

示例15: logImageAccessEvent

import javax.xml.rpc.ServiceException; //导入依赖的package包/类
public boolean logImageAccessEvent(ImageAccessLogEvent logEvent)
throws MalformedURLException, ServiceException, RemoteException, ConnectionException
{
	TransactionContext transactionContext = TransactionContextFactory.get();
	
	logger.info("logImageAccessEvent, Transaction [" + transactionContext.getTransactionId() + "] initiated, event Type '" + logEvent.getEventType().toString() + "'");
	ImageFederationMetadata imageMetadata = getImageMetadataService();
	
	// if the metadata connection parameters is not null and the metadata connection parameters
	// specifies a user ID then set the UID/PWD parameters as XML parameters, which should
	// end up as a BASIC auth parameter in the HTTP header
	setMetadataCredentials(imageMetadata);
	
	FederationImageAccessLogEventType federationLogEvent = federationTranslator.transformLogEvent(logEvent);
	ClassLoader loader = Thread.currentThread().getContextClassLoader();
	Thread.currentThread().setContextClassLoader(ImageXChangeHttpCommonsSender.class.getClassLoader());
	boolean result = imageMetadata.postImageAccessEvent(transactionContext.getTransactionId(), federationLogEvent);
	Thread.currentThread().setContextClassLoader(loader);
	logger.info("logImageAccessEvent, Transaction [" + transactionContext.getTransactionId() + "] logged image access event " + 
			(result == true ? "ok" : "failed"));
	return result;
	
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:24,代码来源:FederationProxy.java


注:本文中的javax.xml.rpc.ServiceException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。