Hmm, maybe it will be simpler just to set these values explicitly on client and server side, as described : http://xfire.codehaus.org/services.xml+Reference
On client side you need to set use/style properties on service factory or pass properties map as create method paramter. On 2/12/07, Kabir Sondhi <[EMAIL PROTECTED]> wrote:
Hey Tomek, This might be a noob thing to ask, but how do I check what style/setting I'm using on the client and server side. I didn't notice any setting that stood out on the server web.xml and context.xml files. They are default. Any ideas? Thanks, -----Original Message----- From: Tomek Sztelak [mailto:[EMAIL PROTECTED] Sent: February 12, 2007 10:16 AM To: [email protected] Subject: Re: [xfire-user] XFire is adding unwanted <in0> tags to XML w3c Document. Can I prevent this? Hmm This is strange. I'm not sure what can cause such problem, but can you check what style/use setting you have on both sides ? On 2/12/07, Kabir Sondhi <[EMAIL PROTECTED]> wrote: > Hey John, > > Thanks for your quick response. You might be right when you say I'm > using the Xfire framework inappropriately. This is my first time using > the framework. The reason I'm not just passing a long as a parameter, > because I might have more than one variable i.e. a list of jobIds, or 10 > different parameters. I have another web service method that requires > different number of variables. I always thought that for web services, > you pass w3c Document objects rather than complex ones i.e. an array or > List for the simple reason that a .net client can read the java ws and > vice-versa. Is that not correct? Thus, I figured an xml file format > would be the best way to transfer the information. Do you have any > ideas of a better way of doing this. Our client, who is also writing > the web service client, is not using XFire, and they suggested > transferring information via xml. Hence, I went with that approach. > Given this information, do you think I am still not using the framework > properly? Once again, thanks for your help. > > > > > > -----Original Message----- > From: John M. Page [mailto:[EMAIL PROTECTED] > Sent: February 12, 2007 9:03 AM > To: [email protected] > Subject: RE: [xfire-user] XFire is adding unwanted <in0> tags to XML w3c > Document. Can I prevent this? > > After, responding to your query, I began to puzzle over your question... > > It just sounds like you may be using the framework inappropriately. Why > are you parsing the XML directly? XFire provides the mechanism to > insulate you entirely from the low-level details of your service. > Perhaps you should write yourself a simple Bean to encapsulate the > service: > > public interface JobLevelService{ > > public String getLevel(long jobId); > > } > > And follow the XFire tutorials to turn your simple interface and > implementation bean into a service. > > A suggestion. I don't know the requirements of your project. > > Cheers, > John Page > > > > > > -----Original Message----- > From: Kabir Sondhi [mailto:[EMAIL PROTECTED] > Sent: Sun 2/11/2007 10:24 PM > To: [email protected] > Subject: RE: [xfire-user] XFire is adding unwanted <in0> tags to XML w3c > Document. Can I prevent this? > > Hey John, > > > > jobParam is just a document variable. The first node is > <service-level-query>. I tried your suggestion of > > > > DOMSource source = new DOMSource(jobParam.getFirstChild()) > > > > That returned the same results as below. The <xml> tag is first. Then > the <in0> tag, then the <service-level-query> tag. This is how the xml > file turned out on the server. > > > > <?xml version="1.0" encoding="UTF-8"?> > > <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> > > > > Right before the file was sent from client to server, I did the same > conversion of the Document into xml and got > > > > <?xml version="1.0" encoding="utf-8" standalone="no"?> > > <service-level-query> > > <query> > > <job-id> > > 1170785289253 > > </job-id> > > </query> > > </service-level-query> > > > > > > This is why I believe xfire is adding the extra tag. Also, Ciaren, you > mentioned that I might be able to configure this on the client side. > Any ideas how? Thanks for your help in advance guys. > > > > > > > > > > > > > ________________________________ > > From: John M. Page [mailto:[EMAIL PROTECTED] > Sent: February 10, 2007 5:33 PM > To: [email protected] > Subject: RE: [xfire-user] XFire is adding unwanted <in0> tags to XML w3c > Document. Can I prevent this? > > > > Those "<in0>" tags frame the first "Parameter" being submitted to your > "Operation". If you had a second parameter, this would be descibed as > "<in1>" and so on. > > "jobParam" is be a Node, right? I would venture this will solve your > problem. > Try this: > DOMSource source = *new* DOMSource( jobParam.getFirstChild() ); > > The xml declaration at the top is throwing you off. Its not that Xfire > is inserting the "<in0>" tag. You're just one Node higher up in the > document tree than you want to be. > > Cheers, > John Page > > > > -----Original Message----- > From: Ciaran [mailto:[EMAIL PROTECTED] > Sent: Sat 2/10/2007 1:17 PM > To: [email protected] > Subject: Re: [xfire-user] XFire is adding unwanted <in0> tags to XML w3c > Document. Can I prevent this? > > Not really sure, but my first shot in the dark would be the client is > defaulting to using 'doc-lit-wrapped' and you may intend to be using > document-literal/bare [non-wrapped] conventions? You may well be able to > > configure this on the client? > - Ciaran > > > > On 2/8/07, Kabir Sondhi <[EMAIL PROTECTED]> wrote: > > > > 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* > > > > > > -- > - Ciaran > (I now have far too many G-Mail invites available, anyone who wants one, > > gets one) > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > > > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > > -- ----- When one of our products stops working, we'll blame another vendor within 24 hours. --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
-- ----- When one of our products stops working, we'll blame another vendor within 24 hours. --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
