本文整理汇总了Java中javax.xml.rpc.JAXRPCException类的典型用法代码示例。如果您正苦于以下问题:Java JAXRPCException类的具体用法?Java JAXRPCException怎么用?Java JAXRPCException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JAXRPCException类属于javax.xml.rpc包,在下文中一共展示了JAXRPCException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logMessage
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
private void logMessage(String method, MessageContext context) {
FileOutputStream fout = createFile();
if(fout==null) return;
LogOutputStream out = new LogOutputStream(fout, true);
try {
out.println("<" + method + ">");
//Uncomment this statement to log the SOAP messages.
out.println(logSOAPMessage(context));
out.println("</" + method + ">");
} catch (Exception ex) {
ex.printStackTrace(System.out);
throw new JAXRPCException("LoggingHandler: Unable to log the message in " + method + " - {" + ex.getClass().getName() + "}"
+ ex.getMessage());
} finally {
out.flush();
out.close();
}
}
示例2: getSerializerAs
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
public Serializer getSerializerAs(String mechanismType) throws JAXRPCException {
if (javaType == String.class) {
return new StringSerializer(javaType, xmlType);
}
return super.getSerializerAs(mechanismType);
}
示例3: createFile
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
public FileOutputStream createFile() {
FileOutputStream fout = null;
try {
String logfile = System.getProperty("jplag.client.logfile");
if(logfile==null || logfile.length()==0) return null;
fout = new FileOutputStream(logfile, true); //append
} catch (IOException ex) {
ex.printStackTrace(System.out);
throw new JAXRPCException("Unable to initialize the log file: " +
ex.getClass().getName() + " - " + ex.getMessage());
}
return fout;
}
示例4: getSerializerAs
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
@Override
public Serializer getSerializerAs(String mechanismType) throws JAXRPCException {
if (javaType == String.class) {
return new StringSerializer(javaType, xmlType);
}
return super.getSerializerAs(mechanismType);
}
示例5: handleRequest
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
public boolean handleRequest(MessageContext mc) {
mc.setProperty(ALLOW_FORM_OPTIMIZATION,
Boolean.TRUE);
try {
return processMessage(mc, true);
} catch (WSSecurityException e) {
if (doDebug) {
log.debug(e.getMessage(), e);
}
throw new JAXRPCException(e);
}
}
示例6: handleResponse
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
public boolean handleResponse(MessageContext mc) {
mc.setProperty(ALLOW_FORM_OPTIMIZATION,
Boolean.TRUE);
try {
return processMessage(mc, false);
} catch (WSSecurityException e) {
if (doDebug) {
log.debug(e.getMessage(), e);
}
throw new JAXRPCException(e);
}
}
示例7: processMessage
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
/**
* Switch for transferring control to doReceiver and doSender
*/
public boolean processMessage(MessageContext mc, boolean isRequestMessage) throws WSSecurityException {
RequestData reqData = new RequestData();
reqData.setMsgContext(mc);
doDebug = log.isDebugEnabled();
String deployment = null;
String handleFlow = null;
if ((deployment = (String) getOption(DEPLOYMENT)) == null) {
deployment = (String) mc.getProperty(DEPLOYMENT);
}
if (deployment == null) {
throw new JAXRPCException("WSS4JHandler.processMessage: No deployment defined");
}
if ((handleFlow = (String) getOption(FLOW)) == null) {
handleFlow = (String) mc.getProperty(FLOW);
}
if (handleFlow == null) {
handleFlow = "";
}
// call doSender if we are -
// (handling request and client-side deployment) or (handling response and server-side deployment).
// call doReceiver if we are -
// (handling request and server-side deployment) or (handling response and client-side deployment).
boolean needsHandling = ( isRequestMessage && !handleFlow.equals(RESPONSE_ONLY)) ||
(!isRequestMessage && !handleFlow.equals(REQUEST_ONLY));
try {
if (deployment.equals(CLIENT_DEPLOYMENT) ^ isRequestMessage) {
if (needsHandling) {
return doReceiver(mc, reqData, isRequestMessage);
}
} else {
if (needsHandling) {
return doSender(mc, reqData, isRequestMessage);
}
}
} finally {
reqData.clear();
reqData = null;
}
return true;
}
示例8: messageToDocument
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
/**
* Utility method to convert SOAPMessage to org.w3c.dom.Document
*/
public static Document messageToDocument(SOAPMessage message) {
try {
Source content = message.getSOAPPart().getContent();
DocumentBuilderFactory dbf = org.apache.ws.security.util.XMLUtils.getSecuredDocumentBuilder();
DocumentBuilder builder = dbf.newDocumentBuilder();
return builder.parse(org.apache.ws.security.util.XMLUtils.sourceToInputSource(content));
} catch (Exception ex) {
if (doDebug) {
log.debug(ex.getMessage(), ex);
}
throw new JAXRPCException("messageToDocument: cannot convert SOAPMessage into Document", ex);
}
}
示例9: HandlerChainImpl
import javax.xml.rpc.JAXRPCException; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public HandlerChainImpl(List<HandlerInfo> handlerInfos, String[] roles) {
this.roles = roles;
for (int i = 0; i < handlerInfos.size(); i++) {
HandlerInfo handlerInfo = handlerInfos.get(i);
try {
Handler handler = (Handler) handlerInfo.getHandlerClass().newInstance();
handler.init(handlerInfo);
add(handler);
} catch (Exception e) {
throw new JAXRPCException("Unable to initialize handler class: " + handlerInfo.getHandlerClass().getName(), e);
}
}
}