axis 源码初步研读

1 篇文章 0 订阅
1 篇文章 0 订阅
经过反复跟踪,这段代码比较重要:

org.apache.axis.Message.java


public void writeTo(java.io.OutputStream os) throws SOAPException, IOException {
//Do it the old fashion way.
Thread.dumpStack();
if (getSendType() == Attachments.SEND_TYPE_NONE || mAttachments == null || 0 == mAttachments.getAttachmentCount()) {
try {
String charEncoding = XMLUtils.getEncoding(this, msgContext);;
mSOAPPart.setEncoding(charEncoding);
mSOAPPart.writeTo(os);
System.out.println("(Message.java:540)");
} catch (java.io.IOException e) {
log.error(Messages.getMessage("javaIOException00"), e);
}
} else {
try {
mAttachments.writeContentToStream(os);
//BufferedOutputStream bos = new BufferedOutputStream();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
mAttachments.writeContentToStream(bos);
//String str = bos.toString();
System.out.println("(Message.java:553) mAttachments:" + bos.toString());
System.out.println("(Message.java:554) " + mAttachments);
} catch (java.lang.Exception e) {
log.error(Messages.getMessage("exception00"), e);
}
}
}




另外,贴一些通过 Thread.dumpStack() 打印出来的程序流程:


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:189)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder.access$2(EngineConfigurationFactoryFinder.java:163)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:128)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:113)
at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:160)
at org.apache.axis.client.Service.getEngineConfiguration(Service.java:813)
at org.apache.axis.client.Service.getAxisClient(Service.java:104)
at org.apache.axis.client.Service.<init>(Service.java:113)
at com.mns.SendMessageServiceLocator.<init>(SendMessageServiceLocator.java:12)
at com.mns.ZTestSendMsg.test_main1(ZTestSendMsg.java:114)
at com.mns.ZTestSendMsg.main(ZTestSendMsg.java:55)

java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Unknown Source)
at org.apache.axis.client.Call.invokeEngine(Call.java:2816)
at org.apache.axis.client.Call.invoke(Call.java:2799)
at org.apache.axis.client.Call.invoke(Call.java:2444)
at org.apache.axis.client.Call.invoke(Call.java:2367)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.mns.SendMessageBindingStub.sendMessage(SendMessageBindingStub.java:442)
at com.mns.ZTestSendMsg.test_main1(ZTestSendMsg.java:278)
at com.mns.ZTestSendMsg.main(ZTestSendMsg.java:55)2817:service.getEngine():org.apache.axis.client.AxisClient@5812f9ee

java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Unknown Source)
at org.apache.axis.attachments.MimeUtils.createMP(MimeUtils.java:248)
at org.apache.axis.attachments.AttachmentsImpl.getContentType(AttachmentsImpl.java:567)
at org.apache.axis.Message.getContentType(Message.java:489)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:343)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:175)
at org.apache.axis.client.Call.invokeEngine(Call.java:2818)
at org.apache.axis.client.Call.invoke(Call.java:2799)
at org.apache.axis.client.Call.invoke(Call.java:2444)
at org.apache.axis.client.Call.invoke(Call.java:2367)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.mns.SendMessageBindingStub.sendMessage(SendMessageBindingStub.java:442)
at com.mns.ZTestSendMsg.test_main1(ZTestSendMsg.java:278)
at com.mns.ZTestSendMsg.main(ZTestSendMsg.java:55)


java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Unknown Source)
at org.apache.axis.Message.writeTo(Message.java:536)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:514)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:175)
at org.apache.axis.client.Call.invokeEngine(Call.java:2818)
at org.apache.axis.client.Call.invoke(Call.java:2799)
at org.apache.axis.client.Call.invoke(Call.java:2444)
at org.apache.axis.client.Call.invoke(Call.java:2367)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.mns.SendMessageBindingStub.sendMessage(SendMessageBindingStub.java:442)
at com.mns.ZTestSendMsg.test_main1(ZTestSendMsg.java:278)
at com.mns.ZTestSendMsg.main(ZTestSendMsg.java:55)
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Unknown Source)
at org.apache.axis.attachments.AttachmentsImpl.writeContentToStream(AttachmentsImpl.java:520)
at org.apache.axis.Message.writeTo(Message.java:548)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:514)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:175)
at org.apache.axis.client.Call.invokeEngine(Call.java:2818)
at org.apache.axis.client.Call.invoke(Call.java:2799)
at org.apache.axis.client.Call.invoke(Call.java:2444)
at org.apache.axis.client.Call.invoke(Call.java:2367)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.mns.SendMessageBindingStub.sendMessage(SendMessageBindingStub.java:442)
at com.mns.ZTestSendMsg.test_main1(ZTestSendMsg.java:278)
at com.mns.ZTestSendMsg.main(ZTestSendMsg.java:55)
(org.apache.axis.attachments.AttachmentsImpl.java:522)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值