如何使用soap Web服务将xml String转换为java中的类对象

时间:2015-12-05 07:19:28

标签: java soap

##我试图用JAXB ##

对类对象进行类型转换

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 =(org.tempuri.camswrapper.service_lt.GetSurveyResult)jaxbUnmarshaller.unmarshal(file);     org.tempuri.camswrapper.service_lt.GetSurveyResult xmldoc =(org.tempuri.camswrapper.service_lt.GetSurveyResult)jaxbUnmarshaller.unmarshal(inputSource);

String result=port.getSurveyResult(xmldoc);

0 个答案:

没有答案