Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / January 2006

Tip: Looking for answers? Try searching our database.

NET Web Service and XML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam - 26 Jan 2006 15:42 GMT
Hello all,

I have a requirement to to return a XML response for incoming posts to my
webservice. In addition, I can not write out to a file. I must process this
in memory. The XML response must be as follows

<xml version='1.0' standalone='no'?><!DOCTYPE SMSRESPONSE SYSTEM
'response_generic_v1.dtd'>
<SMSRESPONSE>
<REQUESTID>HTTP_T1_ID0_R302</REQUESTID>
<SMSRESPONSE>

-------------------------------------------------------------------------------------------
I coded a simple web service to see if i could return the right format as
follows

<WebMethod()> Public Function Sms() As Xml.XmlDocument
Dim strResponseData As String
Dim objXMLResponseDocument As Xml.XmlDocument = New Xml.XmlDocument

strResponseData = "<?xml version='1.0' standalone='no'?><!DOCTYPE
SMSRESPONSE SYSTEM 'response_generic_v1.dtd'>"
strResponseData += "<SMSRESPONSE>"
strResponseData += "<REQUESTID>HTTP_T1_ID0_R302</REQUESTID>"
strResponseData += "</SMSRESPONSE>"

objXMLResponseDocument.LoadXml(strResponseData)
Return objXMLResponseDocument

End Function

-------------------------------------------------------------------------------------------
When i call the function i get the following back
<?xml version="1.0" encoding="utf-8" ?>
<SMSRESPONSE>
<REQUESTID>HTTP_T1_ID0_R302</REQUESTID>
</SMSRESPONSE>

-------------------------------------------------------------------------------------------
I've tried everything to return the right format with no luck..

BTW: I added a few lines to dump the xml to a file before the return
[strOut.WriteLine(objXMLResponseDocument.OuterXml)]
and the resulting flat file is correct
Antonio Dias - 28 Jan 2006 23:52 GMT
don't know if this is going to sound stupid but why don't you try to  
return the string that you built instead of loading it to a XmlDocument  
and returning the document?

> Hello all,
>
[quoted text clipped - 41 lines]
> [strOut.WriteLine(objXMLResponseDocument.OuterXml)]
> and the resulting flat file is correct.

Signature

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Sam - 30 Jan 2006 14:58 GMT
When I was testing this I tried the return type as string.  The return string
type return the following:

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/SMSGateway/SMSClaim"><?xml version='1.0'
standalone='no'?><!DOCTYPE SMSRESPONSE SYSTEM
'response_generic_v1.dtd'><SMSRESPONSE><REQUESTID>HTTP_T1_ID0_R302</REQUESTID></SMSRESPONSE></string>

Thank you for your response.  However, I am still trying to find an answer.
/frown.

Thanks,

Sam

> don't know if this is going to sound stupid but why don't you try to  
> return the string that you built instead of loading it to a XmlDocument  
[quoted text clipped - 45 lines]
> > [strOut.WriteLine(objXMLResponseDocument.OuterXml)]
> > and the resulting flat file is correct.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.