Skip to main content

Posts

Showing posts with the label web-services

What should a JSON service return on failure / error

I'm writing a JSON service in C# (.ashx file). On a successful request to the service I return some JSON data. If the request fails, either because an exception was thrown (e.g. database timeout) or because the request was wrong in some way (e.g. an ID that doesn't exist in the database was given as an argument) how should the service respond? What HTTP status codes are sensible, and should I return any data, if any?

android device to backup data on local server

I am working on the android application that would perform functionality and ultimately save the data(Highly Confidential) in a local server, I am a newbie, I need ideas from you people in the shape of steps that i need to follow for the implementation. I cant expose the main main idea but the thing is store the customer data (in the database placed on server) on the server via android tablets, there will be multiple tablets feeding the data in parallel. I will appreciate if someone would suggest the appropriate tutorials (for webservice creation/usage etc)

android device to backup data on local server

I am working on the android application that would perform functionality and ultimately save the data(Highly Confidential) in a local server, I am a newbie, I need ideas from you people in the shape of steps that i need to follow for the implementation. I cant expose the main main idea but the thing is store the customer data (in the database placed on server) on the server via android tablets, there will be multiple tablets feeding the data in parallel. I will appreciate if someone would suggest the appropriate tutorials (for webservice creation/usage etc)

How can I listen the Android output (using sniffer)?

I wrote simple application that send some data to my server. Somehow the data is corrupted and I want to use something like sniffer on the Android cellphone device to look what exactly is the data that my application is sending. When I run with debug - I see the data is right - but on the other side (on the server) I see that the data is corrupted. Is there some way to use sniffer that will catch the packets that are sent from the Android device? i using the wireshark on the server side - but its look like something in the android side is making the problem. I need to use sniffer somehow on the android side

uploading image on web: getting html source code as response

I am trying to upload image on web server, but whenever it tries it is sending me html source code as response and image is not uploaded there. My code is: HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(url); ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); bitMap.compress(Bitmap.CompressFormat.JPEG, 100, byteStream); byte[] buffer = byteStream.toByteArray(); ByteArrayBody body = new ByteArrayBody(buffer,"profile_image"); MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); entity.addPart("b@gmail.com.jpg", body); post.setEntity(entity); System.out.println("post entity length "+entity.getContentLength()); ResponseHandler handler = new BasicResponseHandler() ; String response = client.execute(post,handler); Thanks in advance!!!

My first web-based iPhone application - how to do it right?

I've built my first web-based iPhone app and I have some performance issues that I needs to be resolved. I want to verify that I'm doing it right, so your feedback is really appreciated... :-) The application presenting data - images & text directly from my remote MySQL DB using PHP based web-services. I'm using the SDWebImage for lazy-downloading. Now, I wonder if I'm doing everything right or is there something needs to be modified for better performance - Each connection to the DB is handling via NSMutableURLRequest using POST method. It's running again if I receive time-out connection from the DB and displaying an alert-view if connection fails. There is only one PHP web-service for every operation - I mean - if, for instance, I'm running the remote getInfo.php script for fetching information from my DB to be presented on info-view-controller, there is only one copy of this script on my web-site, so everyone's ru

How to parse a SoapObject in android

I'm using webservices for an application to get the data from external servers. I'm able to connect to the server, send my SOAP request and able get the data back to my android class as SoapObject. Here I'm having trouble parsing this SoapObject to retrieve the values (as strings) coming from the webservice. My code is here: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list); mInflater = (LayoutInflater)getSystemService(Activity.LAYOUT_INFLATER_SERVICE); System.out.println("Entered "+getClass().getSimpleName()); //Calling the web service to get the documents list callService("getDocumentsList","http://wservice.friedmaggy.com/getDocumentsList"); -- I have created callService method to call the webservice.: public void callService(String operation, String soapaction) { try { String SOAP_ACTION = soapaction;

Java deploy webservice ejb to Windows Weblogic

i have a problem with deploying webservice jar file to Weblogic. If i deploy on same version WL linux machine works ok. If i deploy to windows machine it gives error msg NoClassDefFound. It cant find class i defined in webservices.xml file under handler-chain tags. its like com.something.SoapBodyHandler. On linux, handler is working. If i deploy to windows without that tag it works. Its like it couldn't find com/something/SoapBodyHandler

Is there a way with PHP to access a file on a server and save only the first half of the file?

I want to give users a preview of certain files on my site and will be using scribd API. Does anyone know how I can access the full file from my server and save the file under a different name , which I will then show to users..Can't think of a way to do this with PHP for .docx and image files...Help is much appreciated.