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 "M.Khaled" <mo...@yahoo.com> on 2007/11/21 10:41:27 UTC
Urgent
Hi,
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.
Thanks,
Mohamed.
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.
Re: Urgent
Posted by Paul Fremantle <pz...@gmail.com>.
I'm trying to understand the question.
Do you want the XML to be encoded (as a string) or do you want it to be sent
as real XML.
Why do you want it encoded as a string?
Paul
On Nov 21, 2007 9:41 AM, M.Khaled <mo...@yahoo.com> wrote:
> Hi,
>
> I sent a question to the mailing list and got no answer till now.Couldanyone help me?
> My question was about how to send xml as a string by axis client avoiding
> special character problem.
>
> Thanks,
> Mohamed.
>
> ------------------------------
> Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
> it now.<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
Re: Urgent
Posted by Paul Fremantle <pz...@gmail.com>.
The server should give the service method the string - as a java.lang.String.
There should be no XML parsing of it.
Paul
On Nov 21, 2007 12:52 PM, M.Khaled <mo...@yahoo.com> wrote:
> Paul
>
> You think the server should decode the received string before parsing it,
> to reconvert the special charcters like '< and > to '<' and '>' ?
>
>
> Mohamed
>
>
> *Paul Fremantle <pz...@gmail.com>* wrote:
>
> Mohamed
>
> 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 say:
>
> <sequence>
> <element name="lead" type="xsd:anyType"/>
> </sequence>
>
> The client is doing the right thing (at least as far as the WSDL says) in
> encoding the XML with < etc.
>
> Paul
>
> On Nov 21, 2007 11:27 AM, M.Khaled <mo...@yahoo.com> 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();
> > req.setAttr(xml);
> > Sender sender=new Sender();
> > sender.send(req);
> > }
> > class Request{
> > String attr=null;
> > getAttr(){
> > return attr;
> > }
> > setAttr(String s){
> > attr=s;
> > }
> >
> > class Sender{
> > public Response send(Request req) {
> > Response res=(Response) call.invoke(req);
> > return res;
> > }
> > }
> >
> > *Paul Fremantle <pz...@gmail.com>* wrote:
> >
> > Mohamed
> >
> > 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.
> >
> > Paul
> >
> > On Nov 21, 2007 10:41 AM, M.Khaled <mo...@yahoo.com>
> > 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 representation.
> > >
> > > (5)So I tried your solution for base 64 encoding but the output was
> > > something like this:
> > > <myEement>HJvc3BlY3Q+ICBpZClJzs</myEemen>
> > > and the server can't parse this form cause it is expecting that form:
> > > <myEement><A><B>text</B></A></myEement>
> > >
> > > (6)And axis is generating this output:
> > > <myEement><A> <B> text </B> </A> </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 advice.
> > >
> > > Thanks,
> > > Mohamed.
> > >
> > > *"Hoda, Nadeem [USA]" < hoda_nadeem@bah.com>* 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):
> > >
> > >
> > > import org.apache.xerces.impl.dv.util.Base64;
> > >
> > > ...
> > > //send this string
> > > String encodedXML = Base64.encode(rawXMLString);
> > > ...
> > >
> > >
> > > Otherwise you can use attachments, but that is not an "urgent"
> > > scenario solution.
> > >
> > > Thanks,
> > >
> > > Nadeem
> > >
> > > ------------------------------
> > > *From:* M.Khaled [mailto: mohamed_mohamed_186@yahoo.com]
> > > *Sent:* Wednesday, November 21, 2007 1:41 PM
> > > *To:* axis-user@ws.apache.org
> > > *Subject:* Urgent
> > >
> > > Hi,
> > >
> > > I sent a question to the mailing list and got no answer till now.Couldanyone help me?
> > > My question was about how to send xml as a string by axis
> > > client avoiding special character problem.
> > >
> > > Thanks,
> > > Mohamed.
> > > ------------------------------
> > > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
> > > it now.<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ>
> > >
> > >
> > > ------------------------------
> > > Never miss a thing. Make Yahoo your homepage.<http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
> > >
> >
> >
> >
> > --
> > Paul Fremantle
> > Co-Founder and VP of Technical Sales, WSO2
> > OASIS WS-RX TC Co-chair
> >
> > blog: http://pzf.fremantle.org
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> >
> > ------------------------------
> > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
> > it now.<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
>
> ------------------------------
> Get easy, one-click access to your favorites. Make Yahoo! your homepage.<http://us.rd.yahoo.com/evt=51443/*http://www.yahoo.com/r/hs>
>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
Re: Urgent
Posted by Paul Fremantle <pz...@gmail.com>.
Mohamed
What Sietse is trying to explain is this simple idea.
XML is being used as an encoding model to transfer data between the two
parties.
You have the following model -
SOAP Envelope -> SOAP Body -> ScoreLeadRequest -> Lead -> String
and then inside the string you are passing some further XML which is not
"typed" in the schema.
This is equivalent to having a Java Class definition like this:
public class ScoreLeadRequest {
public Object lead;
}
The more normal and "strongly typed" approach is to define the schema of the
stuff that you are putting in the String.
If you take a strongly typed Java interface and run Java2WSDL on that then
you will get a complete WSDL definition that is also strongly typed.
Paul
On Nov 22, 2007 8:55 AM, <si...@bt.com> wrote:
> Hi Mohamed,
>
> This was not my intend with linking to the articles. It is meant to
> steer you in the direction of strong type programming. The reason for
> this is to create no (or as narrow as possible) space for
> interpretation. I tried to clearly state that in my last mails too.
> Maybe the second article gives you more clarity of what I mean and try
> to say.
>
> I also don't know about the sources, I thought there were some links in
> the article and maybe google can help you.
>
> Regards,
> Sietse
>
> ________________________________
>
> From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
> Sent: 21 November 2007 21:29
> To: axis-user@ws.apache.org
> Subject: RE: Urgent
>
>
> Hi Sietse,
>
> I red the article of the first link and I noticed he is using a class
> called IBMSOAPFactory to create element from XML string.I tried to try
> this example but failed to find the jar file for this class.Do you know
> where I can find it or if there is any equivalent open source class?
>
> Best Regards,
> Mohamed.
>
> sietsenicolaas.tenhoeve@bt.com wrote:
>
> Hi Mohamed,
>
> I advice to use strong typed wsdl files. I hope you are familiar
> with
> strong vs. loose type languages? (i.e. java (strong) vs. php
> (loose))
>
> I think the following links will provide enough information:
>
> http://www.ibm.com/developerworks/xml/library/ws-tip-xsdcaution.html
>
> http://www.ibm.com/developerworks/webservices/library/ws-loosevstrong.ht
> ml
>
> I agree almost complete with both articles that strong typed
> definitions
> are the way to go. This because it minimizes the interpretation
> and
> maximizes the intend of the service. The articles are pointing
> that out
> with good examples imho!
>
> Sietse
>
>
> ________________________________
>
> From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
> Sent: 21 November 2007 13:28
> To: axis-user@ws.apache.org
> Subject: RE: Urgent
>
>
> Hi Sietse,
>
> I am new to web service.So I am asking how can I adjust the wsdl
> file
> as you adviced me?
>
> Thanks,
> Mohamed
>
> sietsenicolaas.tenhoeve@bt.com wrote:
>
> 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.
>
> Regards,
> Sietse
>
> ________________________________
>
> From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
> Sent: 21 November 2007 12:52
> To: axis-user@ws.apache.org
> Subject: Re: Urgent
>
>
> Paul
>
> You think the server should decode the received string before
> parsing
> it, to reconvert the special charcters like '< and > to '<' and
> '>' ?
>
>
> Mohamed
>
> Paul Fremantle wrote:
>
> Mohamed
>
> 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
> say:
>
>
>
>
>
> The client is doing the right thing (at least as far as the WSDL
> says) in encoding the XML with < etc.
>
> Paul
>
>
> 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="text";
> Request req=new Request();
> req.setAttr(xml);
> Sender sender=new Sender();
> sender.send(req);
> }
>
> class Request{
> String attr=null;
> getAttr(){
> return attr;
> }
> setAttr(String s){
> attr=s;
> }
>
> class Sender{
> public Response send(Request req) {
> Response res=(Response) call.invoke(req);
> return res;
> }
> }
>
> Paul Fremantle wrote:
>
> Mohamed
>
> 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.
>
> Paul
>
>
> 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
> representation.
>
> (5)So I tried your solution for base 64
> encoding but the output was something like this:
>
> HJvc3BlY3Q+ICBpZClJzs
> and the server can't parse this form
> cause it is expecting that form:
> text
>
> (6)And axis is generating this output:
> text
>
> and the server can't parse this form.
>
> That's the point I am still sticking in.
>
> If you have any other solution please
> advice.
>
> Thanks,
> Mohamed.
>
> "Hoda, Nadeem [USA]" <
> hoda_nadeem@bah.com > 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):
>
>
> import
> org.apache.xerces.impl.dv.util.Base64;
>
> ...
> //send this string
> String encodedXML =
> Base64.encode(rawXMLString);
> ...
>
>
> Otherwise you can use
> attachments, but that is not an "urgent" scenario solution.
>
> Thanks,
>
> Nadeem
>
> ________________________________
>
> From: M.Khaled [mailto:
> mohamed_mohamed_186@yahoo.com ]
> Sent: Wednesday, November 21,
> 2007 1:41 PM
> To: axis-user@ws.apache.org
> Subject: Urgent
>
>
> Hi,
>
> 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.
>
> Thanks,
> Mohamed.
> ________________________________
>
> Be a better sports nut! Let your
> teams follow you with Yahoo Mobile. Try it now.
> t9_qDKvtAbMuh1G1SQtBI7ntAcJ>
>
>
> ________________________________
>
> Never miss a thing. Make Yahoo your
> homepage.
>
>
>
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
>
> paul@wso2.com
>
> "Oxygenating the Web Service Platform",
> www.wso2.com
>
>
> ________________________________
>
> Be a better sports nut! Let your teams follow you with
> Yahoo Mobile. Try it now.
> t9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail:
> axis-user-help@ws.apache.org
>
>
>
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
>
>
> ________________________________
>
> Get easy, one-click access to your favorites. Make Yahoo! your
> homepage.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> ________________________________
>
> Never miss a thing. Make Yahoo your homepage.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> ________________________________
>
> Never miss a thing. Make Yahoo your homepage.
> <http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
RE: Urgent
Posted by si...@bt.com.
Hi Mohamed,
This was not my intend with linking to the articles. It is meant to
steer you in the direction of strong type programming. The reason for
this is to create no (or as narrow as possible) space for
interpretation. I tried to clearly state that in my last mails too.
Maybe the second article gives you more clarity of what I mean and try
to say.
I also don't know about the sources, I thought there were some links in
the article and maybe google can help you.
Regards,
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 21:29
To: axis-user@ws.apache.org
Subject: RE: Urgent
Hi Sietse,
I red the article of the first link and I noticed he is using a class
called IBMSOAPFactory to create element from XML string.I tried to try
this example but failed to find the jar file for this class.Do you know
where I can find it or if there is any equivalent open source class?
Best Regards,
Mohamed.
sietsenicolaas.tenhoeve@bt.com wrote:
Hi Mohamed,
I advice to use strong typed wsdl files. I hope you are familiar
with
strong vs. loose type languages? (i.e. java (strong) vs. php
(loose))
I think the following links will provide enough information:
http://www.ibm.com/developerworks/xml/library/ws-tip-xsdcaution.html
http://www.ibm.com/developerworks/webservices/library/ws-loosevstrong.ht
ml
I agree almost complete with both articles that strong typed
definitions
are the way to go. This because it minimizes the interpretation
and
maximizes the intend of the service. The articles are pointing
that out
with good examples imho!
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 13:28
To: axis-user@ws.apache.org
Subject: RE: Urgent
Hi Sietse,
I am new to web service.So I am asking how can I adjust the wsdl
file
as you adviced me?
Thanks,
Mohamed
sietsenicolaas.tenhoeve@bt.com wrote:
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.
Regards,
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 12:52
To: axis-user@ws.apache.org
Subject: Re: Urgent
Paul
You think the server should decode the received string before
parsing
it, to reconvert the special charcters like '< and > to '<' and
'>' ?
Mohamed
Paul Fremantle wrote:
Mohamed
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
say:
The client is doing the right thing (at least as far as the WSDL
says) in encoding the XML with < etc.
Paul
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="text";
Request req=new Request();
req.setAttr(xml);
Sender sender=new Sender();
sender.send(req);
}
class Request{
String attr=null;
getAttr(){
return attr;
}
setAttr(String s){
attr=s;
}
class Sender{
public Response send(Request req) {
Response res=(Response) call.invoke(req);
return res;
}
}
Paul Fremantle wrote:
Mohamed
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.
Paul
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
representation.
(5)So I tried your solution for base 64
encoding but the output was something like this:
HJvc3BlY3Q+ICBpZClJzs
and the server can't parse this form
cause it is expecting that form:
text
(6)And axis is generating this output:
text
and the server can't parse this form.
That's the point I am still sticking in.
If you have any other solution please
advice.
Thanks,
Mohamed.
"Hoda, Nadeem [USA]" <
hoda_nadeem@bah.com > 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):
import
org.apache.xerces.impl.dv.util.Base64;
...
//send this string
String encodedXML =
Base64.encode(rawXMLString);
...
Otherwise you can use
attachments, but that is not an "urgent" scenario solution.
Thanks,
Nadeem
________________________________
From: M.Khaled [mailto:
mohamed_mohamed_186@yahoo.com ]
Sent: Wednesday, November 21,
2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
________________________________
Be a better sports nut! Let your
teams follow you with Yahoo Mobile. Try it now.
t9_qDKvtAbMuh1G1SQtBI7ntAcJ>
________________________________
Never miss a thing. Make Yahoo your
homepage.
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform",
www.wso2.com
________________________________
Be a better sports nut! Let your teams follow you with
Yahoo Mobile. Try it now.
t9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
---------------------------------------------------------------------
To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail:
axis-user-help@ws.apache.org
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
________________________________
Get easy, one-click access to your favorites. Make Yahoo! your
homepage.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
________________________________
Never miss a thing. Make Yahoo your homepage.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
________________________________
Never miss a thing. Make Yahoo your homepage.
<http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: Urgent
Posted by "M.Khaled" <mo...@yahoo.com>.
Hi Sietse,
I red the article of the first link and I noticed he is using a class called IBMSOAPFactory to create element from XML string.I tried to try this example but failed to find the jar file for this class.Do you know where I can find it or if there is any equivalent open source class?
Best Regards,
Mohamed.
sietsenicolaas.tenhoeve@bt.com wrote:
Hi Mohamed,
I advice to use strong typed wsdl files. I hope you are familiar with
strong vs. loose type languages? (i.e. java (strong) vs. php (loose))
I think the following links will provide enough information:
http://www.ibm.com/developerworks/xml/library/ws-tip-xsdcaution.html
http://www.ibm.com/developerworks/webservices/library/ws-loosevstrong.ht
ml
I agree almost complete with both articles that strong typed definitions
are the way to go. This because it minimizes the interpretation and
maximizes the intend of the service. The articles are pointing that out
with good examples imho!
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 13:28
To: axis-user@ws.apache.org
Subject: RE: Urgent
Hi Sietse,
I am new to web service.So I am asking how can I adjust the wsdl file
as you adviced me?
Thanks,
Mohamed
sietsenicolaas.tenhoeve@bt.com wrote:
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.
Regards,
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 12:52
To: axis-user@ws.apache.org
Subject: Re: Urgent
Paul
You think the server should decode the received string before
parsing
it, to reconvert the special charcters like '< and > to '<' and
'>' ?
Mohamed
Paul Fremantle wrote:
Mohamed
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
say:
The client is doing the right thing (at least as far as the WSDL
says) in encoding the XML with < etc.
Paul
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="text";
Request req=new Request();
req.setAttr(xml);
Sender sender=new Sender();
sender.send(req);
}
class Request{
String attr=null;
getAttr(){
return attr;
}
setAttr(String s){
attr=s;
}
class Sender{
public Response send(Request req) {
Response res=(Response) call.invoke(req);
return res;
}
}
Paul Fremantle wrote:
Mohamed
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.
Paul
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
representation.
(5)So I tried your solution for base 64
encoding but the output was something like this:
HJvc3BlY3Q+ICBpZClJzs
and the server can't parse this form
cause it is expecting that form:
text
(6)And axis is generating this output:
text
and the server can't parse this form.
That's the point I am still sticking in.
If you have any other solution please
advice.
Thanks,
Mohamed.
"Hoda, Nadeem [USA]" <
hoda_nadeem@bah.com > 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):
import
org.apache.xerces.impl.dv.util.Base64;
....
//send this string
String encodedXML =
Base64.encode(rawXMLString);
....
Otherwise you can use
attachments, but that is not an "urgent" scenario solution.
Thanks,
Nadeem
________________________________
From: M.Khaled [mailto:
mohamed_mohamed_186@yahoo.com ]
Sent: Wednesday, November 21,
2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
________________________________
Be a better sports nut! Let your
teams follow you with Yahoo Mobile. Try it now.
t9_qDKvtAbMuh1G1SQtBI7ntAcJ>
________________________________
Never miss a thing. Make Yahoo your
homepage.
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform",
www.wso2.com
________________________________
Be a better sports nut! Let your teams follow you with
Yahoo Mobile. Try it now.
t9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
---------------------------------------------------------------------
To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail:
axis-user-help@ws.apache.org
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
________________________________
Get easy, one-click access to your favorites. Make Yahoo! your
homepage.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
________________________________
Never miss a thing. Make Yahoo your homepage.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------
Never miss a thing. Make Yahoo your homepage.
RE: Urgent
Posted by si...@bt.com.
Hi Mohamed,
I advice to use strong typed wsdl files. I hope you are familiar with
strong vs. loose type languages? (i.e. java (strong) vs. php (loose))
I think the following links will provide enough information:
http://www.ibm.com/developerworks/xml/library/ws-tip-xsdcaution.html
http://www.ibm.com/developerworks/webservices/library/ws-loosevstrong.ht
ml
I agree almost complete with both articles that strong typed definitions
are the way to go. This because it minimizes the interpretation and
maximizes the intend of the service. The articles are pointing that out
with good examples imho!
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 13:28
To: axis-user@ws.apache.org
Subject: RE: Urgent
Hi Sietse,
I am new to web service.So I am asking how can I adjust the wsdl file
as you adviced me?
Thanks,
Mohamed
sietsenicolaas.tenhoeve@bt.com wrote:
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.
Regards,
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 12:52
To: axis-user@ws.apache.org
Subject: Re: Urgent
Paul
You think the server should decode the received string before
parsing
it, to reconvert the special charcters like '< and > to '<' and
'>' ?
Mohamed
Paul Fremantle wrote:
Mohamed
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
say:
The client is doing the right thing (at least as far as the WSDL
says) in encoding the XML with < etc.
Paul
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="text";
Request req=new Request();
req.setAttr(xml);
Sender sender=new Sender();
sender.send(req);
}
class Request{
String attr=null;
getAttr(){
return attr;
}
setAttr(String s){
attr=s;
}
class Sender{
public Response send(Request req) {
Response res=(Response) call.invoke(req);
return res;
}
}
Paul Fremantle wrote:
Mohamed
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.
Paul
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
representation.
(5)So I tried your solution for base 64
encoding but the output was something like this:
HJvc3BlY3Q+ICBpZClJzs
and the server can't parse this form
cause it is expecting that form:
text
(6)And axis is generating this output:
<A> <B> text
</B> </A>
and the server can't parse this form.
That's the point I am still sticking in.
If you have any other solution please
advice.
Thanks,
Mohamed.
"Hoda, Nadeem [USA]" <
hoda_nadeem@bah.com > 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):
import
org.apache.xerces.impl.dv.util.Base64;
...
//send this string
String encodedXML =
Base64.encode(rawXMLString);
...
Otherwise you can use
attachments, but that is not an "urgent" scenario solution.
Thanks,
Nadeem
________________________________
From: M.Khaled [mailto:
mohamed_mohamed_186@yahoo.com ]
Sent: Wednesday, November 21,
2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
________________________________
Be a better sports nut! Let your
teams follow you with Yahoo Mobile. Try it now.
t9_qDKvtAbMuh1G1SQtBI7ntAcJ>
________________________________
Never miss a thing. Make Yahoo your
homepage.
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform",
www.wso2.com
________________________________
Be a better sports nut! Let your teams follow you with
Yahoo Mobile. Try it now.
t9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
---------------------------------------------------------------------
To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail:
axis-user-help@ws.apache.org
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
________________________________
Get easy, one-click access to your favorites. Make Yahoo! your
homepage.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
________________________________
Never miss a thing. Make Yahoo your homepage.
<http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: Urgent
Posted by "M.Khaled" <mo...@yahoo.com>.
Hi Sietse,
I am new to web service.So I am asking how can I adjust the wsdl file as you adviced me?
Thanks,
Mohamed
sietsenicolaas.tenhoeve@bt.com wrote:
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.
Regards,
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 12:52
To: axis-user@ws.apache.org
Subject: Re: Urgent
Paul
You think the server should decode the received string before parsing
it, to reconvert the special charcters like '< and > to '<' and
'>' ?
Mohamed
Paul Fremantle
wrote:
Mohamed
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
say:
The client is doing the right thing (at least as far as the WSDL
says) in encoding the XML with < etc.
Paul
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="text";
Request req=new Request();
req.setAttr(xml);
Sender sender=new Sender();
sender.send(req);
}
class Request{
String attr=null;
getAttr(){
return attr;
}
setAttr(String s){
attr=s;
}
class Sender{
public Response send(Request req) {
Response res=(Response) call.invoke(req);
return res;
}
}
Paul Fremantle
wrote:
Mohamed
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.
Paul
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
representation.
(5)So I tried your solution for base 64
encoding but the output was something like this:
HJvc3BlY3Q+ICBpZClJzs
and the server can't parse this form
cause it is expecting that form:
text
(6)And axis is generating this output:
<A> <B> text
</B> </A>
and the server can't parse this form.
That's the point I am still sticking in.
If you have any other solution please
advice.
Thanks,
Mohamed.
"Hoda, Nadeem [USA]" <
hoda_nadeem@bah.com > 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):
import
org.apache.xerces.impl.dv.util.Base64;
....
//send this string
String encodedXML =
Base64.encode(rawXMLString);
....
Otherwise you can use
attachments, but that is not an "urgent" scenario solution.
Thanks,
Nadeem
________________________________
From: M.Khaled [mailto:
mohamed_mohamed_186@yahoo.com ]
Sent: Wednesday, November 21,
2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
________________________________
Be a better sports nut! Let your
teams follow you with Yahoo Mobile. Try it now.
t9_qDKvtAbMuh1G1SQtBI7ntAcJ>
________________________________
Never miss a thing. Make Yahoo your
homepage.
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform",
www.wso2.com
________________________________
Be a better sports nut! Let your teams follow you with
Yahoo Mobile. Try it now.
t9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
---------------------------------------------------------------------
To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail:
axis-user-help@ws.apache.org
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
________________________________
Get easy, one-click access to your favorites. Make Yahoo! your homepage.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------
Never miss a thing. Make Yahoo your homepage.
RE: Urgent
Posted by si...@bt.com.
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.
Regards,
Sietse
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: 21 November 2007 12:52
To: axis-user@ws.apache.org
Subject: Re: Urgent
Paul
You think the server should decode the received string before parsing
it, to reconvert the special charcters like '< and > to '<' and
'>' ?
Mohamed
Paul Fremantle <pz...@gmail.com> wrote:
Mohamed
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
say:
<sequence>
<element name="lead" type="xsd:anyType"/>
</sequence>
The client is doing the right thing (at least as far as the WSDL
says) in encoding the XML with < etc.
Paul
On Nov 21, 2007 11:27 AM, M.Khaled
<mo...@yahoo.com> 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();
req.setAttr(xml);
Sender sender=new Sender();
sender.send(req);
}
class Request{
String attr=null;
getAttr(){
return attr;
}
setAttr(String s){
attr=s;
}
class Sender{
public Response send(Request req) {
Response res=(Response) call.invoke(req);
return res;
}
}
Paul Fremantle <pz...@gmail.com> wrote:
Mohamed
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.
Paul
On Nov 21, 2007 10:41 AM, M.Khaled
<mo...@yahoo.com> 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
representation.
(5)So I tried your solution for base 64
encoding but the output was something like this:
<myEement>HJvc3BlY3Q+ICBpZClJzs</myEemen>
and the server can't parse this form
cause it is expecting that form:
<myEement><A><B>text</B></A></myEement>
(6)And axis is generating this output:
<myEement><A> <B> text
</B> </A> </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
advice.
Thanks,
Mohamed.
"Hoda, Nadeem [USA]" <
hoda_nadeem@bah.com <ma...@bah.com> > 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):
import
org.apache.xerces.impl.dv.util.Base64;
...
//send this string
String encodedXML =
Base64.encode(rawXMLString);
...
Otherwise you can use
attachments, but that is not an "urgent" scenario solution.
Thanks,
Nadeem
________________________________
From: M.Khaled [mailto:
mohamed_mohamed_186@yahoo.com <ma...@yahoo.com> ]
Sent: Wednesday, November 21,
2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
________________________________
Be a better sports nut! Let your
teams follow you with Yahoo Mobile. Try it now.
<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=A
t9_qDKvtAbMuh1G1SQtBI7ntAcJ>
________________________________
Never miss a thing. Make Yahoo your
homepage. <http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
<http://pzf.fremantle.org/>
paul@wso2.com
"Oxygenating the Web Service Platform",
www.wso2.com <http://www.wso2.com/>
________________________________
Be a better sports nut! Let your teams follow you with
Yahoo Mobile. Try it now.
<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=A
t9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
---------------------------------------------------------------------
To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail:
axis-user-help@ws.apache.org <ma...@ws.apache.org>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org <http://pzf.fremantle.org/>
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
<http://www.wso2.com/>
________________________________
Get easy, one-click access to your favorites. Make Yahoo! your homepage.
<http://us.rd.yahoo.com/evt=51443/*http://www.yahoo.com/r/hs>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Urgent
Posted by "M.Khaled" <mo...@yahoo.com>.
Paul
You think the server should decode the received string before parsing it, to reconvert the special charcters like '< and > to '<' and '>' ?
Mohamed
Paul Fremantle <pz...@gmail.com> wrote:
Mohamed
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 say:
<sequence>
<element name="lead" type="xsd:anyType"/>
</sequence>
The client is doing the right thing (at least as far as the WSDL says) in encoding the XML with < etc.
Paul
On Nov 21, 2007 11:27 AM, M.Khaled <mo...@yahoo.com> 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();
req.setAttr(xml);
Sender sender=new Sender();
sender.send(req);
}
class Request{
String attr=null;
getAttr(){
return attr;
}
setAttr(String s){
attr=s;
}
class Sender{
public Response send(Request req) {
Response res=(Response) call.invoke(req);
return res;
}
}
Paul Fremantle <pz...@gmail.com> wrote:
Mohamed
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.
Paul
On Nov 21, 2007 10:41 AM, M.Khaled <mo...@yahoo.com> 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 representation.
(5)So I tried your solution for base 64 encoding but the output was something like this:
<myEement>HJvc3BlY3Q+ICBpZClJzs</myEemen>
and the server can't parse this form cause it is expecting that form:
<myEement><A><B>text</B></A></myEement>
(6)And axis is generating this output:
<myEement><A> <B> text </B> </A> </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 advice.
Thanks,
Mohamed.
"Hoda, Nadeem [USA]" < hoda_nadeem@bah.com> 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):
import org.apache.xerces.impl.dv.util.Base64;
...
//send this string
String encodedXML = Base64.encode(rawXMLString);
....
Otherwise you can use attachments, but that is not an "urgent" scenario solution.
Thanks,
Nadeem
---------------------------------
From: M.Khaled [mailto: mohamed_mohamed_186@yahoo.com]
Sent: Wednesday, November 21, 2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
---------------------------------
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
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
---------------------------------
Get easy, one-click access to your favorites. Make Yahoo! your homepage.
Re: Urgent
Posted by Paul Fremantle <pz...@gmail.com>.
Mohamed
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 say:
<sequence>
<element name="lead" type="xsd:anyType"/>
</sequence>
The client is doing the right thing (at least as far as the WSDL says) in
encoding the XML with < etc.
Paul
On Nov 21, 2007 11:27 AM, M.Khaled <mo...@yahoo.com> 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();
> req.setAttr(xml);
> Sender sender=new Sender();
> sender.send(req);
> }
> class Request{
> String attr=null;
> getAttr(){
> return attr;
> }
> setAttr(String s){
> attr=s;
> }
>
> class Sender{
> public Response send(Request req) {
> Response res=(Response) call.invoke(req);
> return res;
> }
> }
>
> *Paul Fremantle <pz...@gmail.com>* wrote:
>
> Mohamed
>
> 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.
>
> Paul
>
> On Nov 21, 2007 10:41 AM, M.Khaled <mo...@yahoo.com> 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 representation.
> >
> > (5)So I tried your solution for base 64 encoding but the output was
> > something like this:
> > <myEement>HJvc3BlY3Q+ICBpZClJzs</myEemen>
> > and the server can't parse this form cause it is expecting that form:
> > <myEement><A><B>text</B></A></myEement>
> >
> > (6)And axis is generating this output:
> > <myEement><A> <B> text </B> </A> </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 advice.
> >
> > Thanks,
> > Mohamed.
> >
> > *"Hoda, Nadeem [USA]" < hoda_nadeem@bah.com>* 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):
> >
> >
> > import org.apache.xerces.impl.dv.util.Base64;
> >
> > ...
> > //send this string
> > String encodedXML = Base64.encode(rawXMLString);
> > ...
> >
> >
> > Otherwise you can use attachments, but that is not an "urgent" scenario
> > solution.
> >
> > Thanks,
> >
> > Nadeem
> >
> > ------------------------------
> > *From:* M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
> > *Sent:* Wednesday, November 21, 2007 1:41 PM
> > *To:* axis-user@ws.apache.org
> > *Subject:* Urgent
> >
> > Hi,
> >
> > I sent a question to the mailing list and got no answer till now.Couldanyone help me?
> > My question was about how to send xml as a string by axis
> > client avoiding special character problem.
> >
> > Thanks,
> > Mohamed.
> > ------------------------------
> > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
> > it now.<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ>
> >
> >
> > ------------------------------
> > Never miss a thing. Make Yahoo your homepage.<http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
>
> ------------------------------
> Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
> it now.<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ%0A>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
Re: Urgent
Posted by "M.Khaled" <mo...@yahoo.com>.
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();
req.setAttr(xml);
Sender sender=new Sender();
sender.send(req);
}
class Request{
String attr=null;
getAttr(){
return attr;
}
setAttr(String s){
attr=s;
}
class Sender{
public Response send(Request req) {
Response res=(Response) call.invoke(req);
return res;
}
}
Paul Fremantle <pz...@gmail.com> wrote:
Mohamed
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.
Paul
On Nov 21, 2007 10:41 AM, M.Khaled <mo...@yahoo.com> 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 representation.
(5)So I tried your solution for base 64 encoding but the output was something like this:
<myEement>HJvc3BlY3Q+ICBpZClJzs</myEemen>
and the server can't parse this form cause it is expecting that form:
<myEement><A><B>text</B></A></myEement>
(6)And axis is generating this output:
<myEement><A> <B> text </B> </A> </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 advice.
Thanks,
Mohamed.
"Hoda, Nadeem [USA]" < hoda_nadeem@bah.com> 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):
import org.apache.xerces.impl.dv.util.Base64;
...
//send this string
String encodedXML = Base64.encode(rawXMLString);
....
Otherwise you can use attachments, but that is not an "urgent" scenario solution.
Thanks,
Nadeem
---------------------------------
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: Wednesday, November 21, 2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
---------------------------------
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
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.
Re: Urgent
Posted by Paul Fremantle <pz...@gmail.com>.
Mohamed
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.
Paul
On Nov 21, 2007 10:41 AM, M.Khaled <mo...@yahoo.com> 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 representation.
>
> (5)So I tried your solution for base 64 encoding but the output was
> something like this:
> <myEement>HJvc3BlY3Q+ICBpZClJzs</myEemen>
> and the server can't parse this form cause it is expecting that form:
> <myEement><A><B>text</B></A></myEement>
>
> (6)And axis is generating this output:
> <myEement><A> <B> text </B> </A> </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 advice.
>
> Thanks,
> Mohamed.
>
> *"Hoda, Nadeem [USA]" <ho...@bah.com>* 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):
>
>
> import org.apache.xerces.impl.dv.util.Base64;
>
> ...
> //send this string
> String encodedXML = Base64.encode(rawXMLString);
> ...
>
>
> Otherwise you can use attachments, but that is not an "urgent" scenario
> solution.
>
> Thanks,
>
> Nadeem
>
> ------------------------------
> *From:* M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
> *Sent:* Wednesday, November 21, 2007 1:41 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Urgent
>
> Hi,
>
> I sent a question to the mailing list and got no answer till now.Couldanyone help me?
> My question was about how to send xml as a string by axis client avoiding
> special character problem.
>
> Thanks,
> Mohamed.
> ------------------------------
> Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
> it now.<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ>
>
>
> ------------------------------
> Never miss a thing. Make Yahoo your homepage.<http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
RE: Urgent
Posted by "M.Khaled" <mo...@yahoo.com>.
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 representation.
(5)So I tried your solution for base 64 encoding but the output was something like this:
<myEement>HJvc3BlY3Q+ICBpZClJzs</myEemen>
and the server can't parse this form cause it is expecting that form:
<myEement><A><B>text</B></A></myEement>
(6)And axis is generating this output:
<myEement><A> <B> text </B> </A> </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 advice.
Thanks,
Mohamed.
"Hoda, Nadeem [USA]" <ho...@bah.com> 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):
import org.apache.xerces.impl.dv.util.Base64;
...
//send this string
String encodedXML = Base64.encode(rawXMLString);
....
Otherwise you can use attachments, but that is not an "urgent" scenario solution.
Thanks,
Nadeem
---------------------------------
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: Wednesday, November 21, 2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.
---------------------------------
Never miss a thing. Make Yahoo your homepage.
RE: Urgent
Posted by "Hoda, Nadeem [USA]" <ho...@bah.com>.
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):
import org.apache.xerces.impl.dv.util.Base64;
...
//send this string
String encodedXML = Base64.encode(rawXMLString);
...
Otherwise you can use attachments, but that is not an "urgent" scenario
solution.
Thanks,
Nadeem
________________________________
From: M.Khaled [mailto:mohamed_mohamed_186@yahoo.com]
Sent: Wednesday, November 21, 2007 1:41 PM
To: axis-user@ws.apache.org
Subject: Urgent
Hi,
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.
Thanks,
Mohamed.
________________________________
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
it now.
<http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=A
t9_qDKvtAbMuh1G1SQtBI7ntAcJ>