axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurence L Leff <>
Subject Message Service Response XML is garbled
Date Sun, 21 Oct 2007 21:18:53 GMT
I am setting up a simple Message service in Axis 1-2-1
(It translates the XML, primarily using the org.w3c.dom commands.
I would like to use those rather than the special methods from
SOAPElement.  My students will be taught the DOM parsing techniques
for other reasons.) 

It is sending back garbled XML to the client as indicated by the 
TCPMonitor tool, as shown below.  First I attach my service.

I also tried detaching the body with resp.getBody(.detachNode()
and then doing a resp.addBody() and switching to Axis 1-4
but that did not help.

import javax.xml.parsers.*;
import org.apache.xml.serialize.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import Debug.*;
import javax.xml.soap.*;
public class eight {
public void method (SOAPEnvelope req, SOAPEnvelope resp) {
try { 

SOAPBody  RequestBody = req.getBody();
NodeList nl = RequestBody.getChildNodes();
org.w3c.dom.Node RequestTextNode = (org.w3c.dom.Node)nl.item(0);
String MyText = RequestTextNode.getNodeValue();

SOAPBody ResponseBody = resp.getBody();
Document d = ResponseBody.getOwnerDocument();
org.w3c.dom.Node NewTextNode = (org.w3c.dom.Node)d.createTextNode(MyText);
Element ResponseElement = d.createElement("abc");

catch (javax.xml.soap.SOAPException SE) {
       Debug.P("Soap Exception " + SE.getMessage());
POST /axis/services/eight HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.2.1


Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 284

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv=""
xmlns:xsd="" xmlns:xsi=""><soapenv:Body><vehicles>Ss</vehicles></soapenv:Body></soapenv:Envelope>====
Response ====
HTTP/1.1 200 OK

Content-Type: text/xml;charset=utf-8

Date: Sun, 21 Oct 2007 14:49:18 GMT

Server: Apache-Coyote/1.1

Connection: close

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv=""
xmlns:xsd="" xmlns:xsi=""><soapenv:Body><

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message