这是xml String:
xmlStr="<Survey><abc>123</abc></survey>"
我想将该xml字符串转换为以下类对象:
JAXBContext jaxbContext = JAXBContext.newInstance(org.tempuri.camswrapper.service_lt.GetSurveyResult.Xmldoc.class);
org.tempuri.camswrapper.service_lt.ServiceLT service = new org.tempuri.camswrapper.service_lt.ServiceLT();
org.tempuri.camswrapper.service_lt.ServiceLTSoap port = service.getServiceLTSoap12();
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
org.tempuri.camswrapper.service_lt.GetSurveyResult.Xmldoc xmldoc = (org.tempuri.camswrapper.service_lt.GetSurveyResult.XmlDoc) jaxbUnmarshaller.unmarshal(inputSource);
将org.tempuri.camswrapper.service_lt.GetSurveyResult.XmlDoc此类对象传递给以下方法:
String result=port.getSurveyResult(xmldoc);