Re: xml with strange characters

2005-08-31 Thread Plorks mail


hi

i'm returning the xml as a result of call.invoke.  when i write a test 
client using java the xml is well frmed, however we are also usg an 
application called laszlo, but when you get the same xml using laszlo that's 
whe it comes back with the alt for the angle brackets


would it be possible to lead me to an example of cdata and sending the xml 
as the body of the message (i think this is what i'm doing but just want to 
make sure)


thanks for your help



From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters
Date: Tue, 30 Aug 2005 17:24:35 +0100 (BST)

If I understand you correctly, you're putting data marked up as XML in a
string and then sending that string as an XML element in a SOAP message. In
this usage, Axis has to turn the angle brackets into entity references in
order to make the XML well-formed; you're not allowed to have literal angle
brackets in the value of an XML element.

If you desparately need to send your XML structure as the value of
some XML element, then you can wrap it in a CDATA section so that Axis need 
not mess
with the angle brackets. However, why not just send the XML as the body of 
the

message (normal document/literal style)?

On Tue, 30 Aug 2005, Plorks mail wrote:

 it's not - when the client receives the xml it has alt instead of  or 



 Also when i test my service  get the same characters in the soap message

 Thanks



 From: WAJSBERG Julien RD-BIZZ [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: Re: xml with strange characters
 Date: Tue, 30 Aug 2005 14:30:59 +0200
 
 Plorks mail a écrit :
 
  
   hi all
  
   i'm retruning a xml string when a method is called.
  
   When i look at the soap returned xml is formatted with lt; 
charactes

   instead of  or 
  
   e.g.
  
   lt;ROOTgt;
   
   lt;/ROOTgt;
  
   can anyone help me to solve this
  
 Why is it a problem ?
 Axis should deserialize this message correctly on the client side...
 

 _
 Want to block unwanted pop-ups? Download the free MSN Toolbar now!
 http://toolbar.msn.co.uk/


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


_
Want to block unwanted pop-ups? Download the free MSN Toolbar now!  
http://toolbar.msn.co.uk/




Re: xml with strange characters

2005-08-31 Thread Guy Rixon
CDATA like this: instead of

  String s = someXmlStructure.../someXmlStructure;

put

  String s = ![CDATA[someXmlStructure.../someXmlStructure]];

in the string that you return from your service implementation. This makes the
return message something like

soap:envelope
  soap:body
xsd:string
  ![CDATA[someXmlStructure.../someXmlStructure]]
/xsd:string
  /soap:body
/soap:envelope


See

  http://www.w3schools.com/xml/xml_cdata.asp

for more details and examples.

However, doing it that way is against the spirit of SOAP. You should really
have your someXmlStructure directly in the body of the message:

soap:envelope
  soap:body
someXmlStructure.../someXmlStructure
  /soap:body
/soap:envelope

If you mapped someXmlStructure to SomeJavaClass using WSDL2Java, then you
could return an instance of SomeJavaClass from your service implementation and
Axis would serialize it into the required XML. If you want to generate your
someXmlStructure as a DOM, then you might be able to get that serialized;
check out the SAAJ spec. (Anybody have a succint example of returning a DOM
from a service implementation?) I don't think Axis has a way to accept
serialized XML from a service implementation; i.e. you can't write out
text-with-angle-brackets and have Axis include it literally in the return
message, other than the XML-in-a-string trick that you've already found.

Cheers,
Guy



On Wed, 31 Aug 2005, Plorks mail wrote:


 hi

 i'm returning the xml as a result of call.invoke.  when i write a test
 client using java the xml is well frmed, however we are also usg an
 application called laszlo, but when you get the same xml using laszlo that's
 whe it comes back with the alt for the angle brackets

 would it be possible to lead me to an example of cdata and sending the xml
 as the body of the message (i think this is what i'm doing but just want to
 make sure)

 thanks for your help


 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: Re: xml with strange characters
 Date: Tue, 30 Aug 2005 17:24:35 +0100 (BST)
 
 If I understand you correctly, you're putting data marked up as XML in a
 string and then sending that string as an XML element in a SOAP message. In
 this usage, Axis has to turn the angle brackets into entity references in
 order to make the XML well-formed; you're not allowed to have literal angle
 brackets in the value of an XML element.
 
 If you desparately need to send your XML structure as the value of
 some XML element, then you can wrap it in a CDATA section so that Axis need
 not mess
 with the angle brackets. However, why not just send the XML as the body of
 the
 message (normal document/literal style)?
 
 On Tue, 30 Aug 2005, Plorks mail wrote:
  
   it's not - when the client receives the xml it has alt instead of  or
  
  
   Also when i test my service  get the same characters in the soap message
  
   Thanks
  
  
  
   From: WAJSBERG Julien RD-BIZZ [EMAIL PROTECTED]
   Reply-To: axis-user@ws.apache.org
   To: axis-user@ws.apache.org
   Subject: Re: xml with strange characters
   Date: Tue, 30 Aug 2005 14:30:59 +0200
   
   Plorks mail a ?crit :
   

 hi all

 i'm retruning a xml string when a method is called.

 When i look at the soap returned xml is formatted with lt;
 charactes
 instead of  or 

 e.g.

 lt;ROOTgt;
 
 lt;/ROOTgt;

 can anyone help me to solve this

   Why is it a problem ?
   Axis should deserialize this message correctly on the client side...
   
  
   _
   Want to block unwanted pop-ups? Download the free MSN Toolbar now!
   http://toolbar.msn.co.uk/
  
 
 Guy Rixon[EMAIL PROTECTED]
 Institute of Astronomy   Tel: +44-1223-337542
 Madingley Road, Cambridge, UK, CB3 0HA   Fax: +44-1223-337523

 _
 Want to block unwanted pop-ups? Download the free MSN Toolbar now!
 http://toolbar.msn.co.uk/


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


Re: xml with strange characters

2005-08-31 Thread Plorks mail



thanks -  don't know whether you have heard of it, but we are uisng a 
product called laszlo and even though the xml i return is perfect when i 
write a java client to my web service when laszlo is used it escapes the 
angle brackets - we have now found out xml isn't supported!


so now i have to re-write my ws

i have this code which returns the xml

StringWriter writer = new StringWriter();

// create a resultsetbuilder to transform resultset to XML
try
{
RecordsetToXML rsXML = new RecordsetToXML(rs, ROOT, RECORD);

// create the XML from recordset
Document jDOMDoc = rsXML.build();
rs = null;
XMLOutputter outputter = new XMLOutputter();
outputter.output(jDOMDoc, writer);
result = writer.toString();
//System.out.print(XML  + writer);
writer.close();
}

...

return result;


So do i do this -  [CDATA[writer.toString()]]


when i'm testing i do String ret - (String) call.invoke(new 
Object[]{params}); as normal




thanks for your help







From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters
Date: Wed, 31 Aug 2005 09:17:46 +0100 (BST)

CDATA like this: instead of

  String s = someXmlStructure.../someXmlStructure;

put

  String s = ![CDATA[someXmlStructure.../someXmlStructure]];

in the string that you return from your service implementation. This makes 
the

return message something like

soap:envelope
  soap:body
xsd:string
  ![CDATA[someXmlStructure.../someXmlStructure]]
/xsd:string
  /soap:body
/soap:envelope


See

  http://www.w3schools.com/xml/xml_cdata.asp

for more details and examples.

However, doing it that way is against the spirit of SOAP. You should really
have your someXmlStructure directly in the body of the message:

soap:envelope
  soap:body
someXmlStructure.../someXmlStructure
  /soap:body
/soap:envelope

If you mapped someXmlStructure to SomeJavaClass using WSDL2Java, then you
could return an instance of SomeJavaClass from your service implementation 
and

Axis would serialize it into the required XML. If you want to generate your
someXmlStructure as a DOM, then you might be able to get that serialized;
check out the SAAJ spec. (Anybody have a succint example of returning a DOM
from a service implementation?) I don't think Axis has a way to accept
serialized XML from a service implementation; i.e. you can't write out
text-with-angle-brackets and have Axis include it literally in the return
message, other than the XML-in-a-string trick that you've already found.

Cheers,
Guy



On Wed, 31 Aug 2005, Plorks mail wrote:


 hi

 i'm returning the xml as a result of call.invoke.  when i write a test
 client using java the xml is well frmed, however we are also usg an
 application called laszlo, but when you get the same xml using laszlo 
that's

 whe it comes back with the alt for the angle brackets

 would it be possible to lead me to an example of cdata and sending the 
xml
 as the body of the message (i think this is what i'm doing but just want 
to

 make sure)

 thanks for your help


 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: Re: xml with strange characters
 Date: Tue, 30 Aug 2005 17:24:35 +0100 (BST)
 
 If I understand you correctly, you're putting data marked up as XML in 
a
 string and then sending that string as an XML element in a SOAP 
message. In
 this usage, Axis has to turn the angle brackets into entity references 
in
 order to make the XML well-formed; you're not allowed to have literal 
angle

 brackets in the value of an XML element.
 
 If you desparately need to send your XML structure as the value of
 some XML element, then you can wrap it in a CDATA section so that Axis 
need

 not mess
 with the angle brackets. However, why not just send the XML as the body 
of

 the
 message (normal document/literal style)?
 
 On Tue, 30 Aug 2005, Plorks mail wrote:
  
   it's not - when the client receives the xml it has alt instead of  
or

  
  
   Also when i test my service  get the same characters in the soap 
message

  
   Thanks
  
  
  
   From: WAJSBERG Julien RD-BIZZ [EMAIL PROTECTED]
   Reply-To: axis-user@ws.apache.org
   To: axis-user@ws.apache.org
   Subject: Re: xml with strange characters
   Date: Tue, 30 Aug 2005 14:30:59 +0200
   
   Plorks mail a écrit :
   

 hi all

 i'm retruning a xml string when a method is called.

 When i look at the soap returned xml is formatted with lt;
 charactes
 instead of  or 

 e.g.

 lt;ROOTgt;
 
 lt;/ROOTgt;

 can anyone help me to solve this

   Why is it a problem ?
   Axis should deserialize this message correctly on the client 
side...

   
  
   _
   Want to block unwanted pop-ups? Download the free MSN Toolbar now!
   http://toolbar.msn.co.uk/
  
 
 Guy Rixon  [EMAIL PROTECTED

RE: xml with strange characters

2005-08-31 Thread Chris Nappin
You might be able to get away with that if you know your XML never contains 
]].

The proper way to pass XML in a web service is to use the document/literal 
style - have a look at the Axis User guide for further details.


-Original Message-
From: Plorks mail [mailto:[EMAIL PROTECTED] 
Sent: 31 August 2005 09:52
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters



thanks -  don't know whether you have heard of it, but we are uisng a 
product called laszlo and even though the xml i return is perfect when i 
write a java client to my web service when laszlo is used it escapes the 
angle brackets - we have now found out xml isn't supported!

so now i have to re-write my ws

i have this code which returns the xml

StringWriter writer = new StringWriter();

// create a resultsetbuilder to transform resultset to XML
try
{
RecordsetToXML rsXML = new RecordsetToXML(rs, ROOT, RECORD);

// create the XML from recordset
Document jDOMDoc = rsXML.build();
rs = null;
XMLOutputter outputter = new XMLOutputter();
outputter.output(jDOMDoc, writer);
result = writer.toString();
//System.out.print(XML  + writer);
writer.close();
}

...

return result;


So do i do this -  [CDATA[writer.toString()]]


when i'm testing i do String ret - (String) call.invoke(new 
Object[]{params}); as normal



thanks for your help






From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters
Date: Wed, 31 Aug 2005 09:17:46 +0100 (BST)

CDATA like this: instead of

   String s = someXmlStructure.../someXmlStructure;

put

   String s = ![CDATA[someXmlStructure.../someXmlStructure]];

in the string that you return from your service implementation. This makes 
the
return message something like

soap:envelope
   soap:body
 xsd:string
   ![CDATA[someXmlStructure.../someXmlStructure]]
 /xsd:string
   /soap:body
/soap:envelope


See

   http://www.w3schools.com/xml/xml_cdata.asp

for more details and examples.

However, doing it that way is against the spirit of SOAP. You should really
have your someXmlStructure directly in the body of the message:

soap:envelope
   soap:body
 someXmlStructure.../someXmlStructure
   /soap:body
/soap:envelope

If you mapped someXmlStructure to SomeJavaClass using WSDL2Java, then you
could return an instance of SomeJavaClass from your service implementation 
and
Axis would serialize it into the required XML. If you want to generate your
someXmlStructure as a DOM, then you might be able to get that serialized;
check out the SAAJ spec. (Anybody have a succint example of returning a DOM
from a service implementation?) I don't think Axis has a way to accept
serialized XML from a service implementation; i.e. you can't write out
text-with-angle-brackets and have Axis include it literally in the return
message, other than the XML-in-a-string trick that you've already found.

Cheers,
Guy



On Wed, 31 Aug 2005, Plorks mail wrote:

 
  hi
 
  i'm returning the xml as a result of call.invoke.  when i write a test
  client using java the xml is well frmed, however we are also usg an
  application called laszlo, but when you get the same xml using laszlo 
that's
  whe it comes back with the alt for the angle brackets
 
  would it be possible to lead me to an example of cdata and sending the 
xml
  as the body of the message (i think this is what i'm doing but just want 
to
  make sure)
 
  thanks for your help
 
 
  From: Guy Rixon [EMAIL PROTECTED]
  Reply-To: axis-user@ws.apache.org
  To: axis-user@ws.apache.org
  Subject: Re: xml with strange characters
  Date: Tue, 30 Aug 2005 17:24:35 +0100 (BST)
  
  If I understand you correctly, you're putting data marked up as XML in 
a
  string and then sending that string as an XML element in a SOAP 
message. In
  this usage, Axis has to turn the angle brackets into entity references 
in
  order to make the XML well-formed; you're not allowed to have literal 
angle
  brackets in the value of an XML element.
  
  If you desparately need to send your XML structure as the value of
  some XML element, then you can wrap it in a CDATA section so that Axis 
need
  not mess
  with the angle brackets. However, why not just send the XML as the body 
of
  the
  message (normal document/literal style)?
  
  On Tue, 30 Aug 2005, Plorks mail wrote:
   
it's not - when the client receives the xml it has alt instead of  
or
   
   
Also when i test my service  get the same characters in the soap 
message
   
Thanks
   
   
   
From: WAJSBERG Julien RD-BIZZ [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters
Date: Tue, 30 Aug 2005 14:30:59 +0200

Plorks mail a écrit :

 
  hi all
 
  i'm retruning a xml string when a method is called.
 
  When i look at the soap returned xml is formatted with lt;
  charactes
  instead

RE: xml with strange characters

2005-08-31 Thread Plorks mail


I use document/literal sytle


looking at the soap using tcpmon it looks like this


?xml version=1.0 encoding=UTF-8?
soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

soapenv:Body
 getListResponse xmlns=
  getListReturnlt;![CDATA[lt;?xml version=quot;1.0quot; 
encoding=quot;UTF-8quot;?gt;#xd;

lt;ROOTgt;lt;RECORDgt;lt;idgt;1lt;/idgt;lt;idgt;1lt;/idgt;lt;contactidgt;20lt;/contactididgt;1lt;/idgt;lt;contactidgt;29lt;/contactidgt;lt;emailcountgt;2lt;/emailcountgt;lt;emailaddressgt;[EMAIL
 PROTECTED]lt;/emailaddressgt;lt;/RECORDgt;lt;/ROOTgt;#xd;
]]gt;/getListReturn
 /getListResponse
/soapenv:Body
/soapenv:Envelope


but when i retutn the result using call.invoke the xml is well formed







From: Chris Nappin [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters
Date: Wed, 31 Aug 2005 09:57:17 +0100

You might be able to get away with that if you know your XML never contains 
]].


The proper way to pass XML in a web service is to use the 
document/literal style - have a look at the Axis User guide for further 
details.



-Original Message-
From: Plorks mail [mailto:[EMAIL PROTECTED]
Sent: 31 August 2005 09:52
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters



thanks -  don't know whether you have heard of it, but we are uisng a
product called laszlo and even though the xml i return is perfect when i
write a java client to my web service when laszlo is used it escapes the
angle brackets - we have now found out xml isn't supported!

so now i have to re-write my ws

i have this code which returns the xml

StringWriter writer = new StringWriter();

// create a resultsetbuilder to transform resultset to XML
try
{
RecordsetToXML rsXML = new RecordsetToXML(rs, ROOT, RECORD);

// create the XML from recordset
Document jDOMDoc = rsXML.build();
rs = null;
XMLOutputter outputter = new XMLOutputter();
outputter.output(jDOMDoc, writer);
result = writer.toString();
//System.out.print(XML  + writer);
writer.close();
}

...

return result;


So do i do this -  [CDATA[writer.toString()]]


when i'm testing i do String ret - (String) call.invoke(new
Object[]{params}); as normal



thanks for your help






From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters
Date: Wed, 31 Aug 2005 09:17:46 +0100 (BST)

CDATA like this: instead of

   String s = someXmlStructure.../someXmlStructure;

put

   String s = ![CDATA[someXmlStructure.../someXmlStructure]];

in the string that you return from your service implementation. This 
makes

the
return message something like

soap:envelope
   soap:body
 xsd:string
   ![CDATA[someXmlStructure.../someXmlStructure]]
 /xsd:string
   /soap:body
/soap:envelope


See

   http://www.w3schools.com/xml/xml_cdata.asp

for more details and examples.

However, doing it that way is against the spirit of SOAP. You should 
really

have your someXmlStructure directly in the body of the message:

soap:envelope
   soap:body
 someXmlStructure.../someXmlStructure
   /soap:body
/soap:envelope

If you mapped someXmlStructure to SomeJavaClass using WSDL2Java, then you
could return an instance of SomeJavaClass from your service 
implementation

and
Axis would serialize it into the required XML. If you want to generate 
your

someXmlStructure as a DOM, then you might be able to get that serialized;
check out the SAAJ spec. (Anybody have a succint example of returning a 
DOM

from a service implementation?) I don't think Axis has a way to accept
serialized XML from a service implementation; i.e. you can't write out
text-with-angle-brackets and have Axis include it literally in the return
message, other than the XML-in-a-string trick that you've already found.

Cheers,
Guy



On Wed, 31 Aug 2005, Plorks mail wrote:

 
  hi
 
  i'm returning the xml as a result of call.invoke.  when i write a test
  client using java the xml is well frmed, however we are also usg an
  application called laszlo, but when you get the same xml using laszlo
that's
  whe it comes back with the alt for the angle brackets
 
  would it be possible to lead me to an example of cdata and sending the
xml
  as the body of the message (i think this is what i'm doing but just 
want

to
  make sure)
 
  thanks for your help
 
 
  From: Guy Rixon [EMAIL PROTECTED]
  Reply-To: axis-user@ws.apache.org
  To: axis-user@ws.apache.org
  Subject: Re: xml with strange characters
  Date: Tue, 30 Aug 2005 17:24:35 +0100 (BST)
  
  If I understand you correctly, you're putting data marked up as XML 
in

a
  string and then sending that string as an XML element in a SOAP
message. In
  this usage, Axis has to turn the angle brackets into entity 
references

in
  order to make the XML well-formed; you're not allowed to have literal
angle

Re: xml with strange characters

2005-08-31 Thread Michael
you need to manually build up your SOAPEnvelope and pass that to
call.invoke instead of passing your XML as a string

On 31/08/05, Plorks mail [EMAIL PROTECTED] wrote:
 
 I use document/literal sytle
 
 
 looking at the soap using tcpmon it looks like this
 
 
 ?xml version=1.0 encoding=UTF-8?
 soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
 xmlns:xsd=http://www.w3.org/2001/XMLSchema;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 soapenv:Body
   getListResponse xmlns=
getListReturn![CDATA[?xml version=1.0
 encoding=UTF-8?
 ROOTRECORDid1/idid1/idcontactid20/contactidid1/idcontactid29/contactidemailcount2/emailcountemailaddress[EMAIL
  PROTECTED]/emailaddress/RECORD/ROOT
 ]]/getListReturn
   /getListResponse
 /soapenv:Body
 /soapenv:Envelope
 
 
 but when i retutn the result using call.invoke the xml is well formed
 
 
 
 
 
 
 From: Chris Nappin [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: RE: xml with strange characters
 Date: Wed, 31 Aug 2005 09:57:17 +0100
 
 You might be able to get away with that if you know your XML never contains
 ]].
 
 The proper way to pass XML in a web service is to use the
 document/literal style - have a look at the Axis User guide for further
 details.
 
 
 -Original Message-
 From: Plorks mail [mailto:[EMAIL PROTECTED]
 Sent: 31 August 2005 09:52
 To: axis-user@ws.apache.org
 Subject: Re: xml with strange characters
 
 
 
 thanks -  don't know whether you have heard of it, but we are uisng a
 product called laszlo and even though the xml i return is perfect when i
 write a java client to my web service when laszlo is used it escapes the
 angle brackets - we have now found out xml isn't supported!
 
 so now i have to re-write my ws
 
 i have this code which returns the xml
 
 StringWriter writer = new StringWriter();
 
 // create a resultsetbuilder to transform resultset to XML
 try
 {
 RecordsetToXML rsXML = new RecordsetToXML(rs, ROOT, RECORD);
 
 // create the XML from recordset
 Document jDOMDoc = rsXML.build();
 rs = null;
 XMLOutputter outputter = new XMLOutputter();
 outputter.output(jDOMDoc, writer);
 result = writer.toString();
 //System.out.print(XML  + writer);
 writer.close();
 }
 
 ...
 
 return result;
 
 
 So do i do this -  [CDATA[writer.toString()]]
 
 
 when i'm testing i do String ret - (String) call.invoke(new
 Object[]{params}); as normal
 
 
 
 thanks for your help
 
 
 
 
 
 
  From: Guy Rixon [EMAIL PROTECTED]
  Reply-To: axis-user@ws.apache.org
  To: axis-user@ws.apache.org
  Subject: Re: xml with strange characters
  Date: Wed, 31 Aug 2005 09:17:46 +0100 (BST)
  
  CDATA like this: instead of
  
 String s = someXmlStructure.../someXmlStructure;
  
  put
  
 String s = ![CDATA[someXmlStructure.../someXmlStructure]];
  
  in the string that you return from your service implementation. This
 makes
  the
  return message something like
  
  soap:envelope
 soap:body
   xsd:string
 ![CDATA[someXmlStructure.../someXmlStructure]]
   /xsd:string
 /soap:body
  /soap:envelope
  
  
  See
  
 http://www.w3schools.com/xml/xml_cdata.asp
  
  for more details and examples.
  
  However, doing it that way is against the spirit of SOAP. You should
 really
  have your someXmlStructure directly in the body of the message:
  
  soap:envelope
 soap:body
   someXmlStructure.../someXmlStructure
 /soap:body
  /soap:envelope
  
  If you mapped someXmlStructure to SomeJavaClass using WSDL2Java, then you
  could return an instance of SomeJavaClass from your service
 implementation
  and
  Axis would serialize it into the required XML. If you want to generate
 your
  someXmlStructure as a DOM, then you might be able to get that serialized;
  check out the SAAJ spec. (Anybody have a succint example of returning a
 DOM
  from a service implementation?) I don't think Axis has a way to accept
  serialized XML from a service implementation; i.e. you can't write out
  text-with-angle-brackets and have Axis include it literally in the return
  message, other than the XML-in-a-string trick that you've already found.
  
  Cheers,
  Guy
  
  
  
  On Wed, 31 Aug 2005, Plorks mail wrote:
  
   
hi
   
i'm returning the xml as a result of call.invoke.  when i write a test
client using java the xml is well frmed, however we are also usg an
application called laszlo, but when you get the same xml using laszlo
  that's
whe it comes back with the alt for the angle brackets
   
would it be possible to lead me to an example of cdata and sending the
  xml
as the body of the message (i think this is what i'm doing but just
 want
  to
make sure)
   
thanks for your help
   
   
From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters
Date: Tue, 30 Aug 2005 17:24:35 +0100 (BST)

If I understand you correctly

Re: xml with strange characters

2005-08-31 Thread Guy Rixon
On Wed, 31 Aug 2005, Plorks mail wrote:

 So do i do this -  [CDATA[writer.toString()]]

  result = ![CDATA[ + writer.toString() + ]];

would be the correct Java form. CDATA is an XML construct, not a Java
construct.

Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


RE: xml with strange characters

2005-08-31 Thread Chris Nappin
Looks like you're using a mixture of RPC and doc/literal? You might have a very 
good reason for doing this, but normal doc/literal should look more like this 
(with your data as a nested XML document, rather than a String RPC argument):

?xml version=1.0 encoding=UTF-8?
soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
soapenv:Body
  getListResponse xmlns=
   getListReturn
   ROOT
   RECORD
   id1/idid1/id
   ..etc.. 
/RECORD
/ROOT
/getListReturn
  /getListResponse
/soapenv:Body
/soapenv:Envelope

This can be done by creating a web service that has a getListResponse bean 
object (I recommend writing your WSDL first and getting Axis to generate the 
beans for you), or by using the Axis message style which gives you access to 
the raw XML (see user guide for more details).

Note that your encoded document goes a bit wrong around the first closing 
contacted tag:

lt;contactidgt;20lt;/contactididgt;1lt;/idgt;

is

contacted20/contactidid1/id

which isn't valid XML and may have been caused by repeatedly encoding the 
String parameter?

-Original Message-
From: Plorks mail [mailto:[EMAIL PROTECTED] 
Sent: 31 August 2005 10:05
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters


I use document/literal sytle


looking at the soap using tcpmon it looks like this


?xml version=1.0 encoding=UTF-8?
soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
soapenv:Body
  getListResponse xmlns=
   getListReturnlt;![CDATA[lt;?xml version=quot;1.0quot; 
encoding=quot;UTF-8quot;?gt;#xd;
lt;ROOTgt;lt;RECORDgt;lt;idgt;1lt;/idgt;lt;idgt;1lt;/idgt;lt;contactidgt;20lt;/contactididgt;1lt;/idgt;lt;contactidgt;29lt;/contactidgt;lt;emailcountgt;2lt;/emailcountgt;lt;emailaddressgt;[EMAIL
 PROTECTED]lt;/emailaddressgt;lt;/RECORDgt;lt;/ROOTgt;#xd;
]]gt;/getListReturn
  /getListResponse
/soapenv:Body
/soapenv:Envelope


but when i retutn the result using call.invoke the xml is well formed






From: Chris Nappin [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters
Date: Wed, 31 Aug 2005 09:57:17 +0100

You might be able to get away with that if you know your XML never contains 
]].

The proper way to pass XML in a web service is to use the 
document/literal style - have a look at the Axis User guide for further 
details.


-Original Message-
From: Plorks mail [mailto:[EMAIL PROTECTED]
Sent: 31 August 2005 09:52
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters



thanks -  don't know whether you have heard of it, but we are uisng a
product called laszlo and even though the xml i return is perfect when i
write a java client to my web service when laszlo is used it escapes the
angle brackets - we have now found out xml isn't supported!

so now i have to re-write my ws

i have this code which returns the xml

StringWriter writer = new StringWriter();

// create a resultsetbuilder to transform resultset to XML
try
{
RecordsetToXML rsXML = new RecordsetToXML(rs, ROOT, RECORD);

// create the XML from recordset
Document jDOMDoc = rsXML.build();
rs = null;
XMLOutputter outputter = new XMLOutputter();
outputter.output(jDOMDoc, writer);
result = writer.toString();
//System.out.print(XML  + writer);
writer.close();
}

...

return result;


So do i do this -  [CDATA[writer.toString()]]


when i'm testing i do String ret - (String) call.invoke(new
Object[]{params}); as normal



thanks for your help






 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: Re: xml with strange characters
 Date: Wed, 31 Aug 2005 09:17:46 +0100 (BST)
 
 CDATA like this: instead of
 
String s = someXmlStructure.../someXmlStructure;
 
 put
 
String s = ![CDATA[someXmlStructure.../someXmlStructure]];
 
 in the string that you return from your service implementation. This 
makes
 the
 return message something like
 
 soap:envelope
soap:body
  xsd:string
![CDATA[someXmlStructure.../someXmlStructure]]
  /xsd:string
/soap:body
 /soap:envelope
 
 
 See
 
http://www.w3schools.com/xml/xml_cdata.asp
 
 for more details and examples.
 
 However, doing it that way is against the spirit of SOAP. You should 
really
 have your someXmlStructure directly in the body of the message:
 
 soap:envelope
soap:body
  someXmlStructure.../someXmlStructure
/soap:body
 /soap:envelope
 
 If you mapped someXmlStructure to SomeJavaClass using WSDL2Java, then you
 could return an instance of SomeJavaClass from your service 
implementation
 and
 Axis would serialize it into the required XML. If you want to generate 
your
 someXmlStructure as a DOM, then you might be able

RE: xml with strange characters

2005-08-31 Thread Plorks mail



so how can i redeig myservce to work correctly with doc/lit and axis





From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters
Date: Wed, 31 Aug 2005 10:34:38 +0100 (BST)

On Wed, 31 Aug 2005, Plorks mail wrote:


 I use document/literal sytle

You MIS-use it. In fact, you mis-use Axis in a way that causes Axis to 
mis-use
the document/literal form. You need to get round this idea of returning XML 
in

a string from your service implementation. That can be kludged to work but
it's never going to be in the spirit of document/literal SOAP. Just 
declaring
document/literal in your WSDL doesn't help if your service implementation 
is

mal-designed.


_
Use MSN Messenger to send music and pics to your friends 
http://messenger.msn.co.uk




RE: xml with strange characters

2005-08-31 Thread Chris Nappin
I've never used the web service generation tools in Eclipse but I can
imagine if you start with a class that has a method that takes a String
parameter, Eclipse isn't going to know that that String is really XML.

I'd recommend you start designing your service from WSDL, then get Axis
to auto-generate the code stubs. For the WSDL, start by creating a
schema for your XML document - www.w3schools.com have some good
tutorials to start with.

IBM have some very good tutorials on web services and Java, see
http://www-130.ibm.com/developerworks/java.  

Hope that helps,

  Chris.

-Original Message-
From: Plorks mail [mailto:[EMAIL PROTECTED] 
Sent: 31 August 2005 11:20
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters



so how can i redeig myservce to work correctly with doc/lit and axis




From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters
Date: Wed, 31 Aug 2005 10:34:38 +0100 (BST)

On Wed, 31 Aug 2005, Plorks mail wrote:

 
  I use document/literal sytle

You MIS-use it. In fact, you mis-use Axis in a way that causes Axis to 
mis-use
the document/literal form. You need to get round this idea of returning
XML 
in
a string from your service implementation. That can be kludged to work
but
it's never going to be in the spirit of document/literal SOAP. Just 
declaring
document/literal in your WSDL doesn't help if your service
implementation 
is
mal-designed.

_
Use MSN Messenger to send music and pics to your friends 
http://messenger.msn.co.uk



 
CONFIDENTIALITY  PRIVILEGE NOTICE

This e-mail is confidential to its intended recipient. It may also be 
privileged. Neither the confidentiality nor any privilege attaching to this 
e-mail is waived lost or destroyed by reason that it has been mistakenly 
transmitted to a person or entity other than its intended recipient. If you are 
not the intended recipient please notify us immediately by telephone or fax at 
the numbers provided above or e-mail by Reply To Author and return the printed 
e-mail to us by post at our expense. We believe, but do not warrant, that this 
e-mail and any attachments are virus-free, but you should check. We may monitor 
traffic data of both business and personal e-mails. We are not liable for any 
opinions expressed by the sender where this is a non-business e-mail. If you do 
not receive all the message, or if you have difficulty with the transmission, 
please telephone us immediately.


RE: xml with strange characters

2005-08-31 Thread Guy Rixon
You could RTFM for a start :) Axis isn't really at the level of sophistication
where you can use it without understanding how SOAP is supposed to work. I
know, I've tried to use it as a black box and failed.  So you need to google
for a tutorial on the different arrangements of SOAP messages. Hints from this
list may be more useful to you once you understand the background.

I don't know how Eclipse uses Axis, but in general you'd need to proceed as
follow.

1. Write the WSDL contract for the service. Use an XML editor, or a text
editor if that's all you've got. Make it doc/literal.

2. Run WSDL2Java on the WSDL contract; Eclipse may be able to do this for you.
This generates Java beans that match the XML structures in your contract and
Axis stubs that know how to use those beans.

3. Among the generated classes will be a service-definition interface: a Java
interface that must be implemented in both your client and your service.
Methods of the interface take and return the generated Java beans. The
client-side stubs generated in the previous step already implement this
interface. You need to provide a class that implements this interface in the
service.




On Wed, 31 Aug 2005, Plorks mail wrote:



 so how can i redeig myservce to work correctly with doc/lit and axis




 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: RE: xml with strange characters
 Date: Wed, 31 Aug 2005 10:34:38 +0100 (BST)
 
 On Wed, 31 Aug 2005, Plorks mail wrote:
 
  
   I use document/literal sytle
 
 You MIS-use it. In fact, you mis-use Axis in a way that causes Axis to
 mis-use
 the document/literal form. You need to get round this idea of returning XML
 in
 a string from your service implementation. That can be kludged to work but
 it's never going to be in the spirit of document/literal SOAP. Just
 declaring
 document/literal in your WSDL doesn't help if your service implementation
 is
 mal-designed.

 _
 Use MSN Messenger to send music and pics to your friends
 http://messenger.msn.co.uk


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


RE: xml with strange characters

2005-08-31 Thread Plorks mail




Ok i've written my java which connects to a db and does loads of sql queries 
and gets back data then i've done a wsdl on that java class


if i do it the other way round i write a manual wsdl file and do wsdl2java 
and create the stubs.  where does the code go that connects to a db, does 
the sql queries etc...


thanks


PS. I have read the manual - it's not that great for exaling stuff when 
you've never done it before, it assumes you already have some knowledge








From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters
Date: Wed, 31 Aug 2005 11:48:22 +0100 (BST)

You could RTFM for a start :) Axis isn't really at the level of 
sophistication

where you can use it without understanding how SOAP is supposed to work. I
know, I've tried to use it as a black box and failed.  So you need to 
google
for a tutorial on the different arrangements of SOAP messages. Hints from 
this

list may be more useful to you once you understand the background.

I don't know how Eclipse uses Axis, but in general you'd need to proceed as
follow.

1. Write the WSDL contract for the service. Use an XML editor, or a text
editor if that's all you've got. Make it doc/literal.

2. Run WSDL2Java on the WSDL contract; Eclipse may be able to do this for 
you.
This generates Java beans that match the XML structures in your contract 
and

Axis stubs that know how to use those beans.

3. Among the generated classes will be a service-definition interface: a 
Java

interface that must be implemented in both your client and your service.
Methods of the interface take and return the generated Java beans. The
client-side stubs generated in the previous step already implement this
interface. You need to provide a class that implements this interface in 
the

service.




On Wed, 31 Aug 2005, Plorks mail wrote:



 so how can i redeig myservce to work correctly with doc/lit and axis




 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: RE: xml with strange characters
 Date: Wed, 31 Aug 2005 10:34:38 +0100 (BST)
 
 On Wed, 31 Aug 2005, Plorks mail wrote:
 
  
   I use document/literal sytle
 
 You MIS-use it. In fact, you mis-use Axis in a way that causes Axis to
 mis-use
 the document/literal form. You need to get round this idea of returning 
XML

 in
 a string from your service implementation. That can be kludged to work 
but

 it's never going to be in the spirit of document/literal SOAP. Just
 declaring
 document/literal in your WSDL doesn't help if your service 
implementation

 is
 mal-designed.

 _
 Use MSN Messenger to send music and pics to your friends
 http://messenger.msn.co.uk


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


_
Use MSN Messenger to send music and pics to your friends 
http://messenger.msn.co.uk




Re: xml with strange characters

2005-08-31 Thread Plorks mail

thanks



From: Michael [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters
Date: Wed, 31 Aug 2005 12:20:32 +0100

it goes into your service implementation i.e. the class you specify
for the className paramenter in the service wsdd

On 31/08/05, Plorks mail [EMAIL PROTECTED] wrote:



 Ok i've written my java which connects to a db and does loads of sql 
queries

 and gets back data then i've done a wsdl on that java class

 if i do it the other way round i write a manual wsdl file and do 
wsdl2java
 and create the stubs.  where does the code go that connects to a db, 
does

 the sql queries etc...

 thanks


 PS. I have read the manual - it's not that great for exaling stuff when
 you've never done it before, it assumes you already have some knowledge






 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: RE: xml with strange characters
 Date: Wed, 31 Aug 2005 11:48:22 +0100 (BST)
 
 You could RTFM for a start :) Axis isn't really at the level of
 sophistication
 where you can use it without understanding how SOAP is supposed to 
work. I

 know, I've tried to use it as a black box and failed.  So you need to
 google
 for a tutorial on the different arrangements of SOAP messages. Hints 
from

 this
 list may be more useful to you once you understand the background.
 
 I don't know how Eclipse uses Axis, but in general you'd need to 
proceed as

 follow.
 
 1. Write the WSDL contract for the service. Use an XML editor, or a 
text

 editor if that's all you've got. Make it doc/literal.
 
 2. Run WSDL2Java on the WSDL contract; Eclipse may be able to do this 
for

 you.
 This generates Java beans that match the XML structures in your 
contract

 and
 Axis stubs that know how to use those beans.
 
 3. Among the generated classes will be a service-definition interface: 
a

 Java
 interface that must be implemented in both your client and your 
service.

 Methods of the interface take and return the generated Java beans. The
 client-side stubs generated in the previous step already implement this
 interface. You need to provide a class that implements this interface 
in

 the
 service.
 
 
 
 
 On Wed, 31 Aug 2005, Plorks mail wrote:
 
  
  
   so how can i redeig myservce to work correctly with doc/lit and axis
  
  
  
  
   From: Guy Rixon [EMAIL PROTECTED]
   Reply-To: axis-user@ws.apache.org
   To: axis-user@ws.apache.org
   Subject: RE: xml with strange characters
   Date: Wed, 31 Aug 2005 10:34:38 +0100 (BST)
   
   On Wed, 31 Aug 2005, Plorks mail wrote:
   

 I use document/literal sytle
   
   You MIS-use it. In fact, you mis-use Axis in a way that causes Axis 
to

   mis-use
   the document/literal form. You need to get round this idea of 
returning

 XML
   in
   a string from your service implementation. That can be kludged to 
work

 but
   it's never going to be in the spirit of document/literal SOAP. Just
   declaring
   document/literal in your WSDL doesn't help if your service
 implementation
   is
   mal-designed.
  
   _
   Use MSN Messenger to send music and pics to your friends
   http://messenger.msn.co.uk
  
 
 Guy Rixon  [EMAIL PROTECTED]
 Institute of Astronomy Tel: +44-1223-337542
 Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523

 _
 Use MSN Messenger to send music and pics to your friends
 http://messenger.msn.co.uk




_
Be the first to hear what's new at MSN - sign up to our free newsletters! 
http://www.msn.co.uk/newsletters




RE: xml with strange characters

2005-08-31 Thread Plorks mail




can someone please lead me to an example/tutorial of how i create a manual 
wsdl file that uses doc/lit and has results returned such as 
xml/strind/arrays


also could someone lead me to a gd example/tutorial of how to create complex 
types and where/how to use them


Many thanks








From: Plorks mail [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters
Date: Wed, 31 Aug 2005 11:13:52 +




Ok i've written my java which connects to a db and does loads of sql 
queries and gets back data then i've done a wsdl on that java class


if i do it the other way round i write a manual wsdl file and do wsdl2java 
and create the stubs.  where does the code go that connects to a db, does 
the sql queries etc...


thanks


PS. I have read the manual - it's not that great for exaling stuff when 
you've never done it before, it assumes you already have some knowledge








From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters
Date: Wed, 31 Aug 2005 11:48:22 +0100 (BST)

You could RTFM for a start :) Axis isn't really at the level of 
sophistication

where you can use it without understanding how SOAP is supposed to work. I
know, I've tried to use it as a black box and failed.  So you need to 
google
for a tutorial on the different arrangements of SOAP messages. Hints from 
this

list may be more useful to you once you understand the background.

I don't know how Eclipse uses Axis, but in general you'd need to proceed 
as

follow.

1. Write the WSDL contract for the service. Use an XML editor, or a text
editor if that's all you've got. Make it doc/literal.

2. Run WSDL2Java on the WSDL contract; Eclipse may be able to do this for 
you.
This generates Java beans that match the XML structures in your contract 
and

Axis stubs that know how to use those beans.

3. Among the generated classes will be a service-definition interface: a 
Java

interface that must be implemented in both your client and your service.
Methods of the interface take and return the generated Java beans. The
client-side stubs generated in the previous step already implement this
interface. You need to provide a class that implements this interface in 
the

service.




On Wed, 31 Aug 2005, Plorks mail wrote:



 so how can i redeig myservce to work correctly with doc/lit and axis




 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: RE: xml with strange characters
 Date: Wed, 31 Aug 2005 10:34:38 +0100 (BST)
 
 On Wed, 31 Aug 2005, Plorks mail wrote:
 
  
   I use document/literal sytle
 
 You MIS-use it. In fact, you mis-use Axis in a way that causes Axis to
 mis-use
 the document/literal form. You need to get round this idea of 
returning XML

 in
 a string from your service implementation. That can be kludged to work 
but

 it's never going to be in the spirit of document/literal SOAP. Just
 declaring
 document/literal in your WSDL doesn't help if your service 
implementation

 is
 mal-designed.

 _
 Use MSN Messenger to send music and pics to your friends
 http://messenger.msn.co.uk


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


_
Use MSN Messenger to send music and pics to your friends 
http://messenger.msn.co.uk




_
Winks  nudges are here - download MSN Messenger 7.0 today! 
http://messenger.msn.co.uk




RE: xml with strange characters

2005-08-31 Thread Guy Rixon
 Ok i've written my java which connects to a db and does loads of sql queries
 and gets back data then i've done a wsdl on that java class
 if i do it the other way round i write a manual wsdl file and do wsdl2java
 and create the stubs.  where does the code go that connects to a db, does
 the sql queries etc...

When you run WSDL2Java, it creates a service-definition interface, as
described in my previous mail. You write a class implementing that interface:
call it the service-implementation class. From the service-implementation
class, you call any Java facilities you like. Your calls to work the DB etc.
go in the service-definition class or in classes that are called from the
service-definition class.

 PS. I have read the manual - it's not that great for exaling stuff when
 you've never done it before, it assumes you already have some knowledge

That's my point. You need to get out on the web and study SOAP and WSDL before
you can understand Axis.

You might find it helpful to build a service without using Eclipse, just as a
learning exercise. That way, none of the construction steps are concealed.





 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: RE: xml with strange characters
 Date: Wed, 31 Aug 2005 11:48:22 +0100 (BST)
 
 You could RTFM for a start :) Axis isn't really at the level of
 sophistication
 where you can use it without understanding how SOAP is supposed to work. I
 know, I've tried to use it as a black box and failed.  So you need to
 google
 for a tutorial on the different arrangements of SOAP messages. Hints from
 this
 list may be more useful to you once you understand the background.
 
 I don't know how Eclipse uses Axis, but in general you'd need to proceed as
 follow.
 
 1. Write the WSDL contract for the service. Use an XML editor, or a text
 editor if that's all you've got. Make it doc/literal.
 
 2. Run WSDL2Java on the WSDL contract; Eclipse may be able to do this for
 you.
 This generates Java beans that match the XML structures in your contract
 and
 Axis stubs that know how to use those beans.
 
 3. Among the generated classes will be a service-definition interface: a
 Java
 interface that must be implemented in both your client and your service.
 Methods of the interface take and return the generated Java beans. The
 client-side stubs generated in the previous step already implement this
 interface. You need to provide a class that implements this interface in
 the
 service.
 
 
 
 
 On Wed, 31 Aug 2005, Plorks mail wrote:
 
  
  
   so how can i redeig myservce to work correctly with doc/lit and axis
  
  
  
  
   From: Guy Rixon [EMAIL PROTECTED]
   Reply-To: axis-user@ws.apache.org
   To: axis-user@ws.apache.org
   Subject: RE: xml with strange characters
   Date: Wed, 31 Aug 2005 10:34:38 +0100 (BST)
   
   On Wed, 31 Aug 2005, Plorks mail wrote:
   

 I use document/literal sytle
   
   You MIS-use it. In fact, you mis-use Axis in a way that causes Axis to
   mis-use
   the document/literal form. You need to get round this idea of returning
 XML
   in
   a string from your service implementation. That can be kludged to work
 but
   it's never going to be in the spirit of document/literal SOAP. Just
   declaring
   document/literal in your WSDL doesn't help if your service
 implementation
   is
   mal-designed.
  
   _
   Use MSN Messenger to send music and pics to your friends
   http://messenger.msn.co.uk
  
 
 Guy Rixon[EMAIL PROTECTED]
 Institute of Astronomy   Tel: +44-1223-337542
 Madingley Road, Cambridge, UK, CB3 0HA   Fax: +44-1223-337523

 _
 Use MSN Messenger to send music and pics to your friends
 http://messenger.msn.co.uk


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


RE: xml with strange characters

2005-08-31 Thread Plorks mail



OK thanks

It's quite difficult to learn when you managers want stuff done yesterday - 
i'm still on that steep learning curve


do you have a good example of building a webserice without using any tools?

i've googled, but sa lot of example i found are out of date

many thanks




From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: RE: xml with strange characters
Date: Wed, 31 Aug 2005 12:42:23 +0100 (BST)

 Ok i've written my java which connects to a db and does loads of sql 
queries

 and gets back data then i've done a wsdl on that java class
 if i do it the other way round i write a manual wsdl file and do 
wsdl2java
 and create the stubs.  where does the code go that connects to a db, 
does

 the sql queries etc...

When you run WSDL2Java, it creates a service-definition interface, as
described in my previous mail. You write a class implementing that 
interface:

call it the service-implementation class. From the service-implementation
class, you call any Java facilities you like. Your calls to work the DB 
etc.

go in the service-definition class or in classes that are called from the
service-definition class.

 PS. I have read the manual - it's not that great for exaling stuff when
 you've never done it before, it assumes you already have some knowledge

That's my point. You need to get out on the web and study SOAP and WSDL 
before

you can understand Axis.

You might find it helpful to build a service without using Eclipse, just as 
a

learning exercise. That way, none of the construction steps are concealed.





 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: RE: xml with strange characters
 Date: Wed, 31 Aug 2005 11:48:22 +0100 (BST)
 
 You could RTFM for a start :) Axis isn't really at the level of
 sophistication
 where you can use it without understanding how SOAP is supposed to 
work. I

 know, I've tried to use it as a black box and failed.  So you need to
 google
 for a tutorial on the different arrangements of SOAP messages. Hints 
from

 this
 list may be more useful to you once you understand the background.
 
 I don't know how Eclipse uses Axis, but in general you'd need to 
proceed as

 follow.
 
 1. Write the WSDL contract for the service. Use an XML editor, or a 
text

 editor if that's all you've got. Make it doc/literal.
 
 2. Run WSDL2Java on the WSDL contract; Eclipse may be able to do this 
for

 you.
 This generates Java beans that match the XML structures in your 
contract

 and
 Axis stubs that know how to use those beans.
 
 3. Among the generated classes will be a service-definition interface: 
a

 Java
 interface that must be implemented in both your client and your 
service.

 Methods of the interface take and return the generated Java beans. The
 client-side stubs generated in the previous step already implement this
 interface. You need to provide a class that implements this interface 
in

 the
 service.
 
 
 
 
 On Wed, 31 Aug 2005, Plorks mail wrote:
 
  
  
   so how can i redeig myservce to work correctly with doc/lit and axis
  
  
  
  
   From: Guy Rixon [EMAIL PROTECTED]
   Reply-To: axis-user@ws.apache.org
   To: axis-user@ws.apache.org
   Subject: RE: xml with strange characters
   Date: Wed, 31 Aug 2005 10:34:38 +0100 (BST)
   
   On Wed, 31 Aug 2005, Plorks mail wrote:
   

 I use document/literal sytle
   
   You MIS-use it. In fact, you mis-use Axis in a way that causes Axis 
to

   mis-use
   the document/literal form. You need to get round this idea of 
returning

 XML
   in
   a string from your service implementation. That can be kludged to 
work

 but
   it's never going to be in the spirit of document/literal SOAP. Just
   declaring
   document/literal in your WSDL doesn't help if your service
 implementation
   is
   mal-designed.
  
   _
   Use MSN Messenger to send music and pics to your friends
   http://messenger.msn.co.uk
  
 
 Guy Rixon  [EMAIL PROTECTED]
 Institute of Astronomy Tel: +44-1223-337542
 Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523

 _
 Use MSN Messenger to send music and pics to your friends
 http://messenger.msn.co.uk


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


_
Winks  nudges are here - download MSN Messenger 7.0 today! 
http://messenger.msn.co.uk




xml with strange characters

2005-08-30 Thread Plorks mail


hi all

i'm retruning a xml string when a method is called.

When i look at the soap returned xml is formatted with lt; charactes 
instead of  or 


e.g.

lt;ROOTgt;

lt;/ROOTgt;

can anyone help me to solve this

_
It's fast, it's easy and it's free. Get MSN Messenger 7.0 today! 
http://messenger.msn.co.uk




Re: xml with strange characters

2005-08-30 Thread WAJSBERG Julien RD-BIZZ
Plorks mail a écrit :


 hi all

 i'm retruning a xml string when a method is called.

 When i look at the soap returned xml is formatted with lt; charactes
 instead of  or 

 e.g.

 lt;ROOTgt;
 
 lt;/ROOTgt;

 can anyone help me to solve this

Why is it a problem ?
Axis should deserialize this message correctly on the client side...



Re: xml with strange characters

2005-08-30 Thread Plorks mail



it's not - when the client receives the xml it has alt instead of  or 

Also when i test my service  get the same characters in the soap message

Thanks




From: WAJSBERG Julien RD-BIZZ [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: xml with strange characters
Date: Tue, 30 Aug 2005 14:30:59 +0200

Plorks mail a écrit :


 hi all

 i'm retruning a xml string when a method is called.

 When i look at the soap returned xml is formatted with lt; charactes
 instead of  or 

 e.g.

 lt;ROOTgt;
 
 lt;/ROOTgt;

 can anyone help me to solve this

Why is it a problem ?
Axis should deserialize this message correctly on the client side...



_
Want to block unwanted pop-ups? Download the free MSN Toolbar now!  
http://toolbar.msn.co.uk/




Re: xml with strange characters

2005-08-30 Thread Guy Rixon
If I understand you correctly, you're putting data marked up as XML in a
string and then sending that string as an XML element in a SOAP message. In
this usage, Axis has to turn the angle brackets into entity references in
order to make the XML well-formed; you're not allowed to have literal angle
brackets in the value of an XML element.

If you desparately need to send your XML structure as the value of
some XML element, then you can wrap it in a CDATA section so that Axis need not 
mess
with the angle brackets. However, why not just send the XML as the body of the
message (normal document/literal style)?

On Tue, 30 Aug 2005, Plorks mail wrote:

 it's not - when the client receives the xml it has alt instead of  or 

 Also when i test my service  get the same characters in the soap message

 Thanks



 From: WAJSBERG Julien RD-BIZZ [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: Re: xml with strange characters
 Date: Tue, 30 Aug 2005 14:30:59 +0200
 
 Plorks mail a ?crit :
 
  
   hi all
  
   i'm retruning a xml string when a method is called.
  
   When i look at the soap returned xml is formatted with lt; charactes
   instead of  or 
  
   e.g.
  
   lt;ROOTgt;
   
   lt;/ROOTgt;
  
   can anyone help me to solve this
  
 Why is it a problem ?
 Axis should deserialize this message correctly on the client side...
 

 _
 Want to block unwanted pop-ups? Download the free MSN Toolbar now!
 http://toolbar.msn.co.uk/


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523