所以这就是场景:我们有PeopleSoft,并希望从salesforce来回发送消息.不幸的是,PeopleSoft没有像wsimport这样的工具,它使用wsdl并为你生成类.有些东西会消耗wsdl,但它会生成存根消息对象.开发人员仍然必须编写代码来手动生成xml消息字符串.
我显然不想做所有这些.所以我知道java可以在PeopleSoft中调用.我也知道我可以使用生成的类发送消息,但我想使用PeopleSoft内置的消息监视功能.
所以我想到的一个可能的解决方案是:
我疯了还是可能的?
ps我是一个新手java开发人员
这是我的抓取xml的处理程序类,但需要一些方法来防止消息被发送出去.
public class LoggingHandler implements SOAPHandler<SOAPMessageContext> {
// change this to redirect output if desired
private static PrintStream out = System.out;
private String xmlOut = null;
public Set<QName> getHeaders() {
return null;
}
public boolean handleMessage(SOAPMessageContext smc) {
logToSystemOut(smc);
return true;
}
public boolean handleFault(SOAPMessageContext smc) {
logToSystemOut(smc);
return true;
}
// nothing to clean up
public void close(MessageContext messageContext) {
}
public String getXmlOut() {
return xmlOut;
} …Run Code Online (Sandbox Code Playgroud)