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
Similar Messages:
Jun 16, 2010
I have a WCF service that processes some input arguments and retuns result in approximately 4 minutes. Sometimes the calling client may get request time out before the WCF service answers.
Now, my customer is asking me to stop processing on the service side when the client got timed out. Since, I could not know the status of cleint on the service, I could not stop the process.
View 1 Replies
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
Jan 21, 2011
I've created a simple WCF service hosted by ASP.NET web site:
[Code]....
I can add references to this service as to WCF service, as to WebService.WcfTestClient application successfully recognized service and its methods.
But "Web Service Studio" [URL] can't get a list of operations... Why? How to diagnose/resolve that?
P.S. I work under VS 2008 using .NET 3.5
View 2 Replies
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
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
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
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
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
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
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
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
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
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
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
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
Jul 8, 2010
how can i call mtom web service without param for the attachment from web service built in java
View 3 Replies
Jun 20, 2010
[Code]....
Should I change the configuration so the service could be called from other domain?
View 4 Replies
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
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
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
Jul 20, 2010
[Code].... Should I change the configuration so the service could be called from other domain?
View 5 Replies
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
Mar 21, 2010
I have a fairly complex business application written in ASP.NET that is deployed on a hosted server. The site uses Forms Authentication, and there are about a dozen different roles defined. Employees and customers are both users of the application.
Now I have the requirement to develop a Windows Mobile client for the application that allows a very specialized set of tasks to be performed from a device, as opposed to a browser on a laptop. The client wants to increase productivity with this measure. Only employees will use this application.
I feel that it would make sense to re-use the security infrastructure that is already in place. The client does not need offline capability.
My thought is to deploy a set of web services to a folder of the existing site that only the new role "web service" has access to, and to use Forms Authentication (from a Windows Mobile 5/.Net 3.5 client).
I did see this question and I am aware of the limitations that Forms Authentication poses. Since security is not my primary motivator (I use SSL and can restrict access by IP address), but rather using existing user accounts and roles, my decision tree is somewhat different as well.
View 1 Replies
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