0
回答
android调用带soapheader的webservice
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   
android调用带soapheader的webservice
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
Element[] header = new Element[1];
header[0] = new Element().createElement(NameSpace, "header");
Element username = new Element().createElement(NameSpace,
"Username");
username.addChild(Node.TEXT, "admin");
header[0].addChild(Node.ELEMENT, username);
Element pass = new Element().createElement(NameSpace, "Password");
pass.addChild(Node.TEXT, "123");
header[0].addChild(Node.ELEMENT, pass);

envelope.headerOut = header;
// 设置是否调用的是dotNet下的WebService
envelope.dotNet = true;
// 必须,等价于envelope.bodyOut = request;
envelope.setOutputSoapObject(request);
// step4 创建HttpTransportSE对象
AndroidHttpTransport ht = new AndroidHttpTransport(this.finalUrl);
关键代码不对那 webservice那边

Element token = context.getInMessage().getHeader().getChild(
WebserviceConstant.TOKEN);
接受到的空值啊 请问高手给看看
举报
huazai
发帖于5年前 0回/1K+阅
顶部