Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with sending html content as input in soap request

Status
Not open for further replies.

meeeeee

Programmer
Aug 20, 2005
2
DE
Hello,
I am trying to call a webservice which is deployed in axis in which I have to send a <html> content as a input string in the soap request.I am getting the response from the webservice but its not giving me the proper result .Its supposed to validate the sent <html> content and return the errors as an xml file.I get an xml file as response but it just returns an empty tag .So my guess was that its not actually taking the inout which I am sending .I am using javascript(ajax) inthe client side .


this is the string which i am sending in my javascript code,
var content="<html>"+"<head>"+"<title>"+"Welcome to the default publication"+"</title>"+"</head>"+"<body>"+kupu.getHTMLBody()+"</body>"+"</html>";

This is the soapbody which is send in my soap request,
<s:Body>
<x:check xmlns:x="<url> <content>
&lthtml>&lt;head>&lt;title>welcome to the default publication&lt;/title>&lt;head>
&lt;body>.............................
...............................
</content>
<contentType>html</contentType>
<encoding>iso-8859-1</encoding>
<ruleSet>WCAG 1.0 A</ruleSet>
</x:check>
</s:Body>

My soap response,
<checkReturn xmlns:soapenc=" xsi:type="soapenc:string">
&lt;document>
&lt;title>&lt;![CDATA[null]]>&lt;/title>
&lt;resourceURL>&lt;![CDATA[]]>&lt;/resourceURL>
&lt;validationReport>&lt;/validationReport>
&lt;cssCheckReport>&lt;/cssCheckReport>
&lt;ruleCheckReport rulesetId="null" rulesetName="null">&lt;/ruleCheckReport>
&lt;/document>
</checkReturn>

I am supposed to get something like this inside the validation report tag
<validationReport>
<error lineNumber="1" columnNumber="109">
<messageStr><![CDATA[Endtag für unvollständiges Element
"HEAD"]]></messageStr>
<codeSample><![CDATA[TR/html4/strict.dtd"><html><head></head><body><h1>Test</h1><h3>foo</h3></body></
^]]></codeSample>
</error>
</validationReport>


The < is automatically changed to &lt; .

I tried sending the content with <[CDATA[]]> and tried by giving > symbol with &gt; entity references but either way didnt work .My question is am I sending the html content in the right way ?If not what is the mistake I am making?How to send a <html> content as a soap input string in the soap request body?
I am completely new to all these technologies.
can anyone help me?It would be of great help to me.
Thanking you in advance.

regards,
robina
 
SOAP uses XML, and in XML the <, &, and > characters are reserved and must be escaped. Which is why you see them as &lt;, &amp;, and &gt;
As long as you're using an XML parser (DOM or SAX) to read & write this string, you'll be fine. Where you'll run into problems is when you try and treat it as an ordinary string, and do things like substring it, trim it, etc.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top