You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Xinjun Chen <xj...@gmail.com> on 2006/05/17 09:29:53 UTC

passing XML document as input parameter

As far as I know, I cannot embed XML inside XML, so how can I pass an XML
document as an input parameter to a web service?
Could anyone provide some pointer on that?

Regards,
Xinjun

some question

Posted by "eL. Bi." <av...@yahoo.it>.
Hi,

i create a system of authentication with client/side
structure, i want to deploy it as Web Service, so i
choose Axix + Tomcat to do it. I have some questions:

A) i  have my own class that construct SOAP messages,
so it is possible to disable in the wsdll file the
serialization and deserialization automatic of Axis?
How i can do it?

B) If it isn't possbile to disable totally the
automatic construction of SOAP, it's possibile to pass
my soap messages as strings?

C) in my system i use methods in my class with static,
this is correct or it's better to don't use it?

Tanks for help, Luca.



	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: passing XML document as input parameter

Posted by Xinjun Chen <xj...@gmail.com>.
Hi Dies,

Thank you very much for sharing this with me. :) This is really very helpful
to me.

Regards,
Xinjun


On 5/19/06, Dies Koper <di...@jp.fujitsu.com> wrote:
>
> Hello Xinjun,
>
> Forgot to mention in my previous reply, but you could use an xsd:any type:
>
>       <complexType name="ctype">
>         <sequence>
>           <any/>
>         </sequence>
>       </complexType>
>
> This maps to a Javabean called Ctype with a property of type
> SOAPElement. SOAPElement implements org.w3c.dom.Element, so you get a
> parsed piece of DOM on the other side, no need to worry about escaping
> your content.
>
> Regards,
> Dies
>
>
> Xinjun Chen wrote:
> > As far as I know, I cannot embed XML inside XML, so how can I pass an
> XML
> > document as an input parameter to a web service?
> > Could anyone provide some pointer on that?
> >
> > Regards,
> > Xinjun
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: passing XML document as input parameter

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Xinjun,

Forgot to mention in my previous reply, but you could use an xsd:any type:

       <complexType name="ctype">
         <sequence>
           <any/>
         </sequence>
       </complexType>

This maps to a Javabean called Ctype with a property of type 
SOAPElement. SOAPElement implements org.w3c.dom.Element, so you get a 
parsed piece of DOM on the other side, no need to worry about escaping 
your content.

Regards,
Dies


Xinjun Chen wrote:
> As far as I know, I cannot embed XML inside XML, so how can I pass an XML
> document as an input parameter to a web service?
> Could anyone provide some pointer on that?
> 
> Regards,
> Xinjun



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: passing XML document as input parameter

Posted by Xinjun Chen <xj...@gmail.com>.
all the tags will be changed to "&gt;" and "&lt;", right?

Regards,
Xinjun


On 5/17/06, Suavi Ali Demir <de...@yahoo.com> wrote:
>
>  Why can you not embed xml inside xml?
> Regards,
> Ali
>
>
> *Xinjun Chen <xj...@gmail.com>* wrote:
>
> As far as I know, I cannot embed XML inside XML, so how can I pass an XML
> document as an input parameter to a web service?
> Could anyone provide some pointer on that?
>
> Regards,
> Xinjun
>
>
>

Re: passing XML document as input parameter

Posted by Xinjun Chen <xj...@gmail.com>.
 Suavi,

Thank you very much for your remind.
What do you mean by "more escaping than just '<' "? Do you mean I also need
to convert "&amp;" to "&", and etc?
I try to pass XML "<formula>a < b && c > d </formula>", the string at the
service side is
"&lt;formula> a &lt; b &amp;&amp; c > d &lt;/formula>". There may be other
special characters I nee to take care.
If client input is "<formula> a &lt; b &amp;&amp; c &gt; d </formula>",
the service side receives "&lt;formula> a &amp;lt; b &amp;amp;&amp;amp; c
&amp;gt; d &lt;/formula>"

So how shall I convert the passed string into original XML? Is there any
tool I can use?

Regards,
Xinjun


On 5/18/06, Suavi Ali Demir <demir4@yahoo.com > wrote:
>
>  Don't forget you might have xml as:
>
> "<formula>X &lt; Y</formula>"
>
> Now, if you process this string and make:
>
> "&lt;formula>X &lt; Y&lt;/formula>"
>
> When you reverse it, you will get:
>
> "<formula>X < Y</formula>"
>
> which is incorrect.
>
> So, you will need more escaping than just "<".
>
> Regards,
> Ali
>
> *Xinjun Chen <xj...@gmail.com>* wrote:
>
> Hi Dies,
>
> Thank you! You are right. In fact I can do that :-). Just need to replace
> all "&lt;" by "<".
>
> Regards,
> Xinjun
>
> On 5/17/06, Dies Koper <dies@jp.fujitsu.com > wrote:
> >
> > Hello Xinjun,
> >
> > Just use a String type field.
> > Axis will replace the '<'s and '>'s in your XML with '&lt;'s resp.
> > '&gt;'s, making it valid XML content.
> >
> > Regards,
> > Dies
> >
> >
> > Suavi Ali Demir wrote:
> > > Why can you not embed xml inside xml?
> > >   Regards,
> > >   Ali
> > >
> > > Xinjun Chen < xjchen001@gmail.com> wrote:
> > >     As far as I know, I cannot embed XML inside XML, so how can I pass
> > an XML document as an input parameter to a web service?
> > >   Could anyone provide some pointer on that?
> > >
> > >   Regards,
> > >   Xinjun
> >
> >
> >
>
>

Re: passing XML document as input parameter

Posted by Ali Demir <de...@yahoo.com>.
Well, there is more escaping to do than just <. Also, watch out for CDATA 
sections that may appear. Maybe you can find a function that is written to 
stream XML out to a string. There should be one ready to use out there.
Regards,
Ali


At 01:19 AM 5/18/2006, you wrote:
>Suavi,
>
>Thank you very much for your remind.
>What do you mean by "more escaping than just '<' "? Do you mean I also 
>need to convert "&amp;" to "&", and etc?
>I try to pass XML "<formula>a < b && c > d </formula>", the string at the 
>service side is
>"&lt;formula> a &lt; b &amp;&amp; c > d &lt;/formula>". There may be other 
>special characters I nee to take care.
>If client input is "<formula> a &lt; b &amp;&amp; c &gt; d </formula>", 
>the service side receives "&lt;formula> a &amp;lt; b &amp;amp;&amp;amp; c 
>&amp;gt; d &lt;/formula>"
>
>So how shall I convert the passed string into original XML? Is there any 
>tool I can use?
>
>Regards,
>Xinjun
>
>
>On 5/18/06, Suavi Ali Demir <<m...@yahoo.com>demir4@yahoo.com > 
>wrote:
>Don't forget you might have xml as:
>
>"<formula>X &lt; Y</formula>"
>
>Now, if you process this string and make:
>
>"&lt;formula>X &lt; Y&lt;/formula>"
>
>When you reverse it, you will get:
>
>"<formula>X < Y</formula>"
>
>which is incorrect.
>
>So, you will need more escaping than just "<".
>
>Regards,
>Ali
>
>Xinjun Chen <<m...@gmail.com> wrote:
>Hi Dies,
>
>Thank you! You are right. In fact I can do that :-). Just need to replace 
>all "&lt;" by "<".
>
>Regards,
>Xinjun
>
>On 5/17/06, Dies Koper <<m...@jp.fujitsu.com>dies@jp.fujitsu.com > 
>wrote:
>Hello Xinjun,
>
>Just use a String type field.
>Axis will replace the '<'s and '>'s in your XML with '&lt;'s resp.
>'&gt;'s, making it valid XML content.
>
>Regards,
>Dies
>
>
>Suavi Ali Demir wrote:
> > Why can you not embed xml inside xml?
> >   Regards,
> >   Ali
> >
> > Xinjun Chen <<m...@gmail.com> xjchen001@gmail.com> wrote:
> >     As far as I know, I cannot embed XML inside XML, so how can I pass 
> an XML document as an input parameter to a web service?
> >   Could anyone provide some pointer on that?
> >
> >   Regards,
> >   Xinjun
>
>
>
>

Re: passing XML document as input parameter

Posted by Xinjun Chen <xj...@gmail.com>.
Hi Ken,

Thank you for your info! I will also try using attachment.

Regards,
Xinjun


On 5/21/06, Ken Tam <ke...@proteustech.com> wrote:
>
>  Hi all,
>
> There are quite a few postings on this topic. Another (preferred)
> alternative is to pass XML as an attachment.
>
> Regards,
>  Ken
>
> -----Original Message-----
> *From:* Suavi Ali Demir [mailto:demir4@yahoo.com]
> *Sent:* Wednesday, May 17, 2006 10:45 AM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: passing XML document as input parameter
>
> Don't forget you might have xml as:
>
> "<formula>X &lt; Y</formula>"
>
> Now, if you process this string and make:
>
> "&lt;formula>X &lt; Y&lt;/formula>"
>
> When you reverse it, you will get:
>
> "<formula>X < Y</formula>"
>
> which is incorrect.
>
> So, you will need more escaping than just "<".
>
> Regards,
> Ali
>
> *Xinjun Chen <xj...@gmail.com>* wrote:
>
> Hi Dies,
>
> Thank you! You are right. In fact I can do that :-). Just need to replace
> all "&lt;" by "<".
>
> Regards,
> Xinjun
>
> On 5/17/06, Dies Koper <di...@jp.fujitsu.com> wrote:
> >
> > Hello Xinjun,
> >
> > Just use a String type field.
> > Axis will replace the '<'s and '>'s in your XML with '&lt;'s resp.
> > '&gt;'s, making it valid XML content.
> >
> > Regards,
> > Dies
> >
> >
> > Suavi Ali Demir wrote:
> > > Why can you not embed xml inside xml?
> > >   Regards,
> > >   Ali
> > >
> > > Xinjun Chen < xjchen001@gmail.com> wrote:
> > >     As far as I know, I cannot embed XML inside XML, so how can I pass
> > an XML document as an input parameter to a web service?
> > >   Could anyone provide some pointer on that?
> > >
> > >   Regards,
> > >   Xinjun
> >
> >
> >
>
>

RE: passing XML document as input parameter

Posted by Ken Tam <ke...@proteustech.com>.
Hi all,

There are quite a few postings on this topic. Another (preferred)
alternative is to pass XML as an attachment.

Regards,
Ken
  -----Original Message-----
  From: Suavi Ali Demir [mailto:demir4@yahoo.com]
  Sent: Wednesday, May 17, 2006 10:45 AM
  To: axis-user@ws.apache.org
  Subject: Re: passing XML document as input parameter


  Don't forget you might have xml as:

  "<formula>X &lt; Y</formula>"

  Now, if you process this string and make:

  "&lt;formula>X &lt; Y&lt;/formula>"

  When you reverse it, you will get:

  "<formula>X < Y</formula>"

  which is incorrect.

  So, you will need more escaping than just "<".

  Regards,
  Ali

  Xinjun Chen <xj...@gmail.com> wrote:
    Hi Dies,

    Thank you! You are right. In fact I can do that :-). Just need to
replace all "&lt;" by "<".

    Regards,
    Xinjun

    On 5/17/06, Dies Koper <di...@jp.fujitsu.com> wrote:
      Hello Xinjun,

      Just use a String type field.
      Axis will replace the '<'s and '>'s in your XML with '&lt;'s resp.
      '&gt;'s, making it valid XML content.

      Regards,
      Dies


      Suavi Ali Demir wrote:
      > Why can you not embed xml inside xml?
      >   Regards,
      >   Ali
      >
      > Xinjun Chen < xjchen001@gmail.com> wrote:
      >     As far as I know, I cannot embed XML inside XML, so how can I
pass an XML document as an input parameter to a web service?
      >   Could anyone provide some pointer on that?
      >
      >   Regards,
      >   Xinjun







Re: passing XML document as input parameter

Posted by Suavi Ali Demir <de...@yahoo.com>.
Don't forget you might have xml as:
   
  "<formula>X &lt; Y</formula>"
   
  Now, if you process this string and make:
   
  "&lt;formula>X &lt; Y&lt;/formula>"
   
  When you reverse it, you will get:
   
  "<formula>X < Y</formula>"
   
  which is incorrect. 
   
  So, you will need more escaping than just "<".
   
  Regards,
  Ali

Xinjun Chen <xj...@gmail.com> wrote:
    Hi Dies, 
   
  Thank you! You are right. In fact I can do that :-). Just need to replace all "&lt;" by "<".  

Regards, 
  Xinjun
   
  On 5/17/06, Dies Koper <di...@jp.fujitsu.com> wrote:   Hello Xinjun,

Just use a String type field.
Axis will replace the '<'s and '>'s in your XML with '&lt;'s resp. 
'&gt;'s, making it valid XML content.

Regards,
Dies


Suavi Ali Demir wrote:
> Why can you not embed xml inside xml?
>   Regards,
>   Ali
>
> Xinjun Chen < xjchen001@gmail.com> wrote:
>     As far as I know, I cannot embed XML inside XML, so how can I pass an XML document as an input parameter to a web service?
>   Could anyone provide some pointer on that? 
>
>   Regards,
>   Xinjun






Re: passing XML document as input parameter

Posted by Xinjun Chen <xj...@gmail.com>.
Hi Dies,

Thank you! You are right. In fact I can do that :-). Just need to replace
all "&lt;" by "<".

Regards,
Xinjun

On 5/17/06, Dies Koper <di...@jp.fujitsu.com> wrote:
>
> Hello Xinjun,
>
> Just use a String type field.
> Axis will replace the '<'s and '>'s in your XML with '&lt;'s resp.
> '&gt;'s, making it valid XML content.
>
> Regards,
> Dies
>
>
> Suavi Ali Demir wrote:
> > Why can you not embed xml inside xml?
> >   Regards,
> >   Ali
> >
> > Xinjun Chen <xj...@gmail.com> wrote:
> >     As far as I know, I cannot embed XML inside XML, so how can I pass
> an XML document as an input parameter to a web service?
> >   Could anyone provide some pointer on that?
> >
> >   Regards,
> >   Xinjun
>
>
>

Re: passing XML document as input parameter

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Xinjun,

Just use a String type field.
Axis will replace the '<'s and '>'s in your XML with '&lt;'s resp. 
'&gt;'s, making it valid XML content.

Regards,
Dies


Suavi Ali Demir wrote:
> Why can you not embed xml inside xml?
>   Regards,
>   Ali
> 
> Xinjun Chen <xj...@gmail.com> wrote:
>     As far as I know, I cannot embed XML inside XML, so how can I pass an XML document as an input parameter to a web service?
>   Could anyone provide some pointer on that? 
>    
>   Regards, 
>   Xinjun



Re: passing XML document as input parameter

Posted by Suavi Ali Demir <de...@yahoo.com>.
Why can you not embed xml inside xml?
  Regards,
  Ali

Xinjun Chen <xj...@gmail.com> wrote:
    As far as I know, I cannot embed XML inside XML, so how can I pass an XML document as an input parameter to a web service?
  Could anyone provide some pointer on that? 
   
  Regards, 
  Xinjun