RICO wrote:in
> Hi,
> I have a problem with saaj 1.3 and JDK 1.6
>
> I have a simple servlet that creates a SOAPMessage beginning from an
> InputStream.
> When I try to get anything from the SOAPMessage (see System.out line)
> I get null in console, but if I use the writeTo() method, it works, so
> it seems that the object is properly created.
>
> I need to use getSOAPBody() method to access and parse the SOAP message.
>
> Note: with JDK 1.5 this code works properly, but to use some other
> libraries I must use JDK 1.6.
>
> What's wrong in my code updating from JDK 1.5 to 1.6?
> (In attachment java code and below the SOAP message code)
>
If it works with JDK 1.5, it should have worked with JDK 1.6 as well.
The differernce i can imagine is JAXP between your JDK 1.5 and 1.6
runs. Can you check the JAXP which gets used in both.
regards,
kumar
> Thanks a lot
>
> Riccardo
>
> Here the code:
>
> public void doPost(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException {
>
> res.setContentType("text/xml; charset=utf-8");
>
> SOAPMessage soapReq = null;
> SOAPMessage soapRes = null;
>
> try {
> MessageFactory msgFactory = MessageFactory.newInstance();
> soapReq = msgFactory.createMessage(null,
> req.getInputStream());
>
> soapReq.saveChanges();
> soapRes = msgFactory.createMessage();
>
>
> System.out.println(soapReq.getSOAPBody().getFirstChild().getLocalName());
> soapReq.writeTo(res.getOutputStream());
>
> } catch (SOAPException e) {
> e.printStackTrace();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> and the SOAP message I tried:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
> <SOAP-ENV:Envelope
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> <SOAP-ENV:Body>
> <ns1:doubleAnInteger
> xmlns:ns1="urn:MySoapServices">
> <param1 xsi:type="xsd:int">123</param1>
> </ns1:doubleAnInteger>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>