我们正在尝试使用Apache Axis2框架访问RPC样式的Web服务。它在正常的负载条件下运行良好。但是我们可以在稍微增加的负载上看到随机空指针异常。下面是跟踪..
显示java.lang.NullPointerException at org.apache.axis2.context.AbstractContext.needPropertyDifferences(AbstractContext.java:239) at org.apache.axis2.context.AbstractContext.setProperty(AbstractContext.java:202) at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.obtainHTTPHeaderInformation(HTTPSenderImpl.java:394) at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.processResponse(HTTPSenderImpl.java:490) at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.handleResponse(HTTPSenderImpl.java:311) at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:213) 在org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121) 在org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403) 在org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234) 在org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431) 在org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399) 在org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225) 在org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
与Axis2和ESB相关的问题几乎没有。
但是有没有使用Axis2的纯Java客户端的解决方案?
我们的实施的代码片段在下面..
RPCServiceClient sender = new RPCServiceClient();
MessageContext reqMessageContext = new MessageContext();
OperationClient opClient = sender
.createClient(ServiceClient.ANON_OUT_IN_OP);
reqMessageContext.setEnvelope(buildRequestSoapEnvelope());
reqMessageContext.setProperty(HTTPConstants.HTTP_HEADERS,
headers);
opClient.addMessageContext(reqMessageContext);
opClient.execute(true);
MessageContext responseMessageContx = opClient
.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
任何解决方案或提示都将受到赞赏..我们使用1.7.0版本的Axis2库