How To Pass Values To The Web Service

Jan 27, 2010

I would like to discuse with u, now i have one problem, ie, how could i pass value from the code behind to the web service, in that ,i have to pass 3 values,1, context key2, prefix text3, dropdown selected text or value, ( Contains Designation Details)how could i pass this 3rd value

View 1 Replies


Similar Messages:

AJAX :: How To Pass 2 Variable Values Using JavaScript To A Web Service

Mar 7, 2010

How can I pass two variable values to a web service web method using JavaScript and a DynamicPopulateExtender?

Some background of my issue:

I have a fully working cascading drop down list accessing a database.

My parent Cascading Drop Down List is a list of countries and the child displays the relative regions i.e.: USA returns Iowa, Maryland, Oregon etc.

I also have a 3rd Drop Down List control that allows the user to select the language to display the region details i.e.: Selecting the language of Chinese will return a list of regions of the USA in Chinese (held in the database).

I now want to display the translated country name from the 3rd Drop Down List in a label on the page.
I cannot just use the text from the country drop down list as this text value remains in English. The translated value must be returned from the database.

So far, I have installed a DynamicPopulateExtender:

[Code]....

I then wrote a web method (in the Cascading Drop Down local Web Service) to return the translated country name. To do this I have had to hard code the countryID (10663) and the translationLanguageID (1331) asshown below:

[Code]....

This does return the translated country name, but the variables are hard coded!

My question is how do I pass the countryID and the translationLanguageID to the Web Method GetTranslatedCountryName() from the DynamicPopulateExtender? Or even if there is a better way to achieve my task?

View 2 Replies

Unable To Pass User Credentials From WCF Web Service To ASMX Web Service

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

WCF / ASMX :: How To Pass Object To Web Service

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

WCF / ASMX :: How To Pass Credential To Web Service

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

C# - Can Pass Dataset To A Web Service Method

Feb 11, 2011

can we pass dataset to a web service method? If yes , then how?

View 3 Replies

Can Pass An Object Between Separated Applications By Web Service

Dec 26, 2010

I have a web service Writed By VB.net Lang return a DataSet Contain many rows , I tried to Call this Web Service From Java applicationput Java Language cant Deal with dataSet , So I need to Convert the Dataset to an Object

<WebMethod()> _
Public Function GetLogBook(ByVal EmployeeNumber As String, _
ByVal EmployeeName As String) As DataSet
Dim ds As New DataSet
Dim conn As New
[code]...

View 3 Replies

WCF / ASMX :: Can Pass Object In Rest Service Uri

Jan 18, 2011

can Pass object in Rest Service Uri

View 1 Replies

JQuery :: How To Pass A Request Header To A Web Service

Mar 1, 2011

īm trying to pass a header to a web service using jquery but i canīt. Iīm a NEWB at AJAX so please be gentle.

[Code]....

View 2 Replies

WCF Service - .net Hosting - Single Sign On, How To Pass Credentials

Jan 7, 2010

My scenario is this - I have two ASP.net websites. Both sites run on the same machine and I have implemented single sign on relatively simply using the default asp.net membership provider (Forms based authentication).I have a new WCF service on one site, which will be called from the other site. A user will be logged into the site, but the call to the service will be made from the codebehind following a postback.Can somebody point me in the right direction so that I can pass through the Forms based credentials of the logged in user to the WCF service on the other site? Presently it's passing the NETWORKSERVICE windows credentials.

View 2 Replies

Pass A String To A Web Service Using JQuery / JSON / AJAX?

Oct 29, 2010

As it is now I create a JavaScript object and then stringify it, put it in a hidden textbox and my code behind can read this string. I then use JSON.NET to parse the string which works fine. I now try to use ajax to post it to my web service but have some issues with how to send the string. I have tried many ways but gets the common errors like

Invalid JSON primitive: myString.

So I checked this out [URL] and it works with hard coded values but I want to use a variable.

JavaScsript to create the object:

for (var i = 0; i < results.rows.length; i++) {
var row = results.rows.item(i);
var customer = new Object();
customer.id = row['id']
customer.name = row['name']
var customerString = JSON.stringify(customer);
$.ajax({
type: "POST",
url: "synchronise.asmx/synchroniseCustomers",
data: "synchroniseCustomers: " + customerString,
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (xhr, status) {
alert("An error occurred: " + status);
},
success: function (msg) {
alert("success");
}
});
}

WebMethod:

public void synchroniseCustomers(string customerString)
{
JObject o = JObject.Parse(customerString);
string id = (string)o["id"];
string name = (string)o["name"];

If I use data: '{ FirstName: "Dave", LastName: "Ward" }'

in the example above it works but I wish to pass on a string instead.

View 2 Replies

WCF / ASMX ::pass Xml Document To A Method In WCF Service By Client?

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

Jquery Ajax Call To Web Service - Canīt Pass Parameters?

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

ASMX Service Call With Username Pass Argument

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

How To Pass Parameter Back From Web Service If An Insert To A Database Successfull

Oct 29, 2010

I have a web form and I use jQuery/AJAX/JASON to send objects to a web service using

$.ajax({
type: "POST",
url: "SynchroniseCustomers.asmx/synchroniseCustomers",
data: JSON.stringify(customerObj),
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (xhr, status) {},
success: function (msg) {}
});

From the web service I want to check if the insert into the database was successfull, return a variable with an ID and pass this ID to a function. In the object I have the ID so I could have

success: function (msg) {deleteCustomer(ID);}

But this only checks if the data was passed to my method in the web service? I have followed this example http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/ and in the class Person I get a message back from the database server telling me if the insert was successfull or not so like

if (successfull)
{
return ID;
}

is there a way to get this ID back to the web form and use this in a variable?

View 1 Replies

DataSource Controls :: Capture The SQL Server Error And Pass It To UI Via Web Service?

Jul 12, 2010

In one of our sprocs, we have a validation and it returns an error as: RAISERROR('this is the error message', 18, 1) When I call it in the business logic layer, how do I obtain this error message and pass it through the web service?

[Code]....

As you can see, it supposes to return a Users type, but how would I capture that error message in sproc and pass it all the way to UI?

View 2 Replies

How To Pass Null To A Nullable Parameter Of A .NET Web Service Method Via Javascript

Aug 24, 2010

[System.Web.Script.Services.ScriptService]
public class Quotes : System.Web.Services.WebService
{
ebMethod]
public void Calculate(int param1, int? param2)

View 2 Replies

Web Forms :: Pass Datetime From A Textfile To The Form And Using It To Get The Classes From Web Service?

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

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

VS 2010 - How To Pass Username And Password And Test Service Connectivity

Aug 24, 2011

I have added a web reference using the wsdl file that was provided to me. I also created an instance from the proxy class as follows :

Code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim DLObj As New WebReference.DrivingLicenseInfoServiceService

But after this am totally confused on the next steps and how to pass username and password and test the service connectivity.I have attached the autogenerated code.

View 12 Replies

Pass Values From One Page To Another?

Mar 17, 2010

i have one scenario in which i have to pass values from one page to another for that currently i am using querystring but now the values are more so i want to remove querystring and i dont want to user session as well and so i have tried using Hiddenfields but after redirecting to another page the values are cleared from all the hidden fields.

View 14 Replies

How To Pass Values Between ASCX

Feb 14, 2010

How to pass values between ASCX ?/

View 1 Replies

ADO.NET :: Can't Pass DataReader Values

Nov 1, 2010

Why can I not call the global variables CatCode and CompanyName which are equated in the first procedure GetCompanyCatID And use their new values in the second procedure UpdateCompanyCounts as parameter values. When I hard code them code their values at the end of the GetCompany CatID procedure the following procedure updates properly.

string CatCode; - delcared global
string CompanyName; - delcared global
protected void GetCompanyCatID()
{
LinkID2 = Request.QueryString["linkid"].ToString();
string L_ID = LinkID2;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString001"].ConnectionString);
SqlCommand cmd = new SqlCommand("GetCID", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@L_ID", L_ID);
try
{
con.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
if (reader["CG_ID"] != System.DBNull.Value)
CatCode = (string)reader["CG_ID"];
CompanyName = (string)reader["CG_Name"];
}
}
}
catch (SqlException exc)
{ }
finally
{ con.Close(); }
// ******* HARD CODED to test below update procedure, it works. When commented out the following update procedure does not update.
CatCode = "55555"
CompanyName = "Test";
UpdateCompanyCounts();
}
protected void UpdateCompanyCounts()
{
LinkID2 = Request.QueryString["linkid"].ToString();
string L_ID = LinkID2;
string CatCode2 = CatCode;
string CompanyName2 = CompanyName;
// string CatCode2 = "23456";
// string CompanyName2 = "TEST";
SqlConnection con2 = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString001"].ConnectionString);
SqlCommand cmd2 = new SqlCommand("UpdateCatCounter", con2);
cmd2.CommandType = CommandType.StoredProcedure;
cmd2.Parameters.AddWithValue("@L_ID", LinkID2);
cmd2.Parameters.AddWithValue("@CG_ID", CatCode2 );
cmd2.Parameters.AddWithValue("@CG_Name", CompanyName2 );
try
{
con2.Open();
cmd2.ExecuteNonQuery();
}
catch (SqlException exc)
{
// ErrorBox.Text += string.Format("Error: {0}<br/>", exc.Message);
}
finally
{
con2.Close();
}
}

View 5 Replies

C# - Pass Values To Other Pages?

May 5, 2010

i am trying here is to pass values to other pages. When i include the following code

private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm5.aspx?Name="+txtName.Text);

[code]...

View 3 Replies

Security :: Calling Users NetworkCredential Object From The WCF Service And Pass It To The OCS Call?

Aug 27, 2010

I have the following scenario. An user uses the desktop application to call our WCF Service which has windows authentication. The WCF Service calls the Office Communication Server (OCS) in order to do some custom work.

When the WCF Service calls OCS we have to pass an instance of NetWorkCredential into the call. I want to pass in the original calling users NetworkCredential object into the OCS call rather than constructing it using a custom username and password. How do I get access to the calling users NetworkCredential object from the WCF service and pass it to the OCS call?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved