當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。