ASP Classic XML GW Connection to ASP.NET

M

Martin Hansen

I have this code:
----------------------------
function funcLogin(orderType)
username = request.Form("username")
password = request.Form("password")
myxml = "<?xml version='1.0' ?>"
myxml = myxml & "<function>"
myxml = myxml & "<getlogin>"
myxml = myxml & "<username>" & username & "</username>"
myxml = myxml & "<password>" & password & "</password>"
myxml = myxml & "</getlogin>"
myxml = myxml & "</function>"
funcLogin = myxml
end function

set objXMLHttp = server.createobject("MSXML2.ServerXMLHTTP.3.0")
set objDOMDocument = server.createobject("MSXML2.DOMDocument.3.0")

dim requestXML

requestXML = funcLogin(OrderType)

objXMLHttp.Open "POST", "http://192.168.2.54/receive.asp", False
objDOMDocument.loadXML requestXML
objXMLHttp.Send objDomdocument

set objDOMDocumentResponse = server.createobject("MSXML2.DOMDocument.3.0")
objDOMDocumentResponse.loadXML objXMLHttp.responseText
-----------------

I need to write it, so it works in ASP.NET 3.5 (VB).

Someone who has an idea of what i'm doing wrong?
Best regard

Martin Hansen
Web Manager - Denmark
 
S

sloan

First off, using string concatenation in any year/technology is a horrible
way to create Xml.

........

Second....for something like this..you want to look at the XmlWriter class.

See
http://msdn2.microsoft.com/en-us/library/4d1k42hb(VS.71).aspx

as you migrate the code to dotnet, please don't repeat the string concat
mistake.

(I learned this the hard way too, so I'm not dogging you, just trying to
help).

......

Third.
Are you shipping hte xml off to a POST method?
See
http://samples.gotdotnet.com/quicks...s/clientPOST.src&file=CS\clientpost.cs&font=3
or
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/msg/5d13224a77b89add


...

But please, abandon the string concatenation practice.
 
S

Steven Cheng[MSFT]

Hi Martin,

From your description, I understand you're using a classic ASP page to send
XMLHTTP request to an ASP.NET Web page(with some data in XML format) and
you found it not work, correct?

As for the problem, I'd like to confirm some further things:

**What's the detailed error you've got (if the response return, you can
check the response content to see what's the error at application level)

**For the ASP.NET page side, is the ASP.NET page developed by you and also
controlled by you? Or do you have the permission to modify it?

If you have control over the server-side page(or modify it), I suggest you
change the ASP.NET page to an httphander. This is because for HTTP POST
request, ASP.NET page will check the viewstate info, this is different from
other server document tech(such as classic asp, jsp, ....). Therefore, you
may need to provide the Viewstate info in your request also. See the
following article which mentioned this:

#Screen Scraping, ViewState, and Authentication using ASP.Net
http://odetocode.com/Articles/162.aspx

If you use httphandler, there is no viewstate checking.

#How To Create an ASP.NET HTTP Handler by Using Visual C# .NET
http://support.microsoft.com/kb/308001

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
S

Steven Cheng[MSFT]

Hi Martin,

Have you got any further progress on this issue? If there is any further
questions, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: (e-mail address removed) (Steven Cheng[MSFT])
Organization: Microsoft
Date: Fri, 08 Feb 2008 03:58:42 GMT
Subject: RE: ASP Classic XML GW Connection to ASP.NET
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top