473,394 Members | 1,785 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,394 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 2131
> - <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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.