webservice client打印报文格式
程序员文章站
2022-07-10 15:26:02
...
找到生成的客户端代码中的这个类:******SoapBindingStub
public java.lang.String custSearchById(java.lang.String data) throws java.rmi.RemoteException, cn.custcn.webservice.CustomException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[21]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("webservice.custcn.cn", "custSearchById"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {data});
// 打印请求和返回报文
System.out.println(_call.getMessageContext().getRequestMessage().getSOAPPartAsString());
System.out.println(_call.getMessageContext().getResponseMessage().getSOAPPartAsString());
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (java.lang.String) _resp;
} catch (java.lang.Exception _exception) {
return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof cn.custcn.webservice.CustomException) {
throw (cn.custcn.webservice.CustomException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
上一篇: HTTP请求:从浏览器地址栏输入url到页面显示的全过程(Complete Procedure of How an HTTP Request Works)
下一篇: servlet接口,报文格式
推荐阅读
-
基于DEV控件库的webservice打印.repx模板
-
webservice client打印报文格式
-
WEBService Client(PHP)->Server(JAVA)解决办法
-
php webservice client
-
Linux下C gsoap client访问java webservice server
-
Linux下C gsoap client访问java webservice server
-
基于DEV控件库的webservice打印.repx模板
-
JBoss 7.1.1 无法使用spring 创建web service 客户端(Trying to launch WebService Client fail