刚接触axis,看不懂代码 求代码注释!!
public static void firstAXJS() {
try {
String endpoint = "http://127.0.0.1:8080/services/firstaxjs";
Service serv = new Service();//?
Call call = (Call) serv.createCall();//?
call.setTargetEndpointAddress(endpoint);//?
call.setUseSOAPAction(true);//?
call.setOperationName(new QName(endpoint, "receiveMsg"));//?
QName qName1 = new QName("urn:yb_yhjk_xxjs_gdyh", "ReceiveMsg");//?
call.registerTypeMapping(ReceiveMsg.class, qName1,
new BeanSerializerFactory(ReceiveMsg.class, qName1),
new BeanDeserializerFactory(ReceiveMsg.class, qName1));
//?
QName qName2 = new QName("urn:yb_yhjk_xxjs_gdyh", "ReceiveMsgResponse");
call.registerTypeMapping(ReceiveMsgResponse.class, qName2,
new BeanSerializerFactory(ReceiveMsgResponse.class, qName2),
new BeanDeserializerFactory(ReceiveMsgResponse.class, qName2));
//?
ReceiveMsg receiveMsg = new ReceiveMsg();//?
Object result = call.invoke(new Object[] { receiveMsg });//?
if (result instanceof ReceiveMsgResponse) {//?
System.out.println("====================================");
String rst=((ReceiveMsgResponse) result).getReceiveMsgReturn();
System.out.println(rst);
System.out.println("------------------------------------");
Map<String,String> map=XMLBuilder.xml2map(rst.split("<checkCode>")[0]);
System.out.println(map.toString());
System.out.println("====================================");
}
} catch (Exception e) {
e.printStackTrace();
}
}
先谢谢大家,菜鸟一个望大家勿喷!
------解决方案--------------------都挤成一堆 我看的都累了