Hey Guys,

 

  I've been struggling with this problem and would appreciate if someone
could help me out.  I have XFire running on a server with Tomcat.  I
have an XFire client that I created  in Eclipse.  In the client, I'm
reading an xml file and putting in a  org.w3c.dom.Document object.I'm
doing this with the following code snippet:

 

            DOMParser parser = new DOMParser();

            parser.parse(file);

            document = parser.getDocument();

 

When I call the web service, I pass this document as a parameter.  On
the server, I take the document and convert it to xml and output it to a
stream.  The code for that is below:

 

// Use a Transformer for output

            TransformerFactory tFactory =
TransformerFactory.newInstance();

            Transformer transformer = tFactory.newTransformer();

 

            DOMSource source = new DOMSource(jobParam);

            StringWriter buffer = new StringWriter();

            StreamResult result = new StreamResult(buffer);

            transformer.setOutputProperty(OutputKeys.INDENT, "yes");

            transformer.transform(source, result);

 

            return buffer.toString();

 

The problem I'm having is, XFire seems to be adding an <in0> tag to the
xml file.  I need the xml file to be exactly how it was on the client
side.  However, an extra tag is being added.

 

XML File on client side 

 

<?xml version="1.0" encoding="UTF-8"?>

<service-level-query>

            <query>

                        <job-id>

                                    1170785289253

                        </job-id>                       

            </query>

</service-level-query>

 

XML File on Server side

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<in0 xmlns="DetailedHealthCheckDemo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:type="xsd:anyType">

<service-level-query>

      <query>

            <job-id>

                  1170785289253

            </job-id>         

      </query>

</service-level-query>

</in0>

 

As seen above, the <in0 tag is being added by XFire.  I need it to not
add this.  Is it possible to prevent it from doing that.  Perhaps a
property that I need to set.  

I also tried creating the document on the client using the
DocumentBuilderFactory, for which I had to turn the namespaceaware
property to true otherwise XFire would throw an exception.  That
resulted in the same xml file on the server.  

 

Thanks, I appreciate the help.

 

Kabir

Reply via email to