473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

NET Web Service and XML

Sam
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.
Jan 26 '06 #1
2 1351
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?

On Thu, 26 Jan 2006 15:42:05 -0000, Sam <Sa*@discussions.microsoft.com>
wrote:
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.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jan 29 '06 #2
Sam
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

"Antonio Dias" wrote:
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?

On Thu, 26 Jan 2006 15:42:05 -0000, Sam <Sa*@discussions.microsoft.com>
wrote:
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.


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

Jan 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hardy Wang | last post by:
Hi all: I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based ont the code...
7
by: Mike | last post by:
I want to create a windows service that will monitor another window service. what i need for the service to do is, if a service is stopped I need it to start the service back up example: ...
9
by: SP | last post by:
Hi All, I wrote a windows service which is supposed to stop after specified amount of time. I am calling OnStop() after specified time. OnStop() methods executed but I dont see the service...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
2
by: letibal | last post by:
Hello, I have written a windows service and created an installer for it. The service runs under the system accounts. When started, it launches a GUI. By default, the InteractiveProcess property...
4
by: kkt49 | last post by:
# vim: et sw=4 ts=8 sts from wxPython.wx import * import sys, os, time import pywintypes import win32serviceutil import win32service import win32event import win32process
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
20
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.