web-services

WSDL vs REST Pros and Cons

烂漫一生 提交于 2019-12-28 01:43:04
问题 Related: Why would one use REST instead of Web services? When deciding whether to implement a web service using SOAP or REST (by which I mean HTTP/XML in a RESTful manner) what should I be aware of and what should I be thinking of? I presume that this isn't a one size fits all thing so how do I choose which to use. 回答1: The two protocols have very different uses in the real world. SOAP(using WSDL) is a heavy-weight XML standard that is centered around document passing. The advantage with this

can jquery ajax call external webservice?

时光毁灭记忆、已成空白 提交于 2019-12-28 01:29:11
问题 Can jquery ajax code call a webservice from another domain name or another website? Like this: $.ajax({ type: "POST", url: "http://AnotherWebSite.com/WebService.asmx/HelloWorld", data: "{'name':'" + $('#price').val() + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) {alert(msg);} }); And how should i config this webservice? 回答1: you can use JSONP to make cross domain requests. with jquery you can make a jsonp request using the $.json function and

jQuery Ajax calls to web service seem to be synchronous

纵饮孤独 提交于 2019-12-27 16:07:13
问题 I have two ajax calls to a web service from jquery. The first call ( GetMessages ) starts an interval in javascript ( setInterval ) and returns a string array of messages stored in a session variable. The second call ( UploadUsers ) uploads users and saves the status in the session to be returned in the method GetMessages . So UploadUsers adds messages to the Session and GetMessages retrieves the messages and displays them for the client. The problem is even though I call both methods

How to use parameters with HttpPost

穿精又带淫゛_ 提交于 2019-12-27 13:39:26
问题 I am using a RESTfull webservice with this methode: @POST @Consumes({"application/json"}) @Path("create/") public void create(String str1, String str2){ System.out.println("value 1 = " + str1); System.out.println("value 2 = " + str2); } In my Android app I want to call this method. How do I give the correct values to the parameters using org.apache.http.client.methods.HttpPost; I have noticed that I can use the annotation @HeaderParam and simply add headers to the HttpPost object. Is this the

Making a WCF Web Service work with GET requests

北城以北 提交于 2019-12-27 11:40:09
问题 Background I have created ASMX web services in the past and have been able to access the service from the web browser and Ajax GET requests using the address convention: MyService.asmx/MyMethod?Param=xxx I just got started using WCF and created a new web service in my ASP.NET project. It creates a file with the .svc extension such as MyService.svc. Current Situation I am able to consume the service using the WcfTestClient that comes with VS2008. I am also able to create my own WCF Client by

Handle Exceptions when using @RequestHeader in spring application

冷暖自知 提交于 2019-12-26 12:23:24
问题 Here is my Java code that uses the Spring Framework: @RequestMapping(method = RequestMethod.POST) public @ResponseBody String SampleFunction(@RequestHeader("Authorization") String details) { System.out.println("Authorization details recieved"); } I am trying to access Authorization header. I want to handle the missing Authorization header by redirecting it to a 400 Bad Request page. How can I do this? 回答1: By default the header is required. So if it is missing, you will get an exception.

Handle Exceptions when using @RequestHeader in spring application

▼魔方 西西 提交于 2019-12-26 12:23:06
问题 Here is my Java code that uses the Spring Framework: @RequestMapping(method = RequestMethod.POST) public @ResponseBody String SampleFunction(@RequestHeader("Authorization") String details) { System.out.println("Authorization details recieved"); } I am trying to access Authorization header. I want to handle the missing Authorization header by redirecting it to a 400 Bad Request page. How can I do this? 回答1: By default the header is required. So if it is missing, you will get an exception.

Restful webservice in Android [duplicate]

↘锁芯ラ 提交于 2019-12-26 06:09:17
问题 This question already has answers here : Simple parse JSON from URL on Android and display in listview (6 answers) Closed 3 years ago . I want to access a webservice function that takes two strings as arguments and return a JSON value. I found a solution to do this using volley library but apparently i have to use Android Lolipop for this. is there a way to do this without volley? Another library? or httpconnection? An example of this use will be perfect. 回答1: You can use a library http:/

Is there any good JAVA lib for playing with WSDL's and WS-* bindings?

删除回忆录丶 提交于 2019-12-26 05:03:06
问题 Is there any good JAVA lib for playing with reading from WSDL's and connecting to WS-* bindings? 回答1: Take a look at Apache Axis2 - one of the most popular java webservices framework. It has multiple Java - XML binding methods (e.g. JAXB, ADB). A good alternative would be Metro (from Sun, part of the GlassFish stack) or Apache CXF (previously called XFire) For a summary: Wikipedia 回答2: Does Apache CXF or Apache Axis suit your needs? 回答3: In case you want play and write WSDL elements you can

Axis2 deployment issue

て烟熏妆下的殇ゞ 提交于 2019-12-26 03:56:10
问题 I used axis2 1.7.3 version for my web service requirement. when i deploy the aar files, it shows the below exception. I used the java 8 features (eg. streams, filter etc ) in web service implementation files. Does axis2 support to deploy the web services implemented with java 8 features. org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Error looking for paramter names in bytecode: unexpected bytes in file at org.apache.axis2.deployment