WCF / ASMX :: Get Some Info From The Database?
Dec 22, 2010
i want to write a WCF service to get some info from the database. The service will be called by web application. SO first of all what type of WCF project should I use.. is it WCF Service Library or WCF Service application.
Next, where should I define the connection string? The connnection string that I use inside the web.config of my web application can be used or propogarted to my WCF service? Or SHould I define the connection string again in my WCF service..?
Any examples on WCF with ado.net examples? so I will know how to define connection strings and utilize the service inside my web app?
View 7 Replies
Similar Messages:
Apr 8, 2010
I have a (relatively) simple web service host. This ws exposes two methods: verify and processRequest.
Is there a way for the host to get information about where the request is coming from?
I am looking for things like IP Address, time/date sent, payload size (and maybe entire message size), etc...
I can not use custom SOAP headers, so I need to rely on whatever is in the default SOAP header.
I am writing my code in C#.
View 1 Replies
Jul 22, 2010
I'm building an ASP.NET MVC 2 site where I'm currently implementing an OpenID sign-up form. Unfortunately, I'm foreseeing a possible security bug/vulnerability inside my architecture.
Here's how I want OpenID login to work:
User requests /Account/Login, Controller sends back OpenIDLogin View. User enters their OpenID into the View, then OpenID authorization takes place, and finally the OpenID is returned to the Controller.The Controller checks whether the OpenID is currently in use by a user in the system or not. If it is, the user is logged in to that account. If not, the registration process begins.
And now, the OpenID registration process:
The OpenID identifier, as well as any other information provided by the OpenID provider (such as email address or name), is put into my custom ViewModel and sent to my OpenIDRegistrationForm View.The RegistrationForm View stores the OpenID in a hidden field to make sure that it gets sent back to the Controller.The user fills in the RegistrationForm View and sends it back to the Controller.The Controller creates the user account and puts the OpenID into the database.
The bug that I see within my architecture is that a user could modify the hidden value in the RegistrationForm View. Thus, they could spoof their OpenID! I will make sure to add another round of checking to the final Registration Controller Action to make sure that the OpenID that is provided doesn't exist yet, but there is still a possibility for spoofing. Can my architecture be improved somehow? I don't want this to end badly...
One solution I'm considering is encrypting the OpenID before I send it to the View and then decrypting it when it reaches the Controller. Should I try this?
View 1 Replies
Aug 5, 2010
I have a small Access database with some fields, like: date, name, text. Those fields are stored in a record inside MS Access. I also have an PDF file available belonging to that record as described before. I like to store the title of this PDF also in this record. Clicking by an user on this title should show the PDF file in a separate form. The pdf's are all stored in a map called e:pdfs and filename can be as needed. My questions are:
1. how should i bring the pdf names inside the record (like e:pdfsumber-one.pdf ? )
2. by clicking on this name the pdf file should be showed in a seperate form?
3. clicking means probably a javascript that handles the pdf file ?
4. can anyone give me some clues? I do work with VS2010 and framework 4
View 3 Replies
Nov 2, 2010
I have an entity called a file which is the main part of my project. The file has invoices and timesheets captured against it. So I have a file tab with info about the file, like FileNumber, Vessedl, Voyage etc. Now I need to be able to upload documents for the file. So I will add an uploads tab. But the uploaded documents need to be saved for the specified file the user uploads it for. then when a user opens a file I need to show the documents for that file in a list of some sort. the best way to do this. What's the best way to upload multiple files? should I store all the info in my database?
View 36 Replies
Jan 4, 2011
i had done the register page, now want to create the login page, but how to link these 2 things to make it able login from the customer database ? I m newbie of asp.net web application developer, i am using the visual studio 2008, C# to create the web site
View 6 Replies
Apr 2, 2011
i'm having problems with this. I am developing an asp.net mvc 2 application. I have a partial view menu.ascx defined. this gets included on all the pages of my site in the Site.Master masterpage. Now the thing is I want my menu to change according to the type of user.Here's what I did at first:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<li><%: Html.ActionLink("Home", "Index", "Home")%></li>
<% [code]....
I shouldn't be doing this in the view ! But since this is the MasterPage no controller actually calls it so I don't know where to put the info in the ViewData dictionnary or ViewModel to pass it to this masterpage.
View 1 Replies
Feb 4, 2011
I am Working on a ASP.net project(VB.net), i have a gridview to display names of "Patients". Each patient has a unique "labID",
I have stored the patients "diagnosis" information in seperate tables( stool,urine, blood etc)
what I need is to retrieve this info when I click on a patients name in gridview.
View 6 Replies
Jun 25, 2010
I have a databound repeater and in this repeater is an imageButton. How do I pass info from the database into the click event? For example, I've got the description, heading and price fields populating labels, but want the id to go into the imagebuttons click event in order to build a querystring.
View 6 Replies
Jan 8, 2011
i am having a problem. i want to get info on a package from database and get the software linked to that package.. my db looks like this.
[Code].....
View 1 Replies
Jan 4, 2011
Can we access a DB through Web Service?If yes wd u explain the difference with usual DB accessing with web page?
View 2 Replies
Jan 4, 2011
I am working on a website that uses SQL database. However, the database need to be populated every 24 hours by importing records from a text file. Can I use webservice to read text file and import records into database every night?
The Website will be in use 24 hours. Can Webservice still import records into database while website is being used?
View 1 Replies
Nov 10, 2010
I need to update a online class that is using Asp.net as it's base. I have to use flash because the test will use video as the teaching tool. I want to be able to communicate with a database to update scores through choices made in the flash programmed test. I am woundering if there is a easy way to do or not. I am a begginer in asp, but well versed in flash.
View 2 Replies
Jan 24, 2011
I am trying to using webservices to update the sql database table.
CustomerName.cs code
namespace SqlWebService
{
public class CustomerName
{
[Code]....
when I run it, the result is true but I cannot see the changes in the database!!
View 5 Replies
Apr 25, 2010
I have a requirement in which i have a database table which has 4 columns Id,Name,position,city.....now i have a form in which the user will be filling in the id and then the other three columns should auto populate ....now i want a web service which will make a data connection and get the Id from the form and then query the database and get the other three columns..i am pretty new to web services ..can somebody give me some heads up on how to achieve this...let me know if i have to provide more details.
View 8 Replies
Nov 28, 2010
[Code]....
WEB SERVICE
[Code]....
Insert data from a web service into an SQL database?
View 5 Replies
Mar 15, 2011
What is the best way to create a Contract that will consume multiple database records? The database records will have 20 fields and maximun of 1000 rows.
View 1 Replies
Aug 30, 2010
I have created a web service that authenticates with username and password, works fine.
Basically this one, http://msdn.microsoft.com/en-us/library/ff649647.aspx
Now I also want to connect to this web service using client certificates, works fine
http://msdn.microsoft.com/en-us/library/cc948997.aspx
But I would like to when authenticated via client certificates, connect that certificate to a user in the membership database. So that I can use Roles.IsUserInRole(...) and such.
I thought that, well if I implement a Custom certificate Validator http://msdn.microsoft.com/en-us/library/ms733806.aspx then I could check for example subject and map that against a created username in the membership database.
But in the class X509CertificateValidator public override void Validate(X509Certificate2 certificate) I don't have the same ability as when the user is authenticated
like
void OnAuthenticateRequest(object source, EventArgs eventArgs)
HttpApplication app = (HttpApplication)source;
Basically how can I do this
app.Context.User = new
GenericPrincipal(new
GenericIdentity(username,
"Membership Provider"),roles);
within
public override
void Validate(X509Certificate2 certificate)
and if that is not possible, can this be solved differently? Bottom line, how do I connect a client certificate to a user account in the membership database. Is there a MSDN article on how to do this?
View 1 Replies
Jan 19, 2010
I have a site in development with several web services (ASMX) that post important data to my database. When I navigate to the ASMX file in my browser, I can fill in the form with the parameters and post to the DB. If someone finds the URL to my WS, they can severely alter my database. I want to prevent people from being able to post to my WS publicly. So far, I've thought of two things that may but I'd like to know if there are any other ways:
Check to see if the HTTP Referrer to the WS method is the domain the WS is on Add an additional parameter called Key to all important WS methods and have this be an encrypted "password." Then encrypt my stored password on the WS side and compare if the keys match.
View 3 Replies
Jan 11, 2011
I created a Class library for WCS service (MyWCFServiceLibrary) to access data form my database. The database connection strings have been defined in Properties->Settings.settings. The endpoints are defined in the app.config. Tracing and logging is set to write to files on local server. This service is hosted by a .net web service. This webservice refrences the WCF service using MyWCFServiceLibrary.dll and MyWCFServiceLibrary.pdb. The web service is hosted in IIS. All this setup is working fine on the development environment.Now I want to deploy this in the QA environment. Since I am a newbie with WCF, I would appreciate some help on what needs to be done for deploying this on the QA server.1. Do I need to recompile the MyWCFServiceLibrary.dll after changing the connectionstring to point to QA database and tracing and loggint paths to the new server?2. Is there anything that needs to be done with end points or anything else?
View 1 Replies
May 5, 2010
if i have the web application with many pages like add order page, edit order page, and delete order page actually they also interact with the Sql Server 2008 and i also create web service page call Sales_Service.asmx. i know just i need to put something like query into Web Method in Sales_Service.asmx but i have a lot of queries, i don't know which query i should put into it and how the web page call the Sales_Services.asmx
View 2 Replies
Nov 10, 2010
On my page I have a dropdown for country.
On my asmx service I want to get the value of the dropdownlist to filter the next input which will be state/providence.
My code on the asmx:
[Code]....
I want to add another clause to the WHERE statement to restrict Country = @Country so I will need to get that value to the web service.
View 2 Replies
Nov 8, 2010
A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes). We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines. The customer is using Windows 2008.
We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it. The memory increases steadily - approximately 40K per client request. If the test app is paused, the memory remains the same. When it is closed, the memory drops. Explicit calling of GC.Collect does not drop the memory.
We have run the memory profiler on the service and the leak is all native memory. We have uninstalled/re-installed the Framework on one of the machines but no difference. To our knowledge all of the security and IIS settings are not modified. We have compared app pool, default web site and virtual directory properties to machines that have no problem and they are identical.
View 11 Replies
Aug 9, 2010
I m accessing another application by consuming webservice of that application. I m sending file to store and retrieving file from other dabatase. Web service is the only to access another application.Now, I want to delete the file using the same web service where I stored that file in the another database.I m getting exception and I m unable to figure it out.
View 2 Replies
Mar 17, 2011
I have a .net app developed in .net 4.0 version. And I implemented an asmx web service in this. Now I want to call one of the webservice method in another classis ASP application java script function.
View 2 Replies