You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Senthil Kumar P <se...@aztec.soft.net> on 2001/05/11 13:47:19 UTC
how can i get '<' & ' >' signs instead oF < > when
i receive a xml string in MS SOAP
HI,
i am using MS SOAP in client side & APACHE SOAP in server side. when
i get XML String as response from APACHE SOAP TO MS SOAP , all the < ,>
tags have been conveted into < ,> .. IS THERE ANY METHOD TO GET THE
ORIGINAL XML STRING..
ANY HELP APPRECIATED.
THANKS,
senthil
"Messengers ain't bothered, wherever you are..."
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
Re: how can i get '<' & ' >' signs instead oF <
> when i receive a xml string in MS SOAP
Posted by Tom Myers <to...@dreamscape.com>.
I'm not speaking as an expert, just as a fellow mixed-up soap-user; in this
case I'm thinking about the way that samples.addressbook.AddressBook.getAllListings()
simply builds and returns an org.w3c.dom.Element and the example works fine with very
little effort. In other words, if your service method returns an Element in the
way that the sample does, I would expect it to work with no more added mechanism
than the sample requires. (You can probably skip the rest of this message.)
Of course, if you're using a BSF script service, then you may not be able to return
an Element; for example, so far as I know a javascript service modelled on the
Calculator example cannot return an XML structure at all. (Maybe I'm wrong about
that, I don't know the limits of the system.) At any rate, if you add to it, within
the DeploymentDescriptor.xml, a method
function gimmeXML(){return "<a>OUTER<b>INNER</b>OUTER</a>"; }
this will blow up in the parsing of the DeploymentDescriptor.xml, but if you try
function gimmeXML(){
return "<a>OUTER<b>INNER</b>OUTER</a>" ;
}
then this will produce exactly the string you want...but it will be of type "ns1:string"
and the string serialization will re-introduce the > < and so forth. What I did was
to write a very very simple XMLStringSerializer class, a simplification of the
existing DateSerializer class, whose "marshall" method replaced "sink.write(fdate);"
with "sink.write((String)src);", and so forth, just dumping the actual string returned
by the gimmeXML function. (Well, my code is a little more complex than that, but not
much.) Then in the DeploymentDescriptor.xml I add
> <isd:mappings>
> <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:x="urn:xml-soap-demo-astrology" qname="x:string"
> javaType="java.lang.String"
> java2XMLClassName="XMLStringSerializer"
> xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
> </isd:mappings>
Now we're almost there---not quite, not for a Java client, but actually with a
low-level MS SOAP within IE5.5, say
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
setup doing the work and passing it into a DOMDocument, I'm fine already; the
intended string comes through as XML and I can rearrange it with clientside XSL
with no trouble. If this is part of your problem and you need details, I can
provide some---I think that most people with the xml string issue are probably
better served by ignoring most of this message and just returning an
org.w3c.dom.Element.
Tom Myers
At 05:20 PM 5/11/2001 +0100, Martin McVay wrote:
>Tom,
>
>Could you be more specific about the type of 'Element' here. I am just getting into this and I am having a similar problem to Senthil.
>
>Kind Regards,
>Martin
>
>At 08:14 AM 5/11/2001 -0400, you wrote:
>>I think this is becoming a FAQ...you have two choices, really, maybe three.
>> (1) Make your service method return an Element, in which case (if you trace
>> with tcptunnelgui, for example) you'll have the XML going through;
>> (2) let the < and so forth flow, but do replacements on the resulting
>> string on the clientside, then do a loadXML of that string (which I
>> think always gets you into UTF-16, but otherwise is okay?)
>> (3) write your own serializer for the object you are now returning as a
>> string, and have it generate exactly what you want. Most likely
>> redundant since the Element serializer should do that anyway.
>>
>>Tom Myers
>>At 05:17 PM 5/11/2001 +0530, Senthil Kumar P wrote:
>>
>> >HI,
>> > i am using MS SOAP in client side & APACHE SOAP in server side. when
>> >i get XML String as response from APACHE SOAP TO MS SOAP , all the < ,>
>> >tags have been conveted into < ,> .. IS THERE ANY METHOD TO GET THE
>> >ORIGINAL XML STRING..
>> >ANY HELP APPRECIATED.
>> >
>> >THANKS,
>> >senthil
>> >
>> >
>> >"Messengers ain't bothered, wherever you are..."
>> >
>> >
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>> >For additional commands, email: soap-user-help@xml.apache.org
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>>For additional commands, email: soap-user-help@xml.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
Re: how can i get '<' & ' >' signs instead oF <
> when i receive a xml string in MS SOAP
Posted by Tom Myers <to...@dreamscape.com>.
I'm not speaking as an expert, just as a fellow mixed-up soap-user; in this
case I'm thinking about the way that samples.addressbook.AddressBook.getAllListings()
simply builds and returns an org.w3c.dom.Element and the example works fine with very
little effort. In other words, if your service method returns an Element in the
way that the sample does, I would expect it to work with no more added mechanism
than the sample requires. (You can probably skip the rest of this message.)
Of course, if you're using a BSF script service, then you may not be able to return
an Element; for example, so far as I know a javascript service modelled on the
Calculator example cannot return an XML structure at all. (Maybe I'm wrong about
that, I don't know the limits of the system.) At any rate, if you add to it, within
the DeploymentDescriptor.xml, a method
function gimmeXML(){return "<a>OUTER<b>INNER</b>OUTER</a>"; }
this will blow up in the parsing of the DeploymentDescriptor.xml, but if you try
function gimmeXML(){
return "<a>OUTER<b>INNER</b>OUTER</a>" ;
}
then this will produce exactly the string you want...but it will be of type "ns1:string"
and the string serialization will re-introduce the > < and so forth. What I did was
to write a very very simple XMLStringSerializer class, a simplification of the
existing DateSerializer class, whose "marshall" method replaced "sink.write(fdate);"
with "sink.write((String)src);", and so forth, just dumping the actual string returned
by the gimmeXML function. (Well, my code is a little more complex than that, but not
much.) Then in the DeploymentDescriptor.xml I add
> <isd:mappings>
> <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:x="urn:xml-soap-demo-astrology" qname="x:string"
> javaType="java.lang.String"
> java2XMLClassName="XMLStringSerializer"
> xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
> </isd:mappings>
Now we're almost there---not quite, not for a Java client, but actually with a
low-level MS SOAP within IE5.5, say
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
setup doing the work and passing it into a DOMDocument, I'm fine already; the
intended string comes through as XML and I can rearrange it with clientside XSL
with no trouble. If this is part of your problem and you need details, I can
provide some---I think that most people with the xml string issue are probably
better served by ignoring most of this message and just returning an
org.w3c.dom.Element.
Tom Myers
At 05:20 PM 5/11/2001 +0100, Martin McVay wrote:
>Tom,
>
>Could you be more specific about the type of 'Element' here. I am just getting into this and I am having a similar problem to Senthil.
>
>Kind Regards,
>Martin
>
>At 08:14 AM 5/11/2001 -0400, you wrote:
>>I think this is becoming a FAQ...you have two choices, really, maybe three.
>> (1) Make your service method return an Element, in which case (if you trace
>> with tcptunnelgui, for example) you'll have the XML going through;
>> (2) let the < and so forth flow, but do replacements on the resulting
>> string on the clientside, then do a loadXML of that string (which I
>> think always gets you into UTF-16, but otherwise is okay?)
>> (3) write your own serializer for the object you are now returning as a
>> string, and have it generate exactly what you want. Most likely
>> redundant since the Element serializer should do that anyway.
>>
>>Tom Myers
>>At 05:17 PM 5/11/2001 +0530, Senthil Kumar P wrote:
>>
>> >HI,
>> > i am using MS SOAP in client side & APACHE SOAP in server side. when
>> >i get XML String as response from APACHE SOAP TO MS SOAP , all the < ,>
>> >tags have been conveted into < ,> .. IS THERE ANY METHOD TO GET THE
>> >ORIGINAL XML STRING..
>> >ANY HELP APPRECIATED.
>> >
>> >THANKS,
>> >senthil
>> >
>> >
>> >"Messengers ain't bothered, wherever you are..."
>> >
>> >
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>> >For additional commands, email: soap-user-help@xml.apache.org
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>>For additional commands, email: soap-user-help@xml.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
Re: how can i get '<' & ' >' signs instead oF <
> when i receive a xml string in MS SOAP
Posted by Martin McVay <ma...@valtech.co.uk>.
Tom,
Could you be more specific about the type of 'Element' here. I am just
getting into this and I am having a similar problem to Senthil.
Kind Regards,
Martin
At 08:14 AM 5/11/2001 -0400, you wrote:
>I think this is becoming a FAQ...you have two choices, really, maybe three.
> (1) Make your service method return an Element, in which case (if you trace
> with tcptunnelgui, for example) you'll have the XML going through;
> (2) let the < and so forth flow, but do replacements on the resulting
> string on the clientside, then do a loadXML of that string (which I
> think always gets you into UTF-16, but otherwise is okay?)
> (3) write your own serializer for the object you are now returning as a
> string, and have it generate exactly what you want. Most likely
> redundant since the Element serializer should do that anyway.
>
>Tom Myers
>At 05:17 PM 5/11/2001 +0530, Senthil Kumar P wrote:
>
> >HI,
> > i am using MS SOAP in client side & APACHE SOAP in server side. when
> >i get XML String as response from APACHE SOAP TO MS SOAP , all the < ,>
> >tags have been conveted into < ,> .. IS THERE ANY METHOD TO GET THE
> >ORIGINAL XML STRING..
> >ANY HELP APPRECIATED.
> >
> >THANKS,
> >senthil
> >
> >
> >"Messengers ain't bothered, wherever you are..."
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> >For additional commands, email: soap-user-help@xml.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
Re: how can i get '<' & ' >' signs instead oF <
> when i receive a xml string in MS SOAP
Posted by Martin McVay <ma...@valtech.co.uk>.
Tom,
Could you be more specific about the type of 'Element' here. I am just
getting into this and I am having a similar problem to Senthil.
Kind Regards,
Martin
At 08:14 AM 5/11/2001 -0400, you wrote:
>I think this is becoming a FAQ...you have two choices, really, maybe three.
> (1) Make your service method return an Element, in which case (if you trace
> with tcptunnelgui, for example) you'll have the XML going through;
> (2) let the < and so forth flow, but do replacements on the resulting
> string on the clientside, then do a loadXML of that string (which I
> think always gets you into UTF-16, but otherwise is okay?)
> (3) write your own serializer for the object you are now returning as a
> string, and have it generate exactly what you want. Most likely
> redundant since the Element serializer should do that anyway.
>
>Tom Myers
>At 05:17 PM 5/11/2001 +0530, Senthil Kumar P wrote:
>
> >HI,
> > i am using MS SOAP in client side & APACHE SOAP in server side. when
> >i get XML String as response from APACHE SOAP TO MS SOAP , all the < ,>
> >tags have been conveted into < ,> .. IS THERE ANY METHOD TO GET THE
> >ORIGINAL XML STRING..
> >ANY HELP APPRECIATED.
> >
> >THANKS,
> >senthil
> >
> >
> >"Messengers ain't bothered, wherever you are..."
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> >For additional commands, email: soap-user-help@xml.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
Re: how can i get '<' & ' >' signs instead oF <
> when i receive a xml string in MS SOAP
Posted by Tom Myers <to...@dreamscape.com>.
I think this is becoming a FAQ...you have two choices, really, maybe three.
(1) Make your service method return an Element, in which case (if you trace
with tcptunnelgui, for example) you'll have the XML going through;
(2) let the < and so forth flow, but do replacements on the resulting
string on the clientside, then do a loadXML of that string (which I
think always gets you into UTF-16, but otherwise is okay?)
(3) write your own serializer for the object you are now returning as a
string, and have it generate exactly what you want. Most likely
redundant since the Element serializer should do that anyway.
Tom Myers
At 05:17 PM 5/11/2001 +0530, Senthil Kumar P wrote:
>HI,
> i am using MS SOAP in client side & APACHE SOAP in server side. when
>i get XML String as response from APACHE SOAP TO MS SOAP , all the < ,>
>tags have been conveted into < ,> .. IS THERE ANY METHOD TO GET THE
>ORIGINAL XML STRING..
>ANY HELP APPRECIATED.
>
>THANKS,
>senthil
>
>
>"Messengers ain't bothered, wherever you are..."
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
Re: how can i get '<' & ' >' signs instead oF <
> when i receive a xml string in MS SOAP
Posted by Tom Myers <to...@dreamscape.com>.
I think this is becoming a FAQ...you have two choices, really, maybe three.
(1) Make your service method return an Element, in which case (if you trace
with tcptunnelgui, for example) you'll have the XML going through;
(2) let the < and so forth flow, but do replacements on the resulting
string on the clientside, then do a loadXML of that string (which I
think always gets you into UTF-16, but otherwise is okay?)
(3) write your own serializer for the object you are now returning as a
string, and have it generate exactly what you want. Most likely
redundant since the Element serializer should do that anyway.
Tom Myers
At 05:17 PM 5/11/2001 +0530, Senthil Kumar P wrote:
>HI,
> i am using MS SOAP in client side & APACHE SOAP in server side. when
>i get XML String as response from APACHE SOAP TO MS SOAP , all the < ,>
>tags have been conveted into < ,> .. IS THERE ANY METHOD TO GET THE
>ORIGINAL XML STRING..
>ANY HELP APPRECIATED.
>
>THANKS,
>senthil
>
>
>"Messengers ain't bothered, wherever you are..."
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org