2 yeshuang520 yeshuang520 于 2016.02.03 12:25 提问

在SOAPElement中添加空字符串子类怎么成对出显 30C

在使用SOAPElement添加子类,如下图:
图片说明
生居的XML格式如下图:
图片说明
要怎么才能生成字符成对出现,如下图:
图片说明

2个回答

rui888
rui888   Ds   Rxr 2016.02.03 13:16

好像改不了吧。 除非修改它的源码

 addAttribute

SOAPElement addAttribute(Name name,
                         String value)
                         throws SOAPException
Adds an attribute with the specified name and value to this SOAPElement object.
Parameters:
name - a Name object with the name of the attribute
value - a String giving the value of the attribute
Returns:
the SOAPElement object into which the attribute was inserted
Throws:
SOAPException - if there is an error in creating the Attribute, or it is invalid to set an attribute with Name name on this SOAPElement.
See Also:
addAttribute(javax.xml.namespace.QName, String)
rui888
rui888   Ds   Rxr 2016.02.03 13:19

上面拷贝错了
http://www.javadocexamples.com/java_source/com/sauria/apachexml/ch9/MessageBookService/MessageBookProvider.java.html

addTextNode

SOAPElement addTextNode(String text)
                        throws SOAPException
Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
Parameters:
text - a String object with the textual content to be added
Returns:
the SOAPElement object into which the new Text object was inserted
Throws:
SOAPException - if there is an error in creating the new Text object or if it is not legal to attach it as a child to this SOAPElement 
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!