G
Guest
Hi everyone,
I'm trying to access a webservice (asmx) from an asp page and I'm having a
problem with the load below:
<%
Dim dblTax, strQuery, objRequest, objXMLDoc, strXMLwsURL, strXMLMessage
Set objRequest = Server.CreateObject("Microsoft.XMLHTTP")
Set objXMLDoc = Server.CreateObject("MSXML2.DOMDocument.4.0")
objXMLDoc.Async = False
strXMLwsURL = "http://localhost/asptest/OBWebSvc.asmx/GetDocGroups"
objRequest.Open "post", strXMLwsURL, False
objRequest.Send()
objXMLDoc.Load(objRequest.responseXML)
response.write objXMLDoc.ParseError.reason
%>
I get the error message 'XML document must have a top level element. '
The called webservice method(C#) returns data of class 'ArrayList'. When I
change the method return to a string ("i.e. Hello") it loads fine. Now I
access the webservice in VS.net using return val of 'ArrayList' and it also
works fine. It just doesn't work in the asp page. Heres a portion of my
asmx.cs file:
[WebMethod(Description="Retrieves an array of doctype groups")]
public string GetDocGroups()
public ArrayList GetDocGroups()
{
OBInterface ob = new OBInterface();
// return ob.GetDocGroupList(dsn, loginName, passWord);
return ob.GetDocGroupList();
// return "HELLO";
Any help would be much appreciated.
Dave
I'm trying to access a webservice (asmx) from an asp page and I'm having a
problem with the load below:
<%
Dim dblTax, strQuery, objRequest, objXMLDoc, strXMLwsURL, strXMLMessage
Set objRequest = Server.CreateObject("Microsoft.XMLHTTP")
Set objXMLDoc = Server.CreateObject("MSXML2.DOMDocument.4.0")
objXMLDoc.Async = False
strXMLwsURL = "http://localhost/asptest/OBWebSvc.asmx/GetDocGroups"
objRequest.Open "post", strXMLwsURL, False
objRequest.Send()
objXMLDoc.Load(objRequest.responseXML)
response.write objXMLDoc.ParseError.reason
%>
I get the error message 'XML document must have a top level element. '
The called webservice method(C#) returns data of class 'ArrayList'. When I
change the method return to a string ("i.e. Hello") it loads fine. Now I
access the webservice in VS.net using return val of 'ArrayList' and it also
works fine. It just doesn't work in the asp page. Heres a portion of my
asmx.cs file:
[WebMethod(Description="Retrieves an array of doctype groups")]
public string GetDocGroups()
public ArrayList GetDocGroups()
{
OBInterface ob = new OBInterface();
// return ob.GetDocGroupList(dsn, loginName, passWord);
return ob.GetDocGroupList();
// return "HELLO";
Any help would be much appreciated.
Dave