web-services

How get return value from Thread?

让人想犯罪 __ 提交于 2020-01-11 14:45:50
问题 I am using Thread for Webservice but i cant get the data from Thread because i cant return data from Thread . This is my WebService.java : public class Webservice { static String result; public static String readUrl(final String url) { Thread thread = new Thread(new Runnable() { @Override public void run() { try { HttpClient client = new DefaultHttpClient(); HttpPost method = new HttpPost(url); HttpResponse response = client.execute(method); InputStream stream = response.getEntity()

How to add a “flat” message header to a flex web service call?

﹥>﹥吖頭↗ 提交于 2020-01-11 14:20:29
问题 I have a flex client connecting to a web service that needs an authentication token added as a header, named "Identity". An example of the expected message is: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <Identity xmlns="ns">2188dcbe-0325-4c1e-9a77-19110e0ea99f</Identity> <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">https://localhost:8001/MyService</To> <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com

How to jsonify “Add” post/parameters for jqGrid

ぐ巨炮叔叔 提交于 2020-01-11 12:52:31
问题 This one's killing me. I've read through a lot of Oleg's comments, and through the documentation, but I think I'm overlooking something really simple. I have a jqGrid populated by calling a webmethod that returns JSON. We're good there. I'm using the Navigator for my "Add" button, and using onSelectRow w/ jqGrid.editRow() for my editing. I get the dialog box when clicking the "Add" button, and can fill everything in. However, I get a error Status: 'Internal Server Error'. Error code: 500

Send data to thermal printer [duplicate]

孤街浪徒 提交于 2020-01-11 10:41:18
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: .NET code to send ZPL to Zebra printers My company has a Eltron 2543 thermal printer. I'm developing an VB.NET application incorporating FedEx web services to print off shipping labels. I can save off the data file without a problem, but I was wondering how I send this data stream to a shared printer on a network. Do I need to include the Eltron 2543 driver in my solution? Sort of lost here and would love if

Upload data method in REST web service

不打扰是莪最后的温柔 提交于 2020-01-11 10:04:56
问题 Do anyone know how can I write POST method in RESTful web service to upload data using java ? I found that smartupload and commons.upload are just for web page. 回答1: You can use some JAX-RS library, like Apache Wink, so you can write something like this: @Path("/upload") class UploadResource { @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) public Response upload(byte[] input) { // store input somewhere return Response.ok().build(); } } So you will receieve your file is byte[] . You can

This XML file does not appear to have any style information associated with it

巧了我就是萌 提交于 2020-01-11 09:37:28
问题 I have deployed my webservice into Tomcat. The WSDL has got some operations like ViewOptions, but when I ran that, I got this error: This XML file does not appear to have any style information associated with it. The document tree is shown below. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>1</faultstring> </soap:Fault> </soap:Body> </soap:Envelope> Why do we get this error? 回答1: The message isn

This XML file does not appear to have any style information associated with it

荒凉一梦 提交于 2020-01-11 09:37:08
问题 I have deployed my webservice into Tomcat. The WSDL has got some operations like ViewOptions, but when I ran that, I got this error: This XML file does not appear to have any style information associated with it. The document tree is shown below. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>1</faultstring> </soap:Fault> </soap:Body> </soap:Envelope> Why do we get this error? 回答1: The message isn

What is the point in a WSDL with a rest based service?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-11 09:04:11
问题 If REST based web services are as simple as GETing and POSTing to a url and parsing the response wht exactly do we need a wsdl? Whats the point. I understand that when using SOAP based services it is used to construct the SOAP requests and responses but dont really see why visual studio provides me with a wsdl when I create a REST based service... 回答1: There is no point in WSDL for REST services created with WCF because WCF supports only WSDL 1.1 (or 1.0) which cannot describe REST seevice.

What is the point in a WSDL with a rest based service?

不问归期 提交于 2020-01-11 09:04:06
问题 If REST based web services are as simple as GETing and POSTing to a url and parsing the response wht exactly do we need a wsdl? Whats the point. I understand that when using SOAP based services it is used to construct the SOAP requests and responses but dont really see why visual studio provides me with a wsdl when I create a REST based service... 回答1: There is no point in WSDL for REST services created with WCF because WCF supports only WSDL 1.1 (or 1.0) which cannot describe REST seevice.

Is there a way to detect from which source an API is being called?

可紊 提交于 2020-01-11 08:52:07
问题 Is there any method to identify from which source an API is called? source refer to IOS application, web application like a page or button click( Ajax calls etc). Although, saving a flag like (?source=ios or ?source=webapp) while calling api can be done but i just wanted to know is there any other better option to accomplish this? I also feel this requirement is weird, because in general an App or a web application is used by n number of users so it is difficult to monitor those many API