Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Post XML Https help PLEASE!

Reply
Thread Tools

Post XML Https help PLEASE!

 
 
DavidT
Guest
Posts: n/a
 
      09-07-2004
I need to build a valid XML file using ASP form elements, pass that "file"
to a https url and then retrieve the ID that is returned. I can build the
XML into a string no problem but how then heck do I go about
posting/retrieving?

I've come across something like this in my search:

Dim oXML, sURL
Dim sContents
sURL = "https://domain/page.asp"
Set oXML = CreateObject("MSXML2.ServerXMLHTTP")
oXML.Open "POST", sURL, False
oXML.SetRequestHeader "Content-Type","application/x-www-form-urlencoded"
oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
GetPostResponse = oXML.responseText
Set oXML = Nothing

But where would my XML string to post fit into this?

Driving me nutters. Any help is appreciated.

Thanks

David


 
Reply With Quote
 
 
 
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      09-07-2004
> oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
> GetPostResponse = oXML.responseText
> Set oXML = Nothing
>
> But where would my XML string to post fit into this?


Have you tried

oXML.Send
"txtUsername=Anthony&txtPassword=abcdefghi&xmlData VariableName=" & xmlData

? How is page.asp expecting to receive the XML data?

A


 
Reply With Quote
 
 
 
 
Jeff Cochran
Guest
Posts: n/a
 
      09-07-2004
On Tue, 7 Sep 2004 08:52:33 -0700, "DavidT" <(E-Mail Removed)>
wrote:

>I need to build a valid XML file using ASP form elements, pass that "file"
>to a https url and then retrieve the ID that is returned. I can build the
>XML into a string no problem but how then heck do I go about
>posting/retrieving?
>
>I've come across something like this in my search:
>
> Dim oXML, sURL
> Dim sContents
> sURL = "https://domain/page.asp"
> Set oXML = CreateObject("MSXML2.ServerXMLHTTP")
> oXML.Open "POST", sURL, False
> oXML.SetRequestHeader "Content-Type","application/x-www-form-urlencoded"
> oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
> GetPostResponse = oXML.responseText
> Set oXML = Nothing
>
>But where would my XML string to post fit into this?


oXML.Send YourXMLStringVariable

Jeff
 
Reply With Quote
 
DavidT
Guest
Posts: n/a
 
      09-07-2004
Thanks Both.

Page.asp is expecting preformated valid XML. I have a spec for that so I'm
not to concerned. Sending via XML is new to me. I'm used to just setting up
the DSN(less) connection and putting things directly into a db.

Can I do multuple sends?
oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
oXML.Send strXML


"DavidT" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I need to build a valid XML file using ASP form elements, pass that "file"
> to a https url and then retrieve the ID that is returned. I can build the
> XML into a string no problem but how then heck do I go about
> posting/retrieving?
>
> I've come across something like this in my search:
>
> Dim oXML, sURL
> Dim sContents
> sURL = "https://domain/page.asp"
> Set oXML = CreateObject("MSXML2.ServerXMLHTTP")
> oXML.Open "POST", sURL, False
> oXML.SetRequestHeader

"Content-Type","application/x-www-form-urlencoded"
> oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
> GetPostResponse = oXML.responseText
> Set oXML = Nothing
>
> But where would my XML string to post fit into this?
>
> Driving me nutters. Any help is appreciated.
>
> Thanks
>
> David
>
>



 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      09-07-2004
On Tue, 7 Sep 2004 10:16:26 -0700, "DavidT" <(E-Mail Removed)>
wrote:

>Thanks Both.
>
>Page.asp is expecting preformated valid XML. I have a spec for that so I'm
>not to concerned. Sending via XML is new to me. I'm used to just setting up
>the DSN(less) connection and putting things directly into a db.
>
>Can I do multuple sends?
>oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
>oXML.Send strXML


Haven't tried. I usually build the string then send it, but I'm doing
small amounts of XML. You could find out with a quick test of course.

Jeff


>"DavidT" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> I need to build a valid XML file using ASP form elements, pass that "file"
>> to a https url and then retrieve the ID that is returned. I can build the
>> XML into a string no problem but how then heck do I go about
>> posting/retrieving?
>>
>> I've come across something like this in my search:
>>
>> Dim oXML, sURL
>> Dim sContents
>> sURL = "https://domain/page.asp"
>> Set oXML = CreateObject("MSXML2.ServerXMLHTTP")
>> oXML.Open "POST", sURL, False
>> oXML.SetRequestHeader

>"Content-Type","application/x-www-form-urlencoded"
>> oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
>> GetPostResponse = oXML.responseText
>> Set oXML = Nothing
>>
>> But where would my XML string to post fit into this?
>>
>> Driving me nutters. Any help is appreciated.
>>
>> Thanks
>>
>> David
>>
>>

>


 
Reply With Quote
 
DavidT
Guest
Posts: n/a
 
      09-08-2004
Thanks to all. I managed to get this to work. My solution was:

Dim strXMLFile,objXml,ObjHTTP

Set objXml= Server.CreateObject("Microsoft.XMLDOM")
Set ObjHTTP = Server.CreateObject("MSXML2.XMLHTTP")

objXml.loadxml strXML

If objXML.parseError.errorCode = 0 Then

ObjHTTP.open "POST",
"https://www.trandotcom.com/LoanManager/QuickApp/QuickPost.ASPX", false
ObjHTTP.setRequestHeader "Content-type", "application/xml"
ObjHTTP.send strXML
Response.Write(ObjHTTP.responseText)
Else
Response.Write(objXML.parseError.errorCode &
objXML.parseError.reason)
End If

Thanks again


"DavidT" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I need to build a valid XML file using ASP form elements, pass that "file"
> to a https url and then retrieve the ID that is returned. I can build the
> XML into a string no problem but how then heck do I go about
> posting/retrieving?
>
> I've come across something like this in my search:
>
> Dim oXML, sURL
> Dim sContents
> sURL = "https://domain/page.asp"
> Set oXML = CreateObject("MSXML2.ServerXMLHTTP")
> oXML.Open "POST", sURL, False
> oXML.SetRequestHeader

"Content-Type","application/x-www-form-urlencoded"
> oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
> GetPostResponse = oXML.responseText
> Set oXML = Nothing
>
> But where would my XML string to post fit into this?
>
> Driving me nutters. Any help is appreciated.
>
> Thanks
>
> David
>
>



 
Reply With Quote
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      09-09-2004
What happened to txtUsername and txtPassword?

--
http://www.aspfaq.com/
(Reverse address to reply.)




"DavidT" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Thanks to all. I managed to get this to work. My solution was:
>
> Dim strXMLFile,objXml,ObjHTTP
>
> Set objXml= Server.CreateObject("Microsoft.XMLDOM")
> Set ObjHTTP = Server.CreateObject("MSXML2.XMLHTTP")
>
> objXml.loadxml strXML
>
> If objXML.parseError.errorCode = 0 Then
>
> ObjHTTP.open "POST",
> "https://www.trandotcom.com/LoanManager/QuickApp/QuickPost.ASPX", false
> ObjHTTP.setRequestHeader "Content-type", "application/xml"
> ObjHTTP.send strXML
> Response.Write(ObjHTTP.responseText)
> Else
> Response.Write(objXML.parseError.errorCode &
> objXML.parseError.reason)
> End If
>
> Thanks again
>
>
> "DavidT" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I need to build a valid XML file using ASP form elements, pass that

"file"
> > to a https url and then retrieve the ID that is returned. I can build

the
> > XML into a string no problem but how then heck do I go about
> > posting/retrieving?
> >
> > I've come across something like this in my search:
> >
> > Dim oXML, sURL
> > Dim sContents
> > sURL = "https://domain/page.asp"
> > Set oXML = CreateObject("MSXML2.ServerXMLHTTP")
> > oXML.Open "POST", sURL, False
> > oXML.SetRequestHeader

> "Content-Type","application/x-www-form-urlencoded"
> > oXML.Send "txtUsername=Anthony&txtPassword=abcdefghi"
> > GetPostResponse = oXML.responseText
> > Set oXML = Nothing
> >
> > But where would my XML string to post fit into this?
> >
> > Driving me nutters. Any help is appreciated.
> >
> > Thanks
> >
> > David
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
https post with xml data? Jonathan Rochkind Ruby 2 08-08-2009 05:33 AM
server side redirect https => https NOT working Axel ASP General 8 04-27-2009 02:02 AM
receive xml from https post in classic ASP c676228 ASP General 2 10-24-2007 09:30 PM
post xml over https connection brad Ruby 4 08-15-2007 02:55 PM
XML post via HTTPS Mallya ASP .Net 0 10-05-2004 03:09 PM



Advertisments