这是JAVA添加的SOAPHead代码:
public void invoke(MessageContext context) throws Exception
{
Element el = new Element("header");
context.getOutMessage().setHeader(el);
Element auth = new Element("AuthenticationToken");
Element username_el = new Element("loginNo");
username_el.addContent(this.username);
Element password_el = new Element("pwd");
password_el.addContent(this.password);
auth.addContent(username_el);
auth.addContent(password_el);
el.addContent(auth);
}
这是JAVA设置soaphead的写法,,,求如果是XML,是什么样式的。
public void invoke(MessageContext context) throws Exception
{
Element el = new Element("header");
context.getOutMessage().setHeader(el);
Element auth = new Element("AuthenticationToken");
Element username_el = new Element("loginNo");
username_el.addContent(this.username);
Element password_el = new Element("pwd");
password_el.addContent(this.password);
auth.addContent(username_el);
auth.addContent(password_el);
el.addContent(auth);
}
这是JAVA设置soaphead的写法,,,求如果是XML,是什么样式的。
<AuthenticationToken>
<loginNo>this.username这个就是你的变量值</loginNo>
<pwd>this.password这个就是你的变量值</pwd>
</AuthenticationToken>
</header>在不知道你MessageContext是什么的情况下,正常你这个xml的格式就这样了!