473,769 Members | 5,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

question about asp& xml application


a got this code in asp to construct a xml , to export it to a url
this is de asp code:

<%

SQL = "Select * from User where CodeUser in ("& request.form("C 1"
&")"
set rs = server.CreateOb ject("ADODB.Rec ordset")

rs.CursorType = 3
rs.Open SQL, ConnDB

do while not rs.eof

set xml=server.crea teobject("MSXML 2.DOMDocument.3 .0")

set raiz=xml.create Element("clickA PI")
xml.appendchild (raiz)

set head=xml.create processinginstr uction("xml","v ersion='1.0
encoding='ISO-8859-1'")

xml.insertbefor e head,raiz

set sendMsg=xml.cre ateelement("sen dMsg")
raiz.appendchil d(sendMsg)

set api_id=xml.crea teelement("api_ id")
api_id.Text = rs("id")
sendMsg.appendc hild(api_id)

set user=xml.create element("user")
user.Text = rs("user")
sendMsg.appendc hild(user)

set password=xml.cr eateelement("pa ssword")
password.Text = rs("password")
sendMsg.appendc hild(password)

set to_ =xml.createelem ent("to")
to_.Text = rs("PhoneMobile ")
sendMsg.appendc hild(to_)

set text=xml.create element("text")
text.Text = request.form("s ms_message")
sendMsg.appendc hild(text)

set from=xml.create element("from")
from.Text = rs("from")
sendMsg.appendc hild(from)

RS.MoveNext

xml.save (server.Mappath ("clickatell.xm l"))
Loop 'Volta ao Do while
'--------------------------------------------------------------------------------------------------------------

''' sending to Clicktell's system '''

set objXMLHTTP = CreateObject("M icrosoft.XMLHTT P")

objXMLHTTP.open "post", "http://api.clickatell. com/xml/xml", False

objXMLHTTP.send xml

'response.write "<xmp>" & objXMLHTTP.resp onseXML.xml & "</xmp>"

Dim RespText

Set xml = Server.CreateOb ject("Microsoft .XMLDOM")
Set root = xml.documentEle ment

' Allow the document to complete loading
xml.async = False
success = xml.loadXML(obj XMLHTTP.respons eText)
response.write objXMLHTTP.resp onseText

%>

the contructed xml is like this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <clickAPI>
- <sendMsg>
<api_id>id</api_id>
<user>user</user>
<password>pas s</password>
<to>phone</to>
<text>message </text>
<from>from</from>
</sendMsg>
</clickAPI>
when i send this to the url, the xml returns with this message:

<?xml version="1.0" ?>
- <clickAPI>
- <xmlErrorResp >
<fault>XML error: no element found at line 1</fault>
</xmlErrorResp>
</clickAPI>

does someone know what is happening in this code??
someone said to me that could be de the line:
set head=xml.create processinginstr uction("xml","v ersion='1.0
encoding='ISO-8859-1'"),but i dont know what to do about it..
i hope someone can help about this erro
-
felipe_az
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Jul 19 '05 #1
1 2168
> - <clickAPI>
- <sendMsg>
is there really a dash before the root document node?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"felipe_azv " <fe************ ***@mail.codeco mments.com> wrote in message
news:fe******** *******@mail.co decomments.com. ..
a got this code in asp to construct a xml , to export it to a url
this is de asp code:

<%

SQL = "Select * from User where CodeUser in ("& request.form("C 1")
&")"
set rs = server.CreateOb ject("ADODB.Rec ordset")

rs.CursorType = 3
rs.Open SQL, ConnDB

do while not rs.eof

set xml=server.crea teobject("MSXML 2.DOMDocument.3 .0")

set raiz=xml.create Element("clickA PI")
xml.appendchild (raiz)

set head=xml.create processinginstr uction("xml","v ersion='1.0'
encoding='ISO-8859-1'")

xml.insertbefor e head,raiz

set sendMsg=xml.cre ateelement("sen dMsg")
raiz.appendchil d(sendMsg)

set api_id=xml.crea teelement("api_ id")
api_id.Text = rs("id")
sendMsg.appendc hild(api_id)

set user=xml.create element("user")
user.Text = rs("user")
sendMsg.appendc hild(user)

set password=xml.cr eateelement("pa ssword")
password.Text = rs("password")
sendMsg.appendc hild(password)

set to_ =xml.createelem ent("to")
to_.Text = rs("PhoneMobile ")
sendMsg.appendc hild(to_)

set text=xml.create element("text")
text.Text = request.form("s ms_message")
sendMsg.appendc hild(text)

set from=xml.create element("from")
from.Text = rs("from")
sendMsg.appendc hild(from)

RS.MoveNext

xml.save (server.Mappath ("clickatell.xm l"))
Loop 'Volta ao Do while
'---------------------------------------------------------------------------
-----------------------------------
''' sending to Clicktell's system '''

set objXMLHTTP = CreateObject("M icrosoft.XMLHTT P")

objXMLHTTP.open "post", "http://api.clickatell. com/xml/xml", False

objXMLHTTP.send xml

'response.write "<xmp>" & objXMLHTTP.resp onseXML.xml & "</xmp>"

Dim RespText

Set xml = Server.CreateOb ject("Microsoft .XMLDOM")
Set root = xml.documentEle ment

' Allow the document to complete loading
xml.async = False
success = xml.loadXML(obj XMLHTTP.respons eText)
response.write objXMLHTTP.resp onseText

%>

the contructed xml is like this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <clickAPI>
- <sendMsg>
<api_id>id</api_id>
<user>user</user>
<password>pas s</password>
<to>phone</to>
<text>message </text>
<from>from</from>
</sendMsg>
</clickAPI>
when i send this to the url, the xml returns with this message:

<?xml version="1.0" ?>
- <clickAPI>
- <xmlErrorResp >
<fault>XML error: no element found at line 1</fault>
</xmlErrorResp>
</clickAPI>

does someone know what is happening in this code??
someone said to me that could be de the line:
set head=xml.create processinginstr uction("xml","v ersion='1.0'
encoding='ISO-8859-1'"),but i dont know what to do about it..
i hope someone can help about this error

--
felipe_azv
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jul 19 '05 #2

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

Similar topics

17
14793
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call web-service in a an asynchronous mode (with a callback function)? If so, how?
12
1789
by: SMAccount | last post by:
I have not used ASP before. Are there cookbook instructions for how to set up an asp directory structure. It is not clear to me how I must mark directories (virtual or physical), so they will all be considered to be part of the same application. Thanks.
3
1149
by: kellydotnetnewbie | last post by:
Does anyone know if it's safe to have an ASP application and an ASP.Net application running on the same server? They both use SQL databases and I don't want to cause any conflict when it is deployed.
1
1186
by: mrrrk | last post by:
We want to redevelop an ASP application that currently uses a third party COM object that accesses the contents of the ASP Application object. The COM object is the fornt end for an old IBM Universe Objects database and cannot really be modified. Is it possible for an ASP.NET app to 'spoof' the old ASP Application object so that the COM object can access the contents? Thanks in anticipation
6
2407
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need it to run using credentials supplied by the user. When using basic authentication this is not an issue since the user has to provide a user name and password. But I don't want to use basic authentication so I created a login form and I am using...
9
1893
by: Wayne Wengert | last post by:
I built an ASP application and it runs fine on my local IIS. I am trying to move the application to my web service (ISP) out on the internet. I've read several of the help articles but they all seem to think I am deploying to localhosts. I created a new directory on my web page and copied most of the files from the wwwroot subdirectory where my project exists. When I try to open the page (by pointing to "WebForm1.aspx in the new...
27
2561
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx page of my portal I get the following error: Mensaje de error del analizador: We can't load the type 'JULIAN.Global'.
1
1166
by: abdala.fernando | last post by:
I have problems running an asp.net page/s (a directory) that has to be inside an ASP 3.0 web site (So for the IIS it is a ASP application). The framework is working on the server, if i deploy the site with the debug version it works just fine. But when i make de release it gives me this error: Could not load the assembly 'xxx'. Make sure that it is compiled before accessing the page. I can't create a diferent application for the...
0
1034
by: ssskartik | last post by:
I have a com dll that takes ASP Application object as one of the parameters and performs processing. We are doing a brute force conversion of our application from asp to asp.net. We have created a RCW (run time callable wrapper) for the com object and have instantiated it, now when we call this specific method passing the Application object as a parameter, I receive the following compiler error -: ...
3
3745
by: mgsmario | last post by:
Hi Guys I have an ASP application that connects to an Oracle database, right now I'm trying to connect this same ASP application to a DB2 database (Express-C, version 9.5.0). I'm in the process of trying to translate all the programing withing asp pages, so, can interact smoothly with db2. Now, I have problems trying to use a stored procedure (db2) and call it from my asp application. Here's part of my procedure:
0
9583
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10210
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
10039
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
9990
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
8869
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
6668
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
5297
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
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3560
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.