SOAP Envelope UnMarshalling

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

Comments

Popular posts from this blog

தீபம் பிளக்ஸ்

தட்டு வண்டியில் காளிக்கோயில் - சிறுகதை

காது புடி வாத்தியார்