axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: Urgent
Date Wed, 21 Nov 2007 13:16:31 GMT
Hi Mohamed,

In my opinion the wsdl definition is not really a definition. It
specifies that it will receive a string. But it doesn't specify the
meaning of it (i.e. xml, xml encoded as string). Therefore your wsdl is
loosely defined and this gives freedom to the implementer to interpret
it the way he wants. This results in unexpected behaviour.

My advice is to adjust the wsdl and make a strict definition of the
messages. This enforces the client to use the well specified description
and gives less possibility for an own interpretation.

Just my 2 cents.



From: M.Khaled [] 
Sent: 21 November 2007 12:52
Subject: Re: Urgent

You think the server should decode the received string before parsing
it, to reconvert the special charcters like '&lt; and &gt; to '<' and
'>'    ?

Paul Fremantle <> wrote:

	Now I'm confused. The WSDL defines a string. That says that the
server is expecting a string. So if that string is going to an XML, then
it *should* be encoded, because the datatype of the element is string
not xml. 
	If the server was expecting un-encoded XML then the WSDL should
	<element name="lead" type="xsd:anyType"/>
	The client is doing the right thing (at least as far as the WSDL
says) in encoding the XML with &lt; etc. 
	On Nov 21, 2007 11:27 AM, M.Khaled
<> wrote:

		Hi Paul,
		-This mail contains attached WSDL file which I used to
create the client by axis.
		-And About the way I am creating the XML that I am
sending it's similar to the foolowing: 
		class Main{
		String xml="<myElement><A><B>text</B></A></myElement>";
		Request req=new Request();
		Sender sender=new Sender();
		class Request{
		String attr=null;
		return attr;
		setAttr(String s){ 
		class Sender{
		public Response send(Request req) {
		Response res=(Response) call.invoke(req);
		return res;
		Paul Fremantle <> wrote: 

			The server is expecting it in XML form not
string form.
			Can you please post the WSDL. Also please
explain how you are creating the XML that you are sending. 
			On Nov 21, 2007 10:41 AM, M.Khaled
<> wrote:

				First of all Thanks a lot for your quick
response.Second I just want to tell you how the scenario going in here:
				(1)I am just working in the client side
(meaning I just created the client by axis WSDL2JAVA command by passing
the WSDL file to it). 
				(2)And I have to set ant attribute value
which is of type String to  a specific object and this value is xml
elements but in a string representation.
				(3)This specific object will be passed
to the invoke method of the Call object.  
				(4)In the server side (which is out of
my work scope, I am just using the URL for it and know nothing else
about it) it is expecting that this value I passed is xml in a string
				(5)So I tried your solution for base 64
encoding but the output was something like this:
				and the server can't parse this form
cause it is expecting that form:
				(6)And axis is generating this output: 
				<myEement>&lt;A&gt; &lt;B&gt; text
&lt;/B&gt; &lt;/A&gt; </myEement>
				and the server can't parse this form.
				That's the point I am still sticking in.

				If you have any other solution please

				"Hoda, Nadeem [USA]" < <> > wrote: 

					If it is something very urgent,
the easiest way is to base 64 encode the XML and pass the encoded string
which is guaranteed to have no special characters. 
					For example (server-side): 

					 //send this string 
					 String encodedXML =

					Otherwise you can use
attachments, but that is not an "urgent" scenario solution. 

					From: M.Khaled [mailto: <> ] 
					Sent: Wednesday, November 21,
2007 1:41 PM
					Subject: Urgent 
					I sent a question to the mailing
list and got no answer till now.Could anyone help me?
					My question was about how to
send xml as a string by axis client avoiding special character problem.

					Be a better sports nut! Let your
teams follow you with Yahoo Mobile. Try it now.


				Never miss a thing. Make Yahoo your
homepage. <*>

			Paul Fremantle
			Co-Founder and VP of Technical Sales, WSO2
			OASIS WS-RX TC Co-chair
			"Oxygenating the Web Service Platform", <>  


		Be a better sports nut! Let your teams follow you with
Yahoo Mobile. Try it now.

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

	Paul Fremantle
	Co-Founder and VP of Technical Sales, WSO2
	OASIS WS-RX TC Co-chair
	blog: <>
	"Oxygenating the Web Service Platform",


Get easy, one-click access to your favorites. Make Yahoo! your homepage.

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

View raw message