Hi,

after some hours I found the problem: I was using Apache xerces 2.6.2 and
xalan 2.6.0 (java endorsed directory setup) together with SAAJ 1.2. Using
the standard jaxp parsers as they come with the java 1.4.2 release works -
but I need the new releases in my application.

I just downloaded Java Web Services Developer Pack 1.5 which includes SAAJ
1.2.1 and it's own versions of xerces and xalan. Sun dubs these versions
2.6.2+ and 2.6.0+.

Strangely enough: the package of these xerces and xalan derivates is named
com.sun.org.apache...

However, with this release, axis 1.2RC works neatly.

Below is my basic test code.

Best regards,
Walter


-------------

    static public String dump(Node node) throws Exception {
            TransformerFactory tf = TransformerFactory.newInstance();
            Transformer t = tf.newTransformer();
            DOMSource source = new DOMSource(node);
            StringWriter sw = new StringWriter();
            Result result = new StreamResult(sw);
            t.transform(source, result);
            return sw.toString();
    }
    
    public static void main(String[] args) throws Exception {
            
            SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
            SOAPConnection connection = scf.createConnection();
            MessageFactory msgFactory = MessageFactory.newInstance();

            SOAPMessage msg = msgFactory.createMessage();
            SOAPPart soapPart = msg.getSOAPPart();

            // import command xml soap into soap message
            
            DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
            docBuilderFactory.setValidating(false);
            docBuilderFactory.setIgnoringComments(false);
            docBuilderFactory.setNamespaceAware(true);
            DocumentBuilder docBuilder =
docBuilderFactory.newDocumentBuilder();
            
            Document doc = docBuilder.parse(new
File("/Users/walbauer/auction2.xml"));
            doc.normalize();
            
            // dump source
            System.out.println("Sending request:");
            System.out.println(dump(doc.getFirstChild()));
            
            DOMSource domSource = new DOMSource(doc.getFirstChild());
            soapPart.setContent(domSource);
            msg.saveChanges();
            
            URL endpoint = new
URL("http://localhost:8888/axis/services/MessageService";);
            SOAPMessage reply = connection.call(msg, endpoint);
                   
            SOAPBody n = reply.getSOAPBody();
            
            // dump result
            System.out.println("Result:");
            System.out.println(dump(n));

            
    }


/Users/walbauer/auction2.xml contains:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";>
<SOAP-ENV:Body>
<AUCTIONBLOCK>
    ....
</AUCTIONBLOCK>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>




> Walter,
> 
> Can you please log a bug report with your sample code (both server and
> client?)
> 
> thanks,
> dims
> 
> 
> On Wed, 19 Jan 2005 15:35:41 +0100, Walter Bauer <[EMAIL PROTECTED]>
> wrote:
>> Hello,
>> 
>> before issuing a bug report, I'd just want to make sure, that I'm not doing
>> something wrong.
>> 
>> I'm using the MessageService sample to echo an arbitrary XML using SAAJ as
>> client. See Xml below.
>> 
>> Using Axis 1.1, the reply is as expected (the same XML). Using Axis 1.2RC2
>> only the following fragment is returned:
>> 
>>     <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>>       <soapenv:Body>
>>         <AUCTIONBLOCK>
>>           <ITEM/>
>>         </AUCTIONBLOCK>
>>       </soapenv:Body>
>>     </soapenv:Envelope>
>>   </result>
>> 
>> Adding logging to the MessageService.java shows, that the received
>> message-xml is already truncated.
>> 
>> I tried all four valid signatures for message-style services:
>>     public Element [] method(Element [] bodies);
>>     public SOAPBodyElement [] method (SOAPBodyElement [] bodies);
>>     public Document method(Document body);
>>     public void method(SOAPEnvelope req, SOAPEnvelope resp);
>> 
>> Best regards,
>> Walter Bauer
>> 
>> -----
>> 
>> XML parsed and sent using SAAJ as Body:
>> 
>> <SOAP-ENV:Body>
>>     <AUCTIONBLOCK>
>>         <ITEM>
>>             <TITLE>Vase and Stones</TITLE>
>>             <ARTIST>Linda Mann</ARTIST>
>>             <DIMENSIONS>20x30 inches</DIMENSIONS>
>>             <MATERIALS>Oil</MATERIALS>
>>             <YEAR>1996</YEAR>
>>             <DESCRIPTION>Still Life</DESCRIPTION>
>>             <PREVIEW-SMALL src="burl-s.jpg" width="300" height="194"
>> alt="Vase and Stones"/>
>>             <BIDS>
>>                 <BID>
>>                     <PRICE>6000</PRICE>
>>                     <TIME>3:02:22 PM</TIME>
>>                     <BIDDER>Chris</BIDDER>
>>                     <TIMESTAMP>1307</TIMESTAMP>
>>                 </BID>
>>                 <BID>
>>                     <PRICE>5700</PRICE>
>>                     <TIME>2:58:42 PM</TIME>
>>                     <BIDDER>John</BIDDER>
>>                     <TIMESTAMP>1315</TIMESTAMP>
>>                 </BID>
>>                 <BID>
>>                     <PRICE>5600</PRICE>
>>                     <TIME>2:54:32 PM</TIME>
>>                     <BIDDER>Andrew</BIDDER>
>>                     <TIMESTAMP>1308</TIMESTAMP>
>>                 </BID>
>>                 <BID>
>>                     <PRICE>5500</PRICE>
>>                     <TIME>2:48:08 PM</TIME>
>>                     <BIDDER>Chris</BIDDER>
>>                     <TIMESTAMP>1307</TIMESTAMP>
>>                 </BID>
>>                 <BID>
>>                     <PRICE>5000</PRICE>
>>                     <TIME>2:47:58 PM</TIME>
>>                     <BIDDER>opening price</BIDDER>
>>                     <TIMESTAMP>1298</TIMESTAMP>
>>                 </BID>
>>             </BIDS>
>>             <TIMESTAMP>1315</TIMESTAMP>
>>         </ITEM>
>>     </AUCTIONBLOCK>
>> </SOAP-ENV:Body>
>> 
>> 
> 


Reply via email to