XML : pass xml string as parameter in soap webservice in java

Here is xml String

xmlStr="<Survey><abc>123</abc></survey>"

I want to convert that xml string to following class object

  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);    

Pass org.tempuri.camswrapper.service_lt.GetSurveyResult.XmlDoc this class object into following method

  String result=port.getSurveyResult(xmldoc);    

No comments:

Post a Comment