yazzy

yazzy

  • NA
  • 127
  • 0

type or namespace name 'ServerXMLHTTP' does not exist in the namespace 'MSXML2' (are you missing an assembly reference?)

Jan 31 2007 7:24 AM
Hi

I have to confess, this is the first time I am using this technology, and therefore I do need a bit of 'spoon feeding'

I have got the following references set-up

ADODB                                                GAC       7.0.3300.0

Interop.MSXML                                    BIN        2.0.0.0

Interop.MSXML2                                  BIN        2.6.0.0

Microsoft.Data.SqlXml                         GAC       9.0.242.0

Microsoft.SqlServer.msxml6_interop   GAC       6.0.0.0

Microsoft.SqlServer.XML.Task       GAC            9.0.242.0
Postcodeanywhere.lookup                 WEB

I am trying the following code to access a recordset

using System;

using System.Data;

using System.Data.OleDb;

using System.ComponentModel;

using System.Configuration;

using System.Collections;

using System.Collections.Specialized;

using System.Web;

using System.IO;

using System.Net;

using System.Xml;

using System.Xml.XPath;

using MSXML2;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public ADODB.Recordset GetRecordset(string URL)

{

MSXML2.ServerXMLHTTP objHttp = new MSXML2.ServerXMLHTTPClass();

objHttp.open("GET", URL, false, "", "");

objHttp.send(Type.Missing);

ADODB.Recordset rst = new ADODB.RecordsetClass();

rst.Open(objHttp.responseStream, null, ADODB.CursorTypeEnum.adOpenUnspecified, ADODB.LockTypeEnum.adLockUnspecified, -1);

return rst;

}
I am geeting the following error

Compiler Error Message: CS0234: The type or namespace name 'ServerXMLHTTP' does not exist in the namespace 'MSXML2' (are you missing an assembly reference?)

Source Error:

Line 33:     {
Line 34:        
Line 35:         MSXML2.ServerXMLHTTP objHttp = new MSXML2.ServerXMLHTTPClass();
Line 36:         objHttp.open("GET", URL, false, "", "");
Line 37:         objHttp.send(Type.Missing);

Source File: s:\Reg 3G Website\Compliant form\Testado.aspx.cs    Line: 35

Could anyone please help, I have been trying to understand theses issues assorted with
MSXML2.ServerXMLHTTP objHttp = new MSXML2.ServerXMLHTTPClass(); for a week without much success.

Thanks in advance