I'm trying to post xml to a server using ServerXMLHTTPRequest from an
Dim objXML As New System.Xml.XmlDataDocument
objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
I know msxml from aspx is not suportet. Anyone have any ideas how to do
I'm puzzled as to why you'd *want* to do this, considering the flexibility of
the SOAP client in .Net. You may want to reevaluate.
However, if you truly need to do this, you need to use COM Interop. Add a
reference to your project for the MSXML type library, and then use the
objects that reference provides. You can't just use a .Net class (e.g.
System.Xml.XmlDataDocument) to hold a reference to a COM object.
Also, if you really need to use the COM objects, you may want to consider
the IXMLHTTPRequest class instead of the IServerXMLHTTPRequest, unless you're
doing a high traffic page, or you need to circumvent the WinInet stack (for
example, to override the proxy settings for outgoing traffic).
IXMLHTTPRequest is a bit simpler to use.
Erik J Sawyer
"(E-Mail Removed)" wrote:
> I'm trying to post xml to a server using ServerXMLHTTPRequest from an
> Dim objXML As New System.Xml.XmlDataDocument
> objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
> "https://secure1.revilution.dk/api/index.php", False)
> I know msxml from aspx is not suportet. Anyone have any ideas how to do
I try to loook another solution. I found System.Net.HttpWebRequest.
What do you thing about that? I didn't test it.
You can use System.Net.HttpWebRequest, but you'd have to do all the
formatting for the request, and parsing for the return result, yourself.
But the .Net framework provides all the infrastructure you need to call web
services, and it all works just fine from within an ASPX page or ASMX
service. All it takes is to add a web reference to your project within
Visual Studio. Studio will build a fully-functional SOAP client proxy
object, based on System.Web.Services.Protocols.SoapHttpClientProtoc ol.
Erik J Sawyer
"(E-Mail Removed)" wrote:
> I try to loook another solution. I found System.Net.HttpWebRequest.
> What do you thing about that? I didn't test it.
I tryed to look at 'IXMLHTTPReques' but I have a problem :0/
Dim HttpReq As New MSXML.IXMLHTTPReques
the problem is 'MSXML.IXMLHTTPReques'is dot defined.
IXMLHTTPRequest, and the rest of the MSXML classes, are COM objects. Not
..Net. Therefore, you have to use COM interop.
If you're using Visual Studio, it's pretty easy. In the Solution Explorer
window (normally the top-right pane, click the "Solution" tab), expand your
solution and right-click the "References" branch. Click "Add Reference". In
the dialog that comes up, choose the COM tab, and scroll down to Microsoft
XML (choose your preferred version; v4.0 is the latest general release, v5.0
ships only with Office 2003, and v6.0 is in beta to ship with Studio 2005).
Click Select to add the COM library to the bottom window, and click OK.
Studio will then auto-generate all the namespace and interop marshalling
stuff to give you full access to the COM classes. You can then use these
pretty much as any .Net class.
I still find it strange that you insist on going this route, though. You
should seriously consider using the SOAP client support built into the .Net
> I tryed to look at 'IXMLHTTPReques' but I have a problem :0/
> my code:
> Dim HttpReq As New MSXML.IXMLHTTPReques
> HttpReq.open("GET", "https://secure1.revilution.dk/api/index.php",False)
> the problem is 'MSXML.IXMLHTTPReques'is dot defined.
> I import:
> Imports System.Xml
> Imports System.Net
> Sent via .NET Newsgroups
Thnak you wery much for your answers.
I'm not expert in asp.net. I just started with it. I'm a student and
working on my projekt exam. We have be workong on this problem in 2 days
and wi still have a proble.
I have a question about SOAP - when I try to add webservice to use soap
I got a error message from the url.
The document at the url https://secure1.revilution.dk/api/index.php was
not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'WSDL Document' is 'There is an error in XML document (2,
This is our latest try:
Dim requestText As Object
Dim serverResponseText As Object
Dim xmlDoc As MSXML2.DOMDocument
Dim xmlHttp As MSXML2.XMLHTTP
xmlDoc = New MSXML2.DOMDocument
xmlHttp = New MSXML2.XMLHTTP
requestText = functionToXML(methodName, paramList) ' ok xml
we alaways get error in this line: xmlHttp.send(requestText)
Exception Details: System.Runtime.InteropServices.COMException: The
download of the specified resource has failed.
I added MSXML in my referances.
Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
requestText = functionToXML(methodName,paramList)
' Call the remote machine the request
objXML.open "POST", "https://secure1.revilution.dk/api/index.php",
' This is necessary for some implementations (ZOPE).
objXML.setRequestHeader "Content-type", "text/xml"
objXML.setRequestHeader "Content-lenght", len(requestText)
objXML.setRequestHeader "Connection", "close"