web-services

Create a text/plain Jersey response

别来无恙 提交于 2019-12-29 06:25:16
问题 I have some code that works, but I am looking for a better way to do it. I have a RESTful web API that I want to support JSON, XML, and TEXT media types. The JSON and XML is easy with a JAXB annotated "bean" class. I just got text/plain to work, but I wish Jersey was a little more intelligent and would be able to convert a list of my beans, List<Machine> to a string using toString . Here is the Resource class. The JSON and XML media types use a JAXB annotated bean class. The text plain uses a

How to pass parameter to a webservice using ksoap2?

女生的网名这么多〃 提交于 2019-12-29 06:10:51
问题 I'm using Eclipse IDE to develop an android app. I'm trying to connect to a .net webservice. I'm using ksoap2 version 2.3 When I'm calling a webmethod with no parameters, it works fine. When I come to pass a parameter to the webmethod, I get null (while debugging the webservice I discovered that) and I get a null from the webmethod in the client side code. Code: package com.examples.hello; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.PropertyInfo; import org.ksoap2

How do I get access to SOAP response

人盡茶涼 提交于 2019-12-29 04:20:10
问题 (If anything here needs clarification/ more detail please let me know.) I have an application (C#, 2.* framework) that interfaces with a third-party webservice using SOAP. I used thinktecture's WSCF add-in against a supplied WSDL to create the client-side implementation. For reasons beyond my control the SOAP message exchange uses WSE2.0 for security (the thinctecture implementation had to be modified to include the WSE2.0 reference). In addition to the 'normal' data package I attach a stored

How do I print an HTML document from a web service?

你说的曾经没有我的故事 提交于 2019-12-29 03:49:25
问题 I want to print HTML from a C# web service. The web browser control is overkill, and does not function well in a service environment, nor does it function well on a system with very tight security constraints. Is there any sort of free .NET library that will support the printing of a basic HTML page? Here is the code I have so far, which does not run properly. public void PrintThing(string document) { if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) { Thread thread = new

How do I call a web service from javascript

做~自己de王妃 提交于 2019-12-29 03:40:08
问题 Say I have a web service http://www.example.com/webservice.pl?q=google which returns text "google.com". I need to call this web service (http://www.example.com/webservice.pl) from a JavaScript module with a parameter (q=google) and then use the return value ("google.com") to do further processing. What's the simplest way to do this? I am a total JavaScript newbie, so any help is much appreciated. 回答1: Take a look at one of the many javascript libraries out there. I'd recommend jQuery,

Is it possible to perform a batch upload to amazon s3?

徘徊边缘 提交于 2019-12-29 02:47:49
问题 Does amazon s3 support batch uploads? I have a job that needs to upload each night ~100K of files that can be up to 1G but is strongly skewed towards small files (90% are less than 100 bytes and 99% are less than 1000 bytes long). Does the s3 API support uploading multiple objects in a single HTTP call? All the objects must be available in S3 as individual objects. I cannot host them anywhere else (FTP, etc) or in another format (Database, EC2 local drive, etc). That is an external

Can I send an excel file and JSON body with a description of file in same REST API Response

时光毁灭记忆、已成空白 提交于 2019-12-29 02:00:51
问题 I have an API which returns APPLICATION_OCTET_STREAM as Media Type in response. I need to enhance it to also send a JSON body with some details regarding the file, say counts of right and wrong records in the file. So basically I need two kinds of response in same API. Is this doable ? 回答1: It's possible, but you will need to use a Multipart response. Keep in mind though that some clients will not be able to handle this type of response. You'll normally see this data type using in uploading

Login failed. The login is from an untrusted domain and cannot be used with Windows authentication

試著忘記壹切 提交于 2019-12-28 20:34:17
问题 My webpages are on secured server (https), and I am trying to connect the SQL Server 2008 Database, which is normal server. I am writing connectionstring on page itself, not in web.config file. And I am getting following error:- System.Data.SqlClient.SqlException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. Please help, how can I connect it, does I have to make some webservices for it. my code is as below: public void FillCity() {

Do we need a security signature for the web service response?

女生的网名这么多〃 提交于 2019-12-28 19:19:32
问题 I have created a web service API and it's architecture is such that the server requires a client to sign the request along with a secret key assigned to it (signature is always different between multiple requests). Server matches the client's signature with its own computed signature. If they are a match then the server returns the response. I am wondering if a client should check the response coming back from the server to see if it's from the same application to which the request was made.

InvalidOperationException while creating wcf web service instance

痴心易碎 提交于 2019-12-28 18:14:32
问题 I have a WCF Web Service which is referenced from a class library. After the project is run, when creating the service client object from inside a class library, I receive an InvalidOperationException with message: Could not find default endpoint element that references contract 'MyServiceReference.IMyService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could