WCF / ASMX :: Access/pass Parameters To A Web Service WITHOUT A (general) Form?
May 15, 2010
I am a newbie to ASP.NET (but not to C#)I have a project I am developing that may seem unconventional at this point but it is a project that I hope to eventually expand and provide a new type of service on the internet. Currently the project makes use of an Excel spreadsheet that is generated by another application I wrote. Basically the spreadsheet is an index to a specific type of file that exists on a host computer and the files are directly linked from within the excel document. When the link is clicked it opens the file using the operating system default program which then processes the file (this takes some time).
This is fine and dandy but when I click on another file, the default program immediately stops processing one file and opens the latest submission and thus interrupting the previous job. To prevent this I am now writing a queuing application. Here is where ASP.NET comes in. I do not want the link to open the queuing application with the file to add into the queue as a parameter because that pops one or more nnoying/scary "you are opening an executable" dialogs and because I want to be able to access the queuing service from a remote computer, and possibily in the future over the web. Instead I am trying to use an ASP.NET service application that will accept the name of a file as a parameter, access the external queue class (defined in an external dll of which only one universal instance is allowed), and add the request to the queue. Whether or not the table is an excel table or on a web page, using a form in this instance is tedious, not only for me but for a user. I want the user to be able to simply click on an html link and have the file be queued without anything except maybe a confirmation page pop up saying that the file has been queued and it will take x amount of time before the file is finished processing.
My problem is I cannot for the life of me find a way to do this. I have searched the interenet for over a week now looking for a way to call a "WebMethod" using a link and I am getting the impression that it cannot be done. Even when I use a form and try to have the form pass a string (representing the file name) as its "action" it comes up with an application error saying that I am missing the parameter I am trying to pass. Here are some examples of what I have tried:Here an example method I would try to access:
[Code]....
Here is an example of how I tried to access directly by way of a link (which results in an application error: InvalidOperationException)"
[Code]....
View 3 Replies
Similar Messages:
Jun 16, 2010
Web service is referenced fine (called "tuWs") and I can refer to it in standard web form code behind:
Dim myWs As tuWebSvc.tuWs = New tuWebSvc.tuWs
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 25, 2010
My WCF Client calls my WCF Service which then calls ASMX Web Service. The problem is i have configured my wcf client and wcf service to windows credentials type but when wcf service calls asmx service the user credentials (default windowsidentity) is not passed to asmx service.
In WCF Service i am able to get user identity by using : Thread.CurrentPrincipal.Identity.Name;
WCF Service - i have disabled anonymous access and enabled windows authentication. ASMX Web Service - i have disabled anonymous access and enabled windows authentication.
WCF Service Config
[Code]....
View 1 Replies
Jan 4, 2011
i am working in the webservice project. I have one project when i run it then shows the text box for parameters and return the result after passing the parameters.
But another webservice does not allow me to enter the paramerters when execute then list of methods displayed and then show the soap xml when click at any method.
what difference found in both webserivces are Excuting-one that have the Text boxes: Test: "To test the operation using the HTTP POST protocol, click the 'Invoke' button."
2nd One Not provide the parameter text boxes: Test: "The test form is only available for methods with primitive types as parameters"
Dont know how to fix that. Because i want to debug the webservice and as i am unable to provide the parameter then how can i fix it.
how can i pass the parameters in the 2nd webservice as it has different information mentioned above.
View 1 Replies
Jan 18, 2011
For example, we are going to consume web method GetEmployeeByQuery(ConnInfoXML, Query, RecordDetail), ConnInfoXML is login information in XML, Query is a SQL statement selecting records, RecordDetail is all records retrieved. All data are in XML format.
So how to write these parameters in XML to consume this web method and get all the information in XML, and then transfer XML to normal string format ?
View 1 Replies
Nov 6, 2010
Iīm using jQuery to make the ajax calls to web services. Iīm not using json, I want the information in XML. If I donīt pass parameters and I make the WS parameter less it works but if I want to pass a value as parameter (I tried int and string) it doesnīt work. Here is my code:
jQuery: [Code]....
The web service
[Code]....
The error that I get from firebug is an exception System.InvalidOperationException and it says that the parameter region_id is missing.It canīt be very difficult because it works without parameters but all the information I find in internet
View 5 Replies
Nov 4, 2010
I'd like to pass an object (Digital Persona featureset) to a web service. Can't seem to find a good way to serialize it.
View 4 Replies
Dec 22, 2010
May I know how to pass credential to SOAP web service? I tried to assign via Proxy.ClientCredentials but seem it is read only property.
View 4 Replies
Feb 10, 2011
I have a wcf service and method returns a string array as follows
[Code]....
How can I pass required multiple parametes (name, cuo, year ) to this service using ajax AutoCompleteExtender.
If I could not use autocopleteExtender what would be the best way to achieve this.
View 1 Replies
Jan 18, 2011
can Pass object in Rest Service Uri
View 1 Replies
Aug 2, 2010
I would like to pass xml document to a method in WCF service by client that server will get xmldocument,parse it and send back the xml response.What are best practice for thi?The xml document is conform to XSD so i would like to create managed type that represent the schema and then expose thatIf anybody has done it before or know any example please point it out so i can see it.
View 1 Replies
Nov 24, 2015
Cannot find a simple example that will call POST a service with username pass argument.
So, how to get the length of the service.
Code:
Dim encoder As ASCIIEncoding = New ASCIIEncoding
Dim data() As Byte = encoder.GetBytes(rawresp)
Dim request1 As HttpWebRequest = CType(WebRequest.Create("http://www.sas.gr/MobileService/MobileService.asmx?wsdl&op=getCinemaMoviesProgram"), HttpWebRequest)
request1.Method = "POST"
[Code] ...
Complains about wrong bytes. I can make it work with GET but i only get the schema.
Code:
Dim request = DirectCast(WebRequest.Create("http://www.sas.gr/MobileService/MobileService.asmx?wsdl&op=getCinemaMoviesProgram"), HttpWebRequest)
request.Method = "Get"
' request.ContentLength = 0
request.Credentials = New System.Net.NetworkCredential("WSl", "WSs")
Dim response1 = DirectCast(request.GetResponse, HttpWebResponse)
Dim reader = New StreamReader(response1.GetResponseStream())
Dim rawresp As String
rawresp = reader.ReadToEnd()
This will only give the schema back, no data. Also if i reference the service there is no getCinemaMoviesProgram function to call, so I suppose it only works with post.
View 3 Replies
Nov 1, 2010
How to implement form authentication wcf service?
View 1 Replies
May 24, 2010
I want to access simple web service inside WCF service. How can i achieve it?
View 2 Replies
Jun 9, 2010
Im using VS 2008, 3.5 framework I want to use wcf, but javascript cant access to myservice.svc error : Message: 'MapService' is undefined;
calling mapservice ;
function getselectedIl() {
var firstLetter =
"caglar";
var proxy =
new MapService();
proxy.GetSuggestions(firstLetter);
defining mapservice;
<asp:ScriptManager ID="ScriptManager2" runat="server">
<Services>
<asp:ServiceReference Path="MapService.svc" />
</Services>
</asp:ScriptManager>
mapservice.svc.cs;
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MapService
{
[OperationContract]
public string GetSuggestions(string firstLetter)
{
return "basarili";
}
}
View 6 Replies
Jun 29, 2010
I'm getting a strange data download from an Access database.Using Visual Web Developer 2010 Express, I created a web service that places records from an Access database in server cache and then reads the records, one at a time, from the cache. The data in the records is converted to a delimited string. The web service is called from an e-learning program called Toolbook that places Http Post calls to the web service. The web services uses vb and .Net Framework 2.0.
All works correctly with one exception. When a record in the Access db contains "&", it is downloaded to the Toolbook e-learning program as "&". If I place && in the record, I get "&&".If I download the data from the Access db using a classic.asp file rather than the web service, the "&" displays correctly.
View 2 Replies
Oct 3, 2010
I get this error when trying to access a self hosted wcf service...
[Code]....
Can someone explain what I need to do to get this to work, I do not have any cross domain policy file. And don't know how that is supposed to look like.
View 1 Replies
Sep 8, 2010
am new to webservice accessing from javascript.I call a webmethod from javascript which returns a string array. whith this array i bind a dropdown list at client.At dropdownList selectedIndexchanged event I found there is no item in DropDownList. Is there any way how to bind the DropDownList using webMethod so that on postback i can get the dropdowns item.
View 3 Replies
Feb 5, 2011
I tried to pass datetime from a textfile to the form and using it to get the classes from web service.
the site has 4 countries. based on the country value from session , i load the text file.
It works perfectly for 3 countries without any issues. but not for the fourth country.
View 3 Replies
Feb 4, 2011
I have a web service which is accessible from the browser. When I try to access the same web service which is hosted on Windows Server 2008 R2, from an excel Macro, it says
Run-time error '-2147220991' (80040201)':
Server was unable to process request --> The request failed with HTTP status 404: Not Found.
The excel macro works fine when I try to access the same web service on the other server(Windows 2000 Server)
The web service is developed using .Net 2.0.
I'm posting the URL for the web service for your reference.
URLs which are not being accessible from Excel.
[URL]
[URL]
URLs which are being accessible from Excel.
[URL]
[URL]
Both Web services and Excel macros are old applications which have been running fine for years. The only change is that the application is being migrated to a new server(MCDEAGDWEB202) which has Windows Server 2008 R2 and SQL Server 2008.
The Old server(MCDEAGLWEB005B) has Windows Server 2000 and SQL Server 2000.
View 4 Replies
May 28, 2010
I have added a web service as a reference to a windows application using "AddWebRefrence" option. And I am unable to access the funtions in the web service but instead i get the functionnames followed by the completedeventargs and completedeventhandler.
What am I doing wrong and how can i access the funtions in the web service.
View 3 Replies
Aug 4, 2010
have two different applications. The only access between those two applications is Web Service.I want to delete records in the another application database by passing primary key of that table.I don't have access to database where I have to delete the records.For this, where I have to write the delete functionality.? In web service or or in my application.
View 14 Replies
Apr 29, 2010
How to Access Webservice Webmethod in Javascript
View 4 Replies
Oct 26, 2010
[Code]....
this method i can access using asp.net but not by using a android.. i have checked for the headers etc.. the response is OK in android while debugging but the data is not inserted..
what is the equivalent of stringbuilder in android??
in android i use
StringEntity se = new StringEntity(json.toString());
//and post the data to my service...
post.setEntity(se);
what is the equivalent of stringentity in C# and what can i do for this prob?
View 2 Replies