Web Service DataSource in Infopath

A

Arshad Syed

I am currently using Infopath 2007 (Beta 2). I have a valid Web Service which
returns a dataset and when I specifying it as the datasource for the infopath
form, I get the error:

"Infopath cannot find or cannot access the specified Web Service description.

The file is not a valid XML file
Access is denied."

Please help.

Thanks,
Arshad
 
A

Arshad Syed

I get the same message in Infopath 2003. The Web Service is generated from VS
2005. Below is my webservice:

using System;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;


[WebService(Namespace = "http://xyz.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
private DataSet dsHousehold;
private SqlConnection sqlConnection;
private SqlDataAdapter daHousehold;

public Service () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public DataSet HelloWorld() {

InitData();

return dsHousehold;
}

public void InitData()
{
string strConnection = "Data Source = rtnl4; Initial Catalog = XYZ;
Integrated Security = True";

sqlConnection = new SqlConnection(strConnection);

dsHousehold = new DataSet();

daHousehold = new SqlDataAdapter("select * from hh", strConnection);

SqlCommandBuilder sqlCmdBldr = new SqlCommandBuilder(daHousehold);

daHousehold.Fill(dsHousehold, "hh");
}

Thanks,
Arshad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top