473,236 Members | 1,284 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,236 software developers and data experts.

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("C1"
&")"
set rs = server.CreateObject("ADODB.Recordset")

rs.CursorType = 3
rs.Open SQL, ConnDB

do while not rs.eof

set xml=server.createobject("MSXML2.DOMDocument.3.0")

set raiz=xml.createElement("clickAPI")
xml.appendchild(raiz)

set head=xml.createprocessinginstruction("xml","versio n='1.0
encoding='ISO-8859-1'")

xml.insertbefore head,raiz

set sendMsg=xml.createelement("sendMsg")
raiz.appendchild(sendMsg)

set api_id=xml.createelement("api_id")
api_id.Text = rs("id")
sendMsg.appendchild(api_id)

set user=xml.createelement("user")
user.Text = rs("user")
sendMsg.appendchild(user)

set password=xml.createelement("password")
password.Text = rs("password")
sendMsg.appendchild(password)

set to_ =xml.createelement("to")
to_.Text = rs("PhoneMobile")
sendMsg.appendchild(to_)

set text=xml.createelement("text")
text.Text = request.form("sms_message")
sendMsg.appendchild(text)

set from=xml.createelement("from")
from.Text = rs("from")
sendMsg.appendchild(from)

RS.MoveNext

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

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

set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")

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

objXMLHTTP.send xml

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

Dim RespText

Set xml = Server.CreateObject("Microsoft.XMLDOM")
Set root = xml.documentElement

' Allow the document to complete loading
xml.async = False
success = xml.loadXML(objXMLHTTP.responseText)
response.write objXMLHTTP.responseText

%>

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>pass</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.createprocessinginstruction("xml","versio n='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 2126
> - <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.codecomments.com> wrote in message
news:fe***************@mail.codecomments.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("C1")
&")"
set rs = server.CreateObject("ADODB.Recordset")

rs.CursorType = 3
rs.Open SQL, ConnDB

do while not rs.eof

set xml=server.createobject("MSXML2.DOMDocument.3.0")

set raiz=xml.createElement("clickAPI")
xml.appendchild(raiz)

set head=xml.createprocessinginstruction("xml","versio n='1.0'
encoding='ISO-8859-1'")

xml.insertbefore head,raiz

set sendMsg=xml.createelement("sendMsg")
raiz.appendchild(sendMsg)

set api_id=xml.createelement("api_id")
api_id.Text = rs("id")
sendMsg.appendchild(api_id)

set user=xml.createelement("user")
user.Text = rs("user")
sendMsg.appendchild(user)

set password=xml.createelement("password")
password.Text = rs("password")
sendMsg.appendchild(password)

set to_ =xml.createelement("to")
to_.Text = rs("PhoneMobile")
sendMsg.appendchild(to_)

set text=xml.createelement("text")
text.Text = request.form("sms_message")
sendMsg.appendchild(text)

set from=xml.createelement("from")
from.Text = rs("from")
sendMsg.appendchild(from)

RS.MoveNext

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

set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")

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

objXMLHTTP.send xml

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

Dim RespText

Set xml = Server.CreateObject("Microsoft.XMLDOM")
Set root = xml.documentElement

' Allow the document to complete loading
xml.async = False
success = xml.loadXML(objXMLHTTP.responseText)
response.write objXMLHTTP.responseText

%>

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>pass</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.createprocessinginstruction("xml","versio n='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
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...
12
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...
3
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...
1
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...
6
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...
9
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...
27
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: ...
1
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...
0
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...
3
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.