Wednesday, March 28, 2012
Web Service & SQL Server Authentication
I have this weird problem. I created a Web Service that extracts data from the SQL Server and then return it as a XML document.
The problem is when the Web Service gets to the code to open the Connection to the server it gives this error.
System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Now my Win32 application works just fine, using the same code. Thus I believe the problem might be the settings of IIS.
But unfortunately I don't even know where to start looking.
Some help would really be appreciated.
Thanx in advanceIf you are trying to open a connection via sql server authentication (note: not windows), you need to grant access to that account in your db. If you are using windows authentication, you need to grant access to the asp.net account.
Sorry misread
Monday, March 26, 2012
Web Service as function return value
based live Web Service.
When testing numerous web forms I need to switch their Web Service reference between a local development service and the live one.
At the moment this involves replacing the declaration 'TestWebService' with 'LiveWebService' in each form.
What I would like to do is have a utilities class that has a static function
that returns a reference to the appropriate web service depending upon a key
in web.config.
I would be able to do this if I knew how to declare the return value of the
function:
internal static ???? GetWebService()
{
string lstrWebService =
ConfigurationSettings.AppSetting["WebService"].ToString();
if(lstrWebService == "Test")
{
return ????;
}
else
{
return ????;
}
}
Anyone know what the ???s should be or if what I want is not possible.What do you mean by returning a "a reference to the appropriate web service"? Can you show me an example?
What do you mean by returning a "a reference to the appropriate web service"? Can you show me an example?
I've got 2 Web Services referenced and I wanted to switch between them, but I now realise that this is totally the wrong way to do it!!!
I'm going to have only one service referenced and change its URL when necessary. All I need to do is ensure that the services maintain the same contracts.
A real blonde moment, or moments 'cos I've been doing it wrong for ages. :blush:
I was thinking along the same lines but your initial post confused me (with the Return values). The only thing that did require changing, as you've seen, was the .URL property...
Thursday, March 22, 2012
Web service returns blank page!
Hi there...apology...not sure if I am posting to the right forum!
I have been trying to consume a web service(third party)... which should return data about an applicant(credit history)...I also have a form that send parameters(name address and the likes) These are accepted(apparently) and I do not get any errors but I do not get any data either!! could someone help??
here is the code I am using:
1<%@dotnet.itags.org. Page Language="VB"%>2<script runat="server">3Protected Sub submit_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)4Dim apiProxyAs creditAPI.creditAPI =New creditAPI.creditAPI()5Dim apiCRAs creditAPI.CT_apicr =New creditAPI.CT_apicr67 apiProxy.Url ="Url"89' Create a new credentials object and attach it to the proxy object.10Dim apiCredentialsAs creditAPI.CT_credentials =New creditAPI.CT_credentials11 apiCredentials.company ="company"12 apiCredentials.username ="user"13 apiCredentials.password ="pswd"14 apiProxy.credentials = apiCredentials1516' Create a new action object and attach it to the proxy object17 apiProxy.action =New creditAPI.ST_action18 apiProxy.action.Text =New String() {"urn:credit.co.uk/api5/actions/5305"}1920' Create a new credit request object and attach it to the apicr object.21Dim apiCreditRequestAs creditAPI.CT_apicreditrequest =New creditAPI.CT_apicreditrequest22 apiCreditRequest.purpose = creditAPI.ST_searchpurpose.CA23 apiCreditRequest.score = 124 apiCreditRequest.scoreSpecified =True25 apiCreditRequest.transient = 026 apiCreditRequest.transientSpecified =True27 apiCR.creditrequest = apiCreditRequest2829' Create a new request applicant object and attach it to the credit request object.30Dim apiRequestApplicantAs creditAPI.CT_apirequestapplicant =New creditAPI.CT_apirequestapplicant31'apiRequestApplicant.dob = Me.txtDoB.Text32 apiRequestApplicant.dobSpecified =False33'apiRequestApplicant.hho = Convert.ToByte(Me.chkHHO.Checked)34 apiRequestApplicant.hhoSpecified =True35'apiRequestApplicant.tpoptout = Convert.ToByte(Me.chkTPOptout.Checked)36 apiRequestApplicant.tpoptoutSpecified =True3738' Create a new name object and attach it to the request applicant object.39Dim apiNameAs creditAPI.CT_name =New creditAPI.CT_name40 apiName.title =Me.txtTitle.Text41 apiName.forename =Me.txtForename.Text42 apiName.surname =Me.txtSurname.Text43 apiRequestApplicant.name =New creditAPI.CT_name() {apiName}4445' Create a new input address object and attach it to the request applicant object.46Dim apiInputAddressAs creditAPI.CT_inputaddress =New creditAPI.CT_inputaddress47 apiInputAddress.premiseno =Me.txtPremiseNum.Text48 apiInputAddress.postcode =Me.txtPostcode.Text49 apiRequestApplicant.address =New creditAPI.CT_inputaddress() {apiInputAddress}50 apiCreditRequest.applicant =New creditAPI.CT_apirequestapplicant() {apiRequestApplicant}51Dim inpAs New creditAPI.CT_apicr52 apiProxy.Job5305(apiCR)53End Sub5455 </script>Thanks,
Critical5
I suggest you to contact your web service provider to find out what the problem is, because "a blank page" usually indicates that the service cannot process request due to an exception, but of course the provider does not want you to see the stack trace due to obvious security reasons.
Also, you can refer to the api documentation and examples, which I believe are provided with the api.
Web Service SOAP Question
am currently trying to access the return value of this method through
a page which has not got the proxy.dll referenced. i.e. as if this
request is from an external company. at the moment my method is
returning the whole SOAP return message as a string. 2 questions
please:
1. how do i just get the value of the node CLIENTCODE. this is the
return parameter of my web service method so this is all i am
interested in, not the whole SOAP message.
2. my code below does not use the SoapExtension class. is my code
below wrong? is there a better way to send and receive data using
SOAP?
here is my method:
XmlDocument doc = new XmlDocument();
doc.Load(xmlfile);
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create(@dotnet.itags.org."http://localhost/test/webservicebridge/bridgeservice.asmx");
if (proxy != null)
req.Proxy = new WebProxy(proxy, true);
req.Headers.Add("SOAPAction",
@dotnet.itags.org."http://localhost/webservices/GetClientCode");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
string s = (r.ReadToEnd());You're going to a lot of unnecessary trouble here. The .Net platform has
built-in functionality for consuming Web Services. Basically, a Web Service
is a remote method call. A .Net method returns an object, whether that
object is a string, an integer, a class, or any other data type. In other
words, a Web Service returns an object in the same way that any other method
returns an object. The only difference is that the return value of a Web
Method is serialized. You de-serialize it back into an object. However, the
..Net framework has built-in functionality for doing this transparently. The
following is an MSDN article which demonstrates consuming a DataSet from a
Web Service. Note, however, that the return type isn't important. The
methodology is the same:
http://msdn.microsoft.com/library/d...mwebservice.asp
If you have Visual Studio.Net, creating your proxy is rather simple to do as
well. It is done by adding a Web Reference to your References. Visual
Studio.Net will build the proxy for you.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Wee Bubba" <martinthrelly@.yahoo-dot-com.no-spam.invalid> wrote in message
news:412620e3$1_1@.Usenet.com...
> i have created a web service with one method which returns a code. i
> am currently trying to access the return value of this method through
> a page which has not got the proxy.dll referenced. i.e. as if this
> request is from an external company. at the moment my method is
> returning the whole SOAP return message as a string. 2 questions
> please:
> 1. how do i just get the value of the node CLIENTCODE. this is the
> return parameter of my web service method so this is all i am
> interested in, not the whole SOAP message.
> 2. my code below does not use the SoapExtension class. is my code
> below wrong? is there a better way to send and receive data using
> SOAP?
> here is my method:
> XmlDocument doc = new XmlDocument();
> doc.Load(xmlfile);
> HttpWebRequest req = (HttpWebRequest)
WebRequest.Create(@."http://localhost/test/webservicebridge/bridgeservice.asm
x");
> if (proxy != null)
> req.Proxy = new WebProxy(proxy, true);
> req.Headers.Add("SOAPAction",
> @."http://localhost/webservices/GetClientCode");
> req.ContentType = "text/xml;charset=\"utf-8\"";
> req.Accept = "text/xml";
> req.Method = "POST";
> Stream stm = req.GetRequestStream();
> doc.Save(stm);
> stm.Close();
> WebResponse resp = req.GetResponse();
> stm = resp.GetResponseStream();
> StreamReader r = new StreamReader(stm);
> string s = (r.ReadToEnd());
"Wee Bubba" <martinthrelly@.yahoo-dot-com.no-spam.invalid> wrote in message
news:412620e3$1_1@.Usenet.com...
> here is my method:
Aren't you using Visual Studio? If you are, there's really no need for you
to do any of this, as it's all taken care of for you...
Web Service SOAP Question
am currently trying to access the return value of this method through
a page which has not got the proxy.dll referenced. i.e. as if this
request is from an external company. at the moment my method is
returning the whole SOAP return message as a string. 2 questions
please:
1. how do i just get the value of the node CLIENTCODE. this is the
return parameter of my web service method so this is all i am
interested in, not the whole SOAP message.
2. my code below does not use the SoapExtension class. is my code
below wrong? is there a better way to send and receive data using
SOAP?
here is my method:
XmlDocument doc = new XmlDocument();
doc.Load(xmlfile);
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create(@dotnet.itags.org."http://localhost/test/webservicebridge/bridgeservice.asm
x");
if (proxy != null)
req.Proxy = new WebProxy(proxy, true);
req.Headers.Add("SOAPAction",
@dotnet.itags.org."http://localhost/webservices/GetClientCode");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
string s = (r.ReadToEnd());You're going to a lot of unnecessary trouble here. The .Net platform has
built-in functionality for consuming Web Services. Basically, a Web Service
is a remote method call. A .Net method returns an object, whether that
object is a string, an integer, a class, or any other data type. In other
words, a Web Service returns an object in the same way that any other method
returns an object. The only difference is that the return value of a Web
Method is serialized. You de-serialize it back into an object. However, the
.Net framework has built-in functionality for doing this transparently. The
following is an MSDN article which demonstrates consuming a DataSet from a
Web Service. Note, however, that the return type isn't important. The
methodology is the same:
http://msdn.microsoft.com/library/d...mwebservice.asp
If you have Visual Studio.Net, creating your proxy is rather simple to do as
well. It is done by adding a Web Reference to your References. Visual
Studio.Net will build the proxy for you.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Wee Bubba" <martinthrelly@.yahoo-dot-com.no-spam.invalid> wrote in message
news:412620e3$1_1@.mcse.ms...
> i have created a web service with one method which returns a code. i
> am currently trying to access the return value of this method through
> a page which has not got the proxy.dll referenced. i.e. as if this
> request is from an external company. at the moment my method is
> returning the whole SOAP return message as a string. 2 questions
> please:
> 1. how do i just get the value of the node CLIENTCODE. this is the
> return parameter of my web service method so this is all i am
> interested in, not the whole SOAP message.
> 2. my code below does not use the SoapExtension class. is my code
> below wrong? is there a better way to send and receive data using
> SOAP?
> here is my method:
> XmlDocument doc = new XmlDocument();
> doc.Load(xmlfile);
> HttpWebRequest req = (HttpWebRequest)
>
WebRequest.Create(@."http://localhost/test/webservicebridge/bridgeservice.asm
x");
> if (proxy != null)
> req.Proxy = new WebProxy(proxy, true);
> req.Headers.Add("SOAPAction",
> @."http://localhost/webservices/GetClientCode");
> req.ContentType = "text/xml;charset=\"utf-8\"";
> req.Accept = "text/xml";
> req.Method = "POST";
> Stream stm = req.GetRequestStream();
> doc.Save(stm);
> stm.Close();
> WebResponse resp = req.GetResponse();
> stm = resp.GetResponseStream();
> StreamReader r = new StreamReader(stm);
> string s = (r.ReadToEnd());
>
"Wee Bubba" <martinthrelly@.yahoo-dot-com.no-spam.invalid> wrote in message
news:412620e3$1_1@.mcse.ms...
> here is my method:
Aren't you using Visual Studio? If you are, there's really no need for you
to do any of this, as it's all taken care of for you...
Web Service throws 401 Error when consumed
works and the data is returned in XML format from the database and displayed
on the web page as well when this web service called getsampledata is
invoked. Now I create a web page and created a webservice using the web
reference technique in the VS .NET to consume this web service. The web
page (application), web server, web service and database are on the same
box. Here is where my problems start. I keep getting this error message
reproduced here.
System.Net.WebException: The request failed with HTTP status 401: Access
Denied. at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClient
Message message, WebResponse response, Stream responseStream, Boolean
asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters) at
WebPageWebServiceTest.HPSD.Service1.GetSampleData( ) in
C:\Inetpub\wwwroot\WebPageWebServiceTest\Web
References\HPSD\Reference.cs:line 40 at
WebPageWebServiceTest.WebForm1.Button1_Click(Objec t sender, EventArgs e) in
c:\inetpub\wwwroot\webpagewebservicetest\webform1. aspx.cs:line 69
Name of the web page trying to consume the webservice =
WebPageWebServiceTest
Name of the webservice HPSD.Service1.GetSampleData().
I have played around with the web config file and have the following working
web.conifg parameters
<authentication mode="None" /
<identity impersonate="true" /
Same parameters on both the web.config files ie on the web service and web
page(application). The database has aspnet configured as a user. The
following line is the connection string details on the webservice
sqlConnectionString="Provider=SQLOLEDB.1;integratedsecurity=SSPI;Persis t
Security Info=False;Initial Catalog=XXX_DEV;Data Source=XXXX;
I just am not able to get past the error noted above.
I am wondering if anyone else has run into this problem. Any pointers/tips
much appreciated.
Thanks
SanjayDo you have anonymous access turned on for your web application? Here is a
knowledge base article that addresses this situation and may help:
http://support.microsoft.com/defaul...kb;en-us;811318
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Shell/UI
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Sanjay" <sanjay@.hp.com> wrote in message
news:3fb96917$1@.usenet01.boi.hp.com...
> I have written a web service to return information from the database. This
> works and the data is returned in XML format from the database and
displayed
> on the web page as well when this web service called getsampledata is
> invoked. Now I create a web page and created a webservice using the web
> reference technique in the VS .NET to consume this web service. The web
> page (application), web server, web service and database are on the same
> box. Here is where my problems start. I keep getting this error message
> reproduced here.
> System.Net.WebException: The request failed with HTTP status 401: Access
> Denied. at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClient
> Message message, WebResponse response, Stream responseStream, Boolean
> asyncCall) at
> System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
> methodName, Object[] parameters) at
> WebPageWebServiceTest.HPSD.Service1.GetSampleData( ) in
> C:\Inetpub\wwwroot\WebPageWebServiceTest\Web
> References\HPSD\Reference.cs:line 40 at
> WebPageWebServiceTest.WebForm1.Button1_Click(Objec t sender, EventArgs e)
in
> c:\inetpub\wwwroot\webpagewebservicetest\webform1. aspx.cs:line 69
> Name of the web page trying to consume the webservice =
> WebPageWebServiceTest
> Name of the webservice HPSD.Service1.GetSampleData().
>
> I have played around with the web config file and have the following
working
> web.conifg parameters
> <authentication mode="None" />
> <identity impersonate="true" />
> Same parameters on both the web.config files ie on the web service and
web
> page(application). The database has aspnet configured as a user. The
> following line is the connection string details on the webservice
> sqlConnectionString="Provider=SQLOLEDB.1;integratedsecurity=SSPI;Persis t
> Security Info=False;Initial Catalog=XXX_DEV;Data Source=XXXX;
> I just am not able to get past the error noted above.
> I am wondering if anyone else has run into this problem. Any
pointers/tips
> much appreciated.
> Thanks
> Sanjay
Thank you Chris
That took care of that problem. Really apprecate your help.
Now to figure out how to get the xml data out of the dataset and bind to the
datagrid.
Thanks again.
Sanjay
"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:%23R%23yaMerDHA.3180@.TK2MSFTNGP11.phx.gbl...
> Do you have anonymous access turned on for your web application? Here is a
> knowledge base article that addresses this situation and may help:
> http://support.microsoft.com/defaul...kb;en-us;811318
>
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows Shell/UI
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
> "Sanjay" <sanjay@.hp.com> wrote in message
> news:3fb96917$1@.usenet01.boi.hp.com...
> > I have written a web service to return information from the database.
This
> > works and the data is returned in XML format from the database and
> displayed
> > on the web page as well when this web service called getsampledata is
> > invoked. Now I create a web page and created a webservice using the
web
> > reference technique in the VS .NET to consume this web service. The
web
> > page (application), web server, web service and database are on the
same
> > box. Here is where my problems start. I keep getting this error message
> > reproduced here.
> > System.Net.WebException: The request failed with HTTP status 401:
Access
> > Denied. at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClient
> > Message message, WebResponse response, Stream responseStream, Boolean
> > asyncCall) at
> > System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
> > methodName, Object[] parameters) at
> > WebPageWebServiceTest.HPSD.Service1.GetSampleData( ) in
> > C:\Inetpub\wwwroot\WebPageWebServiceTest\Web
> > References\HPSD\Reference.cs:line 40 at
> > WebPageWebServiceTest.WebForm1.Button1_Click(Objec t sender, EventArgs e)
> in
> > c:\inetpub\wwwroot\webpagewebservicetest\webform1. aspx.cs:line 69
> > Name of the web page trying to consume the webservice =
> > WebPageWebServiceTest
> > Name of the webservice HPSD.Service1.GetSampleData().
> > I have played around with the web config file and have the following
> working
> > web.conifg parameters
> > <authentication mode="None" />
> > <identity impersonate="true" />
> > Same parameters on both the web.config files ie on the web service and
> web
> > page(application). The database has aspnet configured as a user. The
> > following line is the connection string details on the webservice
> > sqlConnectionString="Provider=SQLOLEDB.1;integratedsecurity=SSPI;Persis t
> > Security Info=False;Initial Catalog=XXX_DEV;Data Source=XXXX;
> > I just am not able to get past the error noted above.
> > I am wondering if anyone else has run into this problem. Any
> pointers/tips
> > much appreciated.
> > Thanks
> > Sanjay
You can bind to any class that supports the IEnumerable interface:
dataGrid.DataSource = dataSet;
dataGrid.DataBind();
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Shell/UI
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Sanjay" <sanjay@.hp.com> wrote in message
news:3fbaa330@.usenet01.boi.hp.com...
> Thank you Chris
> That took care of that problem. Really apprecate your help.
> Now to figure out how to get the xml data out of the dataset and bind to
the
> datagrid.
> Thanks again.
> Sanjay
> "Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
> news:%23R%23yaMerDHA.3180@.TK2MSFTNGP11.phx.gbl...
> > Do you have anonymous access turned on for your web application? Here is
a
> > knowledge base article that addresses this situation and may help:
> > http://support.microsoft.com/defaul...kb;en-us;811318
> > --
> > Chris Jackson
> > Software Engineer
> > Microsoft MVP - Windows Shell/UI
> > Windows XP Associate Expert
> > --
> > More people read the newsgroups than read my email.
> > Reply to the newsgroup for a faster response.
> > (Control-G using Outlook Express)
> > --
> > "Sanjay" <sanjay@.hp.com> wrote in message
> > news:3fb96917$1@.usenet01.boi.hp.com...
> > > I have written a web service to return information from the database.
> This
> > > works and the data is returned in XML format from the database and
> > displayed
> > > on the web page as well when this web service called getsampledata is
> > > invoked. Now I create a web page and created a webservice using the
> web
> > > reference technique in the VS .NET to consume this web service. The
> web
> > > page (application), web server, web service and database are on the
> same
> > > box. Here is where my problems start. I keep getting this error
message
> > > reproduced here.
> > > > System.Net.WebException: The request failed with HTTP status 401:
> Access
> > > Denied. at
> System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClient
> > > Message message, WebResponse response, Stream responseStream, Boolean
> > > asyncCall) at
> > > System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
> > > methodName, Object[] parameters) at
> > > WebPageWebServiceTest.HPSD.Service1.GetSampleData( ) in
> > > C:\Inetpub\wwwroot\WebPageWebServiceTest\Web
> > > References\HPSD\Reference.cs:line 40 at
> > > WebPageWebServiceTest.WebForm1.Button1_Click(Objec t sender, EventArgs
e)
> > in
> > > c:\inetpub\wwwroot\webpagewebservicetest\webform1. aspx.cs:line 69
> > > > Name of the web page trying to consume the webservice =
> > > WebPageWebServiceTest
> > > Name of the webservice HPSD.Service1.GetSampleData().
> > > > > I have played around with the web config file and have the following
> > working
> > > web.conifg parameters
> > > <authentication mode="None" />
> > > > <identity impersonate="true" />
> > > > Same parameters on both the web.config files ie on the web service
and
> > web
> > > page(application). The database has aspnet configured as a user. The
> > > following line is the connection string details on the webservice
> > sqlConnectionString="Provider=SQLOLEDB.1;integratedsecurity=SSPI;Persis t
> > > Security Info=False;Initial Catalog=XXX_DEV;Data Source=XXXX;
> > > > I just am not able to get past the error noted above.
> > > > I am wondering if anyone else has run into this problem. Any
> > pointers/tips
> > > much appreciated.
> > > > Thanks
> > > > Sanjay
> > >
Actually Chris I knew that and the web service is working now like a charm.
But thanks for the reply anyway.
Sanjay
PS I have a new question posted on this newsgroup which might 'ahem'
require your expertise/attention.
"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:%23OHVLAurDHA.2832@.TK2MSFTNGP11.phx.gbl...
> You can bind to any class that supports the IEnumerable interface:
> dataGrid.DataSource = dataSet;
> dataGrid.DataBind();
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows Shell/UI
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
> "Sanjay" <sanjay@.hp.com> wrote in message
> news:3fbaa330@.usenet01.boi.hp.com...
> > Thank you Chris
> > That took care of that problem. Really apprecate your help.
> > Now to figure out how to get the xml data out of the dataset and bind to
> the
> > datagrid.
> > Thanks again.
> > Sanjay
> > "Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
> > news:%23R%23yaMerDHA.3180@.TK2MSFTNGP11.phx.gbl...
> > > Do you have anonymous access turned on for your web application? Here
is
> a
> > > knowledge base article that addresses this situation and may help:
> > > > http://support.microsoft.com/defaul...kb;en-us;811318
> > > > > --
> > > Chris Jackson
> > > Software Engineer
> > > Microsoft MVP - Windows Shell/UI
> > > Windows XP Associate Expert
> > > --
> > > More people read the newsgroups than read my email.
> > > Reply to the newsgroup for a faster response.
> > > (Control-G using Outlook Express)
> > > --
> > > > "Sanjay" <sanjay@.hp.com> wrote in message
> > > news:3fb96917$1@.usenet01.boi.hp.com...
> > > > I have written a web service to return information from the
database.
> > This
> > > > works and the data is returned in XML format from the database and
> > > displayed
> > > > on the web page as well when this web service called getsampledata
is
> > > > invoked. Now I create a web page and created a webservice using
the
> > web
> > > > reference technique in the VS .NET to consume this web service.
The
> > web
> > > > page (application), web server, web service and database are on the
> > same
> > > > box. Here is where my problems start. I keep getting this error
> message
> > > > reproduced here.
> > > > > > System.Net.WebException: The request failed with HTTP status 401:
> > Access
> > > > Denied. at
> > > System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClient
> > > > Message message, WebResponse response, Stream responseStream,
Boolean
> > > > asyncCall) at
> > > > System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
> > > > methodName, Object[] parameters) at
> > > > WebPageWebServiceTest.HPSD.Service1.GetSampleData( ) in
> > > > C:\Inetpub\wwwroot\WebPageWebServiceTest\Web
> > > > References\HPSD\Reference.cs:line 40 at
> > > > WebPageWebServiceTest.WebForm1.Button1_Click(Objec t sender,
EventArgs
> e)
> > > in
> > > > c:\inetpub\wwwroot\webpagewebservicetest\webform1. aspx.cs:line 69
> > > > > > Name of the web page trying to consume the webservice =
> > > > WebPageWebServiceTest
> > > > Name of the webservice HPSD.Service1.GetSampleData().
> > > > > > > > I have played around with the web config file and have the following
> > > working
> > > > web.conifg parameters
> > > > <authentication mode="None" />
> > > > > > <identity impersonate="true" />
> > > > > > Same parameters on both the web.config files ie on the web service
> and
> > > web
> > > > page(application). The database has aspnet configured as a user. The
> > > > following line is the connection string details on the webservice
> > > > > sqlConnectionString="Provider=SQLOLEDB.1;integratedsecurity=SSPI;Persis t
> > > > Security Info=False;Initial Catalog=XXX_DEV;Data Source=XXXX;
> > > > > > I just am not able to get past the error noted above.
> > > > > > I am wondering if anyone else has run into this problem. Any
> > > pointers/tips
> > > > much appreciated.
> > > > > > Thanks
> > > > > > Sanjay
> > > > > > > >
Web Services
I need to write a webservice that will return user profile information. The information I need back is first name, last name, ID number. Where can I find some sample code?
Thanks
bthumber
Check out these links:
http://aspnet.4guysfromrolla.com/articles/062602-1.aspx
samples.gotdotnet.com/quickstart/aspplus/doc/webservicesintro.aspx
Hope this helps,
Vivek