I have made a ASP.net Web Service which contains a service which takes no parameters. I would like to invoke the ASMX service directly from a URL query.
This is my service
[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public DataSet getXMLData()
{
string strQuery = "SELECT * FROM Products";
string strRootNode = "Root";
string strItemNode = "Item";
dbConn = dbConnString;
dbQuery = strQuery;
.
.
.
.
da.Fill(ds, strItemNode);
return ds;
}
This doesn't work
http://localhost:23147/ProductsWS.asmx?op=getXMLData
The page debug page for the service is displayed but it isn't invoked. I would like to be automatically invoked such that the query returns:
<Root xmlns="">
<Item diffgr:id="Item1" msdata:rowOrder="0">
<ModelName>Tree</ModelName>
<UnitCost>7.0000</UnitCost>
</Item>
<Item diffgr:id="Item2" msdata:rowOrder="1">
<ModelName>Stump</ModelName>
<UnitCost>13.0200</UnitCost>
</Item>
</Root>
How would I go about doing this?
getXmlDataoperation and submit it? Does it work? If so, then the URL it uses is the URL you need to use for the service. Also, you haven't said what "doesn't work" means.