X
xx0118
Unregistered / Unconfirmed
GUEST, unregistred user!
Call call = new Call();
// 创建类型映射注册器
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSer = new BeanSerializer();
// 映射类型
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("http://service.zx.chinavnet.com/v1.0/Logout","Logout"),null, beanSer, beanSer);
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("http://service.zx.chinavnet.com/v1.0/Logout");
call.setMethodName("Logout");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
params.addElement (new Parameter("SenderID", String.class, "111", Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("SPID", String.class, "111", Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("TimeStamp", String.class, "111", Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("UserID", String.class, "111", Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("NickName", String.class, "111", Constants.NS_URI_SOAP_ENC));
call.setParams(params);
Response resp = null;
try {
resp = call.invoke(url, "http://service.zx.chinavnet.com/v1.0/Logout");//在这调用失败
}
catch (SOAPException e) {
System.err.println("Caught SOAPException (" + e.getFaultCode () + "): " + e.getMessage ());
//调用失败,提示:Caught SOAPException (SOAP-ENV:Client): No Deserializer found to deserialize a 'http://service.zx.chinavnet.com/v1.0/:LogoutResult' using encoding style 'null'.
return;
}
// 检查返回值
if (resp != null &&
!resp.generatedFault()) {
System.out.println ("invoke succufll!");
}
else
{
Fault fault = resp.getFault ();
System.err.println ("Generated fault: ");
System.out.println (" Fault Code = " + fault.getFaultCode());
System.out.println (" Fault String = " + fault.getFaultString());
}
resp = call.invoke(url, "http://service.zx.chinavnet.com/v1.0/Logout");//在这调用失败
//调用失败,提示:Caught SOAPException (SOAP-ENV:Client): No Deserializer found to deserialize a 'http://service.zx.chinavnet.com/v1.0/:LogoutResult' using encoding style 'null'.
url为:http://developer.chinavnet.com/VNetInterface/SPForVNet/SPInterfaceForVNet.asmx
大家可以在线试试看
// 创建类型映射注册器
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSer = new BeanSerializer();
// 映射类型
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("http://service.zx.chinavnet.com/v1.0/Logout","Logout"),null, beanSer, beanSer);
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("http://service.zx.chinavnet.com/v1.0/Logout");
call.setMethodName("Logout");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
params.addElement (new Parameter("SenderID", String.class, "111", Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("SPID", String.class, "111", Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("TimeStamp", String.class, "111", Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("UserID", String.class, "111", Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("NickName", String.class, "111", Constants.NS_URI_SOAP_ENC));
call.setParams(params);
Response resp = null;
try {
resp = call.invoke(url, "http://service.zx.chinavnet.com/v1.0/Logout");//在这调用失败
}
catch (SOAPException e) {
System.err.println("Caught SOAPException (" + e.getFaultCode () + "): " + e.getMessage ());
//调用失败,提示:Caught SOAPException (SOAP-ENV:Client): No Deserializer found to deserialize a 'http://service.zx.chinavnet.com/v1.0/:LogoutResult' using encoding style 'null'.
return;
}
// 检查返回值
if (resp != null &&
!resp.generatedFault()) {
System.out.println ("invoke succufll!");
}
else
{
Fault fault = resp.getFault ();
System.err.println ("Generated fault: ");
System.out.println (" Fault Code = " + fault.getFaultCode());
System.out.println (" Fault String = " + fault.getFaultString());
}
resp = call.invoke(url, "http://service.zx.chinavnet.com/v1.0/Logout");//在这调用失败
//调用失败,提示:Caught SOAPException (SOAP-ENV:Client): No Deserializer found to deserialize a 'http://service.zx.chinavnet.com/v1.0/:LogoutResult' using encoding style 'null'.
url为:http://developer.chinavnet.com/VNetInterface/SPForVNet/SPInterfaceForVNet.asmx
大家可以在线试试看