473,698 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_gener ic_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 objXMLResponseD ocument As Xml.XmlDocument = New Xml.XmlDocument

strResponseData = "<?xml version='1.0' standalone='no' ?><!DOCTYPE
SMSRESPONSE SYSTEM 'response_gener ic_v1.dtd'>"
strResponseData += "<SMSRESPON SE>"
strResponseData += "<REQUESTID>HTT P_T1_ID0_R302</REQUESTID>"
strResponseData += "</SMSRESPONSE>"

objXMLResponseD ocument.LoadXml (strResponseDat a)
Return objXMLResponseD ocument

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.WriteLin e(objXMLRespons eDocument.Outer Xml)]
and the resulting flat file is correct.
Jan 26 '06 #1
2 1362
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*@discussion s.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_gener ic_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 objXMLResponseD ocument As Xml.XmlDocument = New Xml.XmlDocument

strResponseData = "<?xml version='1.0' standalone='no' ?><!DOCTYPE
SMSRESPONSE SYSTEM 'response_gener ic_v1.dtd'>"
strResponseData += "<SMSRESPON SE>"
strResponseData += "<REQUESTID>HTT P_T1_ID0_R302</REQUESTID>"
strResponseData += "</SMSRESPONSE>"

objXMLResponseD ocument.LoadXml (strResponseDat a)
Return objXMLResponseD ocument

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.WriteLin e(objXMLRespons eDocument.Outer Xml)]
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_gener ic_v1.dtd'><SMS RESPONSE><REQUE STID>HTTP_T1_ID 0_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*@discussion s.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_gener ic_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 objXMLResponseD ocument As Xml.XmlDocument = New Xml.XmlDocument

strResponseData = "<?xml version='1.0' standalone='no' ?><!DOCTYPE
SMSRESPONSE SYSTEM 'response_gener ic_v1.dtd'>"
strResponseData += "<SMSRESPON SE>"
strResponseData += "<REQUESTID>HTT P_T1_ID0_R302</REQUESTID>"
strResponseData += "</SMSRESPONSE>"

objXMLResponseD ocument.LoadXml (strResponseDat a)
Return objXMLResponseD ocument

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.WriteLin e(objXMLRespons eDocument.Outer Xml)]
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
7013
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 sample, it provides the feature to install service under LocalSystem account. What I need is to install service under some other certian account. By further studying the code, and MSDN...
7
712
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: service 1 - my service watches service 2 - windows service service 2 is stopped - service 1 starts service 2
9
7260
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 stopping. Please advise how to stop the service. Thanks, SP
3
56989
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 want to test this service on a Windows Server 2003 box that doesn't have the Visual Studio Command prompt. How do I go about installing the service on the Windows Server 2003 box? Thanks!
2
4676
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 of the service is not set (this can be checked by right-clicking on the service in the Services window (Admin tools>Services), choosing Properties, LogOn tab). In order to enable my service to launch a GUI at startup, I added the following lines...
4
3177
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
21737
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 webserver to see if service A needs to be updated. What service B does if it sees their is an update for service A is to download a new copy of the service A executable, stop service A, replace the executable with the new copy, and start service B...
3
6617
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
6738
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 xxx = new localhost.Service1(); localhost is not recognized by the compiler.
5
3303
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? Why do I need to set a property within my code to the service name? Are all these required or am I just doing this for consistency purposes?
0
9169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.