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


Java SOAPFactory.newInstance方法代碼示例

本文整理匯總了Java中javax.xml.soap.SOAPFactory.newInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java SOAPFactory.newInstance方法的具體用法?Java SOAPFactory.newInstance怎麽用?Java SOAPFactory.newInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.xml.soap.SOAPFactory的用法示例。


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

示例1: invoke

import javax.xml.soap.SOAPFactory; //導入方法依賴的package包/類
@Override
public DOMSource invoke(DOMSource request) {
    try {
        return invokeAllowingFaults(request);
    } catch (FaultMessage faultMessage) {
        try {
            SOAPFactory factory = SOAPFactory.newInstance();
            SOAPFault soapFault = factory.createFault();
            soapFault.setFaultCode(SOAP11_FAULTCODE_SERVER);           // todo here is a constant until we have a mechanism to determine the correct value (client / server)
            soapFault.setFaultString(faultMessage.getMessage());
            Detail detail = soapFault.addDetail();
            serializeFaultMessage(detail, faultMessage);
            // fault actor?
            // stack trace of the outer exception (FaultMessage) is unimportant, because it is always created at one place
            // todo consider providing stack trace of the inner exception
            //Detail detail = soapFault.addDetail();
            //detail.setTextContent(getStackTraceAsString(faultMessage));
            throw new SOAPFaultException(soapFault);
        } catch (SOAPException e) {
            throw new RuntimeException("SOAP Exception: " + e.getMessage(), e);
        }
    }
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:24,代碼來源:ModelWebServiceRaw.java

示例2: initialValue

import javax.xml.soap.SOAPFactory; //導入方法依賴的package包/類
@Override
protected SOAPFactory initialValue() {
	try {
		return SOAPFactory.newInstance();
	} catch (SOAPException e) {
		e.printStackTrace();
		return null;
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-engine,代碼行數:10,代碼來源:SOAPUtils.java

示例3: listenerCreated

import javax.xml.soap.SOAPFactory; //導入方法依賴的package包/類
/**
 * Creates a new instance of MessageFactory.
 *
 * @throws RequestListenerException if unable to create MessageFactory.
 * @see hk.hku.cecid.piazza.commons.servlet.RequestListener#listenerCreated()
 */
public void listenerCreated() throws RequestListenerException {
    try {
        msgFactory = MessageFactory.newInstance();
        soapFactory = SOAPFactory.newInstance();
    }
    catch (Exception e) {
        throw new RequestListenerException(
                "Unable to create SOAP factories", e);
    }
}
 
開發者ID:cecid,項目名稱:hermes,代碼行數:17,代碼來源:SOAPHttpAdaptor.java

示例4: getSoapFactory

import javax.xml.soap.SOAPFactory; //導入方法依賴的package包/類
protected SOAPFactory getSoapFactory() throws SOAPException {
    if (soapFactory == null) {
        soapFactory = SOAPFactory.newInstance();
    }
    return soapFactory;
}
 
開發者ID:CenturyLinkCloud,項目名稱:mdw,代碼行數:7,代碼來源:SoapWebServiceAdapter.java

示例5: createSOAPFactory

import javax.xml.soap.SOAPFactory; //導入方法依賴的package包/類
/**
* Creates a new <code>SOAPFactory</code> object that is an instance of
* the specified implementation, this method uses the SAAJMetaFactory to
* locate the implementation class and create the SOAPFactory instance.
*
* @return a new instance of a <code>SOAPFactory</code>
*
* @param protocol  a string constant representing the protocol of the
*                   specified SOAP factory implementation. May be
*                   either <code>DYNAMIC_SOAP_PROTOCOL</code>,
*                   <code>DEFAULT_SOAP_PROTOCOL</code> (which is the same
*                   as) <code>SOAP_1_1_PROTOCOL</code>, or
*                   <code>SOAP_1_2_PROTOCOL</code>.
*
* @exception SOAPException if there was an error creating the
*            specified <code>SOAPFactory</code>
* @see SAAJMetaFactory
*/
   public SOAPFactory createSOAPFactory(String protocol) throws SOAPException {
           return SOAPFactory.newInstance(protocol);
   }
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:22,代碼來源:SAAJFactory.java


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