客户端方法:
/**
* 检修计划通知
* @param docXML格式的参数字符串
* @return1:成功信息;0:错误信息
*/
public static String repairNoticeManager(String data) {
try {
Service service = new Service();
Call call = (Call) service.createCall(new QName(TNS));
call.setTargetEndpointAddress( new java.net.URL(WSDL));
call.setOperationName(new QName(TNS, "repairNotice") );
String res = (String) call.invoke( new Object[] {data});
if(String.valueOf(res).startsWith("1:")) {
log_.info("√发送成功![检修通知,至:总部门户]");
}else {
log_.error(res+"[检修通知,至:总部门户]");
}
return res;
} catch (ServiceException e) {
e.printStackTrace();
log_.error("创建服务连接失败[检修通知,分发至:总部门户!]",e);
} catch (MalformedURLException e) {
e.printStackTrace();
log_.error("实例服务地址失败[检修通知,分发至:总部门户!]",e);
} catch (RemoteException e) {
e.printStackTrace();
log_.error("呼叫服务方法失败[检修通知,分发至:总部门户!]",e);
}
return "0:发送SOAP消息失败[检修通知,分发至:总部门户!]";
} 将服务端部署在集群上,客户端用F5的地址调用服务端,一切正常。
将F5的地址注册到ESB上之后,客户端用ESB映射出来的地址调用服务端,出现如下错误:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: BEA-380000: Length Required
faultActor:
faultNode:
faultDetail:
{http://www.bea.com/wli/sb/context}fault:BEA-380000Length RequiredRouteNode1response-pipeline
BEA-380000: Length Required
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
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:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at com.sgcc.portal.client.IdsClient.repairObjectManager(IdsClient.java:64)
at com.sgcc.portal.test.Test$1.run(Test.java:54)
不知道为何?