package com.eiac.uuv;
/**
* 描述:统一用户视图接口调用demo
*
* 时间:2007-11-22
*
* 版本:V1.0
*/
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.encoding.XMLType;
public class UUVClient {
public UUVClient() {
}
public static void main(String[] args) throws Exception
{
//String str=UUVClient.call();
//System.out.println("str::::::::"+str);
try {
String curTime = UUVUtil.getDateSecondFormat(); // 取得当前时间
String apCode = "AP1000000344"; // 应用编码由UUV接口方提供
String key = "1EA0515E6C2E47A28108FF22C6CF184C1EA0515E6C2E47AA"; // IASKey由UUV接口方提供,一定要48位,不然会报异常
UUVRequest uUVRequest = new UUVRequest(apCode, curTime, key);
//生成认证码
String authCode = UUVUtil.CreateAuthenticator(uUVRequest);
//以下为调用UUV接口
String endpoint = "http://10.16.25.113:8009/IASService.asmx";
//正文
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName("http://uuv.gdeiac.com","GetAllNaGroup"));
call.addParameter("IASID",
org.apache.axis.encoding.XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter("TimeStamp",
org.apache.axis.encoding.XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter("Authenticator",
org.apache.axis.encoding.XMLType.XSD_STRING,
ParameterMode.IN);
call.setReturnType(XMLType.SOAP_STRING);
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://uuv.gdeiac.com/GetAllNaGroup");
call.setTimeout(new Integer(0));
System.out.println("welcome to ...............");
String ret = (String)call.invoke(new Object[] {apCode,curTime,authCode});
System.out.println("result is: " + ret);
} catch (Exception e) {
e.printStackTrace();
//System.out.println(e.toString());
}
}
}
发生错误如下:
ERROR - Exception:
org.xml.sax.SAXException: Deserializing parameter 'GetAllNaGroupResult': could not find deserializer for type {SOAP-ENC}string
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:277)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.eiac.uuv.UUVClient.main(UUVClient.java:58)
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Deserializing parameter 'GetAllNaGroupResult': could not find deserializer for type {SOAP-ENC}string
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Deserializing parameter 'GetAllNaGroupResult': could not find deserializer for type {SOAP-ENC}string
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:277)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.eiac.uuv.UUVClient.main(UUVClient.java:58)
{http://xml.apache.org/axis/}hostname:luochenyu
org.xml.sax.SAXException: Deserializing parameter 'GetAllNaGroupResult': could not find deserializer for type {SOAP-ENC}string
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:2470)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.eiac.uuv.UUVClient.main(UUVClient.java:58)
Caused by: org.xml.sax.SAXException: Deserializing parameter 'GetAllNaGroupResult': could not find deserializer for type {SOAP-ENC}string
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:277)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
... 3 more
===急啊,查了好久资料也问了不少人还是没搞出来。希望高手指点啊