Organizational Research By

Surprising Reserch Topic

boostr.in questions - Question:Adding Data in XmlObject


I have to code a Web service client, compliant to Axis2 1.5.4. The part of code giving the problem is as follows:

String my_var = "some value";
MetaDataEntry metaDataEntry = MetaDataEntry.Factory.newInstance();
MetaDataEntry.setKey(MetaDataKey.Enum.forInt(key));
metaDataEntry.setValue(my_var);

Now basically the setKey woks fine but setValue expects an XmlObject value while according to the sample response document I have got, the xml structure should be like :

....

   some_key_enum
   some _value

....

I've tried using :

A.

MetaDataEntry.setValue(XmlObject.Factory.parse(""+my_var+"")); but it makes the value tag as some_value

B.

metaDataEntry.setValue(XmlObject.Factory.parse(my_var)); but it gives an exception 'Unexpected Element: CDATA'

Can anybody please help me write the correct statement?
asked Sep 13, 2013 in Core java by anonymous
edited Sep 12, 2013
0 votes
9 views



Related Hot Questions



Government Jobs Opening


...