web-services

Urls in restful webservices

*爱你&永不变心* 提交于 2019-12-25 00:26:19
问题 I have read this ebook and I've read that you should try to limit yourself to two base URLs. So if you have a quiz resouce you would have /quizes and /quizes/{id} . Then you use the HTTP verbs for actions. However how would you get a quiz from the server which is dynamically made with random questions when you try to follow this pattern? I thougth of /quizes?type=random , but let say you want the type attribute to be optional defaulting to random and you already use the /quizes path for

USING webservice in PHP which returns XML

爱⌒轻易说出口 提交于 2019-12-25 00:17:36
问题 I am using a webservice to get some results in XMl form... here is the part of the code public function getXML() { $url=$this->constructURL(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $xml = curl_exec($ch); if ($error = curl_error($ch)) { echo "Error: $error<br />\n"; } curl_close($ch); return $xml; } $resultXML = $api->getXML(); echo $resultXML; when i echo that '$asd' it does nothing but a balnk

web service to insert values into sql database

十年热恋 提交于 2019-12-25 00:07:06
问题 I am sending some data from windows mobile to webservice. Now i want to write a method in webservice to insert those values into sql database . How to proceed. please help 回答1: What you want is a Restful web service. That link is your basic howto. 回答2: there is good book called practical database programming with visual c#.NET by ying bai. //base class public class SQLInsertBase { public bool SQLInsertOK; public string SQLInsertError; public string lat; public string lon; public string id;

Data sent to a WCF REST service wouldn't go to the Stream input parameter

痴心易碎 提交于 2019-12-25 00:06:04
问题 I'm currently struggling with implementing file upload to a WCF REST service. The client does the following: void uploadFile( string serverUrl, string filePath ) { HttpWebRequest request = (HttpWebRequest)HttpWebRequest. Create( serverUrl ); request.Method = "POST"; request.ContentType = "multipart/form-data"; request.SendChunked = true; request.Timeout = 60000; request.KeepAlive = true; using( BinaryReader reader = new BinaryReader( File.OpenRead( filePath ) ) ) { request.ContentLength =

Android post request for aspx

梦想与她 提交于 2019-12-24 23:55:49
问题 I am new to android and I have C# code for post request and i want to execute same in android. can you guys help me. here is C# code snippet. WebRequest request = WebRequest.Create("http://domani.url.com"); // Set the Method property of the request to POST. request.Method = "POST"; // Create POST data and convert it to a byte array. string postData = "©req:1©un:username©pwd:password©flag:MA©ver:1.9.20©"; byte[] byteArray = Encoding.UTF8.GetBytes(postData); // Set the ContentType property of

Asynchronous Silverlight WCF callback

为君一笑 提交于 2019-12-24 23:12:16
问题 I've created my own WCF service and I've successfully been able to talk to it via my Silverlight client. I ran into an interesting problem on my asynchronous callbacks though. When my callback is invoked, I can't update any UI controls with the dreaded invalid cross thread access Here's what my callback function looks like private void GetTimeCallBack( object sender, Talk.ClientBase<IService>.ClientEventArgs e ) { lblDisplay.Text = e.Object.ToString(); } A quick google search showed me that I

How to get list of aspects in the systems

浪尽此生 提交于 2019-12-24 23:09:03
问题 Does one can recommend me how to get list of aspects in alfresco using java web-service API. Thank you. 回答1: It is not possible to get the list of aspects using web service client, you can however get the list of class definitions of aspects if you know their names. Check DictionaryServiceSoapPort interface, there is a method named getClasses that can return an array of ClassDefinition s for the given types and aspects. I don't know if it helps but instead of retrieving the list of aspects

Referencing a field on an asp.net page from a Web Service (asmx) page

只愿长相守 提交于 2019-12-24 22:35:48
问题 I'm using a Web Service page to make a textbox an "auto complete" control. In order to do that, I'm using a web service. My code in the web service looks like this: public string[] ISGetCompletionList(string prefixText) { string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["CLTDPL"].ConnectionString; SqlConnection conn = new SqlConnection(connectionString); List<string> Payers = new List<string>(); using (SqlCommand cmd = new SqlCommand()) { cmd.CommandText =

RESTful Web Service Upload/Download Large Data With JSON

与世无争的帅哥 提交于 2019-12-24 22:09:47
问题 What is the best practice if you are implementing web services that will send and receive large files to/from clients. Normally we are sending JSON objects, but it could be problematic if we include large data payload inside of the JSON objects. We need to provide JSON data as well as a payload, anyone have experience with something similar? 回答1: You could embed links to the raw data in your JSON responses. For example: { title: 'A Really Big File', date: '2011-11-11', file: 'http://example

What Class for Serializable Multidimensional Arrays?

时间秒杀一切 提交于 2019-12-24 21:56:46
问题 EDIT: See Below I have a web service which uses a class of functions in order to return data used in various business processes (via InfoPath). One of the functions takes a given SQLCommand object and executes it into a SQLDataReader. Now depending on the SQL command text used this may return one or many rows of one or many columns. So what is the best class for this function to return bearing in mind it needs to be serialized by the web service. My existing code is: Dim array As New