C# - Calling Web Service From A Phone?

May 22, 2010

I've got a website which contains the profile of users. I am now working on a mobile app and I would like to access the profile details from via the app. My idea is to simply create a webservice which returns the relevant fields (some of which might be password protected). How can I ensure that the web service is being request only by my application and not by anything else (desktop, other app etc..)? Initial idea was to have a secret key embedded in the program which is used to encrypt the data sent over to the web service, but I'm not sure how difficult it would be for someone to find that key since it's on the client side app.

View 1 Replies


Similar Messages:

C# - Calling A Web Service - Code For Consuming A Service Is Not Working ?

Mar 16, 2011

I have the following code for consuming a service that is not working for me. what I can do to narrow down whats going wrong?

The address is: http://localhost:57667/ExampleService.svc/

When visiting directly I get the 'You have created a service... message'

The code that goes wrong is here. It causes the following error:

_url = "http://localhost:57667/ExampleService.svc";
TextReader textReader = new StringReader(HttpPostClient.Post(new Uri(_url), bodyData.ToString(), _exampleServiceRequestEncoding, Properties.Settings.Default.HttpPostClientExampleAvailabilityTimeout));

ERROR MESSAGE:When visiting this URL directly: http://localhost:57667/ExampleService.svc/ProcessRequest

The exception message is 'No component for key example.ExternalWebServiceStubs.Example.ExampleService was found'.
Castle.MicroKernel.DefaultKernel.get_Item(String key) at Castle.Facilities.WcfIntegration.WindsorInstanceProvider.GetInstance

View 2 Replies

Calling WCF Service From Silverlight?

Jan 7, 2010

I am new to Silverlight. In Silverlight, we can get data from server using ASP.Net (using WebClient and HTTPWebRequest classes in Silverlight) and using WCF Service.

Assuming that I do not need the cross domain capability, what is a good option in terms of Security and ease of development?

View 1 Replies

JQuery Calling WCF Service

Mar 11, 2011

I am in the process of implementing jQuery calling WCF service which is hosted in the same domain. My application uses Win Auth that works fine with ASP.NET app. I would like to know from the team if the user calls the WCF service from the ASP.NET what is the security context in which the service runs? Or it uses the web.config security which is specified? Are there any links related to this where i can get some information.

ASP.NET 4.0, jQuery and WCF 4.0 in same web application

View 1 Replies

Calling Wcf 4.0 Service From Jquery

Feb 7, 2011

I have a simple wcf service developed in vs2010

[ServiceContract]
public interface IService1
{
[OperationContract]
string GetData(int value);
// TODO: Add your service operations here
}
public class Service1 : IService1
{
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
}

the following call is working

protected void Button1_Click(object sender, EventArgs e)
{
ServiceReference1.Service1Client p = new ServiceReference1.Service1Client();
Label1.Text= p.GetData(5);
}

but when I am trying to call it from jquery its not working

$(".test").live("click", function () {
$.ajax({
type: "post",
url: "[URL]",
data: {value:'1'},
contentType: "application/json; charset=utf-8",
timeout: 10000,
processData: true,
dataType: "json",
success: function(d) {
alert(d);
},
error:function (xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(thrownError.toString());
}
});

View 1 Replies

Mobiles :: Web Service Calling From PDA?

Jun 24, 2010

I am developing application for PDA. The Sql Server compact edition is installed on PDA. The data is stored on PDA's DB as well as the Server Database through wifi.

If the server is available,the data will be stored through web service, If not available ,the data should be inserted when the server is connected to the data.

which is better to transfer data whether the web service or windows service?

If web service means, how could i transfer the data to server database?

View 3 Replies

ASP Webservice Calling WCF Service?

Oct 27, 2010

I have almost the same problem as you have described in [URL] service. I have a asp.net webservice that calls a WCF service. On my development machine this is working fine. But if i deploy my ASP.net Webservice it is not working. Both the ASP Webservice en WCF service needs my cridentials. How did you solved your problem. In the logging of the WCF service I see that my credentials is not passing to WCF.

View 1 Replies

WCF / ASMX :: Calling A Web Service?

Dec 19, 2010

there ( my first post in this forum ). i created a web service which searches for user info from a adatabase
based on the user id(input). i want to call this service from the bookstore web site i created for my course project but apparently i'm not doing something right. i get an error : [IndexOutOfRangeException: Index was outside the bounds of the array]. So to give you an idea of exactly what i've done so far, here's the code...

First for the web sevice: using System;

View 4 Replies

C# - Calling Web Service From Php Client?

Jun 19, 2010

I have a simple ASP .NET web service running and I want call it from a php client. I m using nusoap soap client.

The following is the client side php code:

<?php
require_once('lib/nusoap.php');
$wsdl="http://localhost:64226/Service1.asmx?wsdl";
$client=new soapclient($wsdl, 'wsdl');
$param=array('number1'=>'2', 'number2'=>'3');
echo $client->call('add',$param);
?>

The web methods I have created in web service are as follows:

namespace WebService3
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{.........

However when I run the above php code it does not return the added value of the passed parameters. Instead it previews the word 'Arrays' I m not experienced in php programming. Am I doing something wrong the above codes?

View 2 Replies

Calling A Web Service Without Using Soap?

Jul 1, 2010

I have a web service I'm converting it to wcf

I want to create a couple methods in the wcf... these will call methods in the web service

but I don't want to use soap or whatever because it is so slow

So I made a WCF service inside my web project.

Then I new up the web service and call a method...

Is it using soap? Is this just the same as calling any other method in the code? Just as fast?

View 2 Replies

VS 2008 Calling Rest Web Service?

Aug 27, 2010

I am trying to interface a website we have with our helpdesk software. The helpdesk software has a REST API that i can connect to. So far I have been successful in getting a current ticket with the following code.

[Code]....

[URL] How would I implement this in ASP.Net? I want to create the ticket, and need to be able to retrieve the access key that it returns. I tried using the same code above, but instead changing the method string to this.

Code:

method = "request.create&tNote=Testing method&sFirstName=Jose"
But I get a "Bad Request" error from it.

View 3 Replies

AJAX :: Calling A Web Service From Extender

Apr 8, 2010

VS2008
Using C#
AJAX Toolkit 20229.20185

I have an AJAX auto complete extender that calls a web service to generate a string[] for a textbox. Works great, The issue I am having is that I set the OnClientItemSelected property of the auto complete extender to call a JavaScript function that will intern call another web service to get the remaining data I need based on the item that was selected. (I need this because the auto complete web service only allows for key/value pairs and I need to return 10 columns of data) I cannot get the JS function to call the web service. I keep getting "(Namespace) is undefined" as a JS error. I tried to impliment Microsoft's example located at: [URL] but even if I copy there code line for line in a new project, I still encounter the same error.


Samples.AspNet.WebService.Add(a, b,SucceededCallback); //'Samples' is undefined - runtime If I remove the namespace so that it reads: Add(a, b,SucceededCallback); //Endless loop until you get stack overflow error
Has anyone got MS C# example to work? I saw a lot of people had this line missing in the web service, but I already had it. [System.Web.Script.Services.ScriptService]

View 2 Replies

Calling Soap Web Service (written In PHP)?

Aug 6, 2010

I am trying to call a webservice, written in PHP from ASP.Net. I have added Web Reference using "Add Web Reference". The url is: http://mikikard.com/public/webservice?wsdl

In Add Web Reference Window, I can see the list of functions. But, When I try to build the Website, It gives the following Error:

Unable to import binding 'SoaptestBinding' from namespace 'http://mikikard.com/public/webservice'.

View 1 Replies

Calling Asynchronous Methods From Wcf Service?

May 27, 2010

In my asp.net application, I am using wcf service to get all the business logic. I am using that service reference in my application to work with that. Now adding that service reference is giving another option Update service reference is giving Generate asynchronous operations. If I check the option and add the service will it generate asynchronous methods for my existing service. If so how do I use the metohd.

View 1 Replies

WCF / ASMX :: Calling Java Web Service

Jul 8, 2010

how can i call mtom web service without param for the attachment from web service built in java

View 3 Replies

WCF / ASMX :: Calling Wcf Service From Other Domain

Jun 20, 2010

[Code]....

Should I change the configuration so the service could be called from other domain?

View 4 Replies

AJAX :: CascadingDropDown Not Calling Web Service?

Nov 6, 2010

I am new to Ajax and i wanted to use the CascadingDropDown to get rid of the postbacks. But somethings wrong and when i debug i am not running any code from the Web Service for some strange reason.

this is my code in the .aspx file:

<asp:ScriptManager ID="ScriptManager1" runat="server">

View 4 Replies

C# - Calling WCF Service Operations In AJAX?

Dec 8, 2010

I have one asp.net application, in which i am using "Calling WCF Service Operations in AJAX" method. I finished my work without the service hosting in IIS. I got the correct solution. But now, i have another requirement in which i am using the WCF service which is hosted on local host iis. But in clicking the button i got one javascript error like object expected. I don't know why this happened?
My code is shown below.

<fieldset style="width: 804px" align="center">
<legend>Consuming WCF Service using Client-Side AJAX</legend>
<div align="left" style="text-align: center">
<form id="form1" runat="server">

[Code]....

View 1 Replies

JQuery :: Calling Web Service Using JSON?

Jan 6, 2011

I just want that when i enter name in Textbox1 it shown in TextBox2 when i click on Button

I am using HTML page here's the code

<input id="txtID" type="text" /><br />
<input id="txtName" type="text" /><br />
<input id="btnShow" type="button" value="Show" />

[Code]....

But when i load this Web Page its show this error after click on button

Error: 12031 unknown
Error: 500 Internet Server Explorer

View 18 Replies

WCF / ASMX :: Calling Wcf Service From Other Domain?

Jul 20, 2010

[Code].... Should I change the configuration so the service could be called from other domain?

View 5 Replies

Silverlight Error While Calling A Service?

Oct 10, 2010

I am trying to call a service from a silverlight application, but I am getting the following error.

Uncaught Error: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details.

This works fine locally. I don't know if it make any sense, but locally if I add the url of the webservice on a browser, I am getting the details page of the service. In the other hand, on production server, it prompts me to download it.

public MainPage() {
InitializeComponent();
Loaded += new System.Windows.RoutedEventHandler(MainPage_Loaded);
}

[Code]....

View 1 Replies

WCF / ASMX :: AutoComplete Extender Not Calling Web Service

Mar 24, 2011

I am using AutoComplete ASP.NET AJAX Control toolkit AutoCompleteExtender control When I am using my web service as Service Path, its not working.my web services code below

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
using System.Data;
using System.Web.Script.Services;
namespace OnlineSalesGrid
{
/// <summary>
/// Summary description for sample
/// </summary>
[WebService(Namespace = [URL]]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class sample : System.Web.Services.WebService
{
[WebMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
List<string> returnData = new List<string>();
SqlConnection con = new SqlConnection("Data Source=CARPATHIA\SQLEXPRESS;Initial Catalog=OnlinesaleGrid;Persist Security Info=True;User ID=sa;Password=c0rpusdata");
string sql = "select Customer_Name from Customer_Master where Customer_Name like '%" + prefixText + "%'";
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
while (reader.Read()) { returnData.Add(reader["Customer_Name"].ToString()); }
return returnData.ToArray();
}
[WebMethod]
public static string[] GetCompletionList1(string prefixText, int count)
{
List<string> returnData = new List<string>();
SqlConnection con = new SqlConnection("Data Source=CARPATHIA\SQLEXPRESS;Initial Catalog=OnlinesaleGrid;Persist Security Info=True;User ID=sa;Password=c0rpusdata");
string sql = "select Customer_Code,Customer_Name from Customer_Master where Customer_Code like '%" + prefixText + "%'";
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
while (reader.Read())
{
returnData.Add(reader["Customer_Code"].ToString());
}
return returnData.ToArray();
}
}
}

Html Code is

<asp:ScriptManager ID="toolscpt1" runat="server" >
<Services>
<asp:ServiceReference Path="~/sample.asmx" />
</Services>
</asp:ScriptManager>
<asp:TextBox
ID="txtcname" runat="server" CssClass="textbox" onBlur='funblurcolor(this.id)' onFocus='funfocuscolor(this.id)'
ontextchanged="txtcname_TextChanged1" onkeypress="javascript:if(window.event.keyCode == 13) document.getElementById('txtphno').focus" ></asp:TextBox>
<asp:AutoCompleteExtender ID="txtname_AutoCompleteExtender"
runat="server" Enabled="True" ServiceMethod ="GetCompletionList" ServicePath="~/sample.asmx"
MinimumPrefixLength="1" CompletionSetCount ="12" EnableCaching ="true" CompletionInterval ="500"
TargetControlID="txtcname" ></asp:AutoCompleteExtender>

View 14 Replies

WCF / ASMX :: How To Check That Which Endpoint Is Calling WCF Service

Aug 27, 2010

How can i check that which Endpoint is calling WCF Service.

View 1 Replies

Calling Secure Web Service From Anonymous Website?

Feb 1, 2011

I have a web service that is set as secure via the web config:

<authentication mode="Windows" />
<authorization>
<allow roles="METWeb-Admin"/>
<deny users="*"/>
<allow users="METJoeUser;METJoeSmith"/>
</authorization>

And also in IIS 7 (Windows Server 2008) it has the following set for Authentication:

Anonymous Authentication:Disabled
ASP.NET Impersonation: Disabled
Basic Authentication Disabled
Forms Authentication: Disabled
Windows Authentication: Enabled

The anonymous site I am calling it from in IIS7 is:

Anonymous Authentication:Enabled
ASP.NET Impersonation: Disabled
Basic Authentication Disabled
Forms Authentication: Enabled
Windows Authentication: Disabled

In the Anonymous web site, I call the secure web service via:

moms.momService myMom = new moms.momService();
NetworkCredential netCred = new NetworkCredential(@"username", "password");
strStatus = myMom.createBackupDirectoryAndPrivs(sData);

Everytime I run this, it returns as Unauthorized. I have made sure this user is in the Web-Admin AD Group. I also tried adding the user as an Allow User but still unauthorized. I am pretty sure the problem lies somewhere in IIS but not sure what else to check.

BTW: For what it's worth, if I run the Anonymous site via VS2010 development on my dev box, and call the secure site using above code, it works fine. This is why I am thinking IIS on the PROD server.

View 1 Replies

Calling .NET Web Service Function Via GET Method With JQuery

Apr 26, 2010

I'm trying to call web service function via GET method using jQuery, but having a problem. This is a web service code:

[WebService(Namespace = "http://something.com/samples")]
[ScriptService]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [Code]....

And I get an error because of this (error handler is called).

View 7 Replies







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