(soap:envelope xmlns:ns1="http://mynamespace.com/ns1" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/")
(soap:body)
(ns1:updatemydetails)
(ns1:items)
(ns1:id)1(/ns1:id)
(ns1:name)crazy coders(/ns1:name)
(ns1:email)crazycoders4u@gmail.com(/ns1:email)
(ns1:age)25(/ns1:age)
(/ns1:items)
(/ns1:updatemydetails)
(/soap:body)
(/soap:envelope)
SOAPMessage message = MessageFactory.newInstance().createMessage(null, new ClassPathResource ("soap_message.xml").getInputStream());
JAXBContext jaxbContext = JAXBContext.newInstance(UpdateMyDetails.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
UpdateMyDetails updateMyDetails = (UpdateMyDetails) jaxbUnmarshaller.unmarshal(message.getSOAPBody().extractContentAsDocument());
SOAPMessage message = MessageFactory.newInstance().createMessage(null, new ByteArrayInputStream(s1.getBytes()));
No comments:
Post a Comment