java 中添加soaphead代码如下
public void invoke(MessageContext context) throws Exception {
// TODO Auto-generated method stub
//为soap header 构造验证信息
Element el = new Element("header");
context.getOutMessage().setHeader(el);
Element auth = new Element("AuthenticationToken");
Element username_el = new Element("Username");
username_el.addContent(username);
Element password_el = new Element("Password");
password_el.addContent(userpassword);
auth.addContent(username_el);
auth.addContent(password_el);
el.addContent(auth);
}
}
.net 中不知道要如何添加soaphead