Reputation: 315
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?
Upvotes: 2
Views: 980
Reputation: 9530
This is the URL for calling your service:
http://localhost:23147/ProductsWS.asmx/getXMLData
Upvotes: 3