web-services

Spring Boot REST API Endpoint Mapping best practice

笑着哭i 提交于 2020-01-24 01:56:06
问题 I am using bellow endPoint URL Mapping with HTTP Methods like ( POST,DELETE,GET,PUT) POST for Create a new Trade - @PostMapping("/trade") DELETE for Delete a Trade with specific id - @DeleteMapping("/trade/{id}") GET for Get details of specific Trade - @GetMapping("/trade/{id}") PUT for Update Trade details - @PutMapping(“/trade/{id}”) GET for Retrieve all Trade list of collection - @GetMapping("/trades") if I am missing anything here Please suggest 回答1: Add API version like @RestController

Jersey client throws javax.ws.rs.ProcessingException: java.net.ConnectException : failed to connect to /127.0.0.1 (port 8080)

徘徊边缘 提交于 2020-01-24 01:21:08
问题 I am working with an Android jersey client that sends a form to a web-service. I am getting javax.ws.rs.ProcessingException: java.net.ConnectException: failed to connect to /127.0.0.1 (port 8080): connect failed: ECONNREFUSED (Connection refused) I don't have any proxies configured. I can use the web-service via Postman(browser shows it as well). The SO posts that I have seen till now all talk about having proxies or the server being inactive, both of which is untrue in my case. My android

How to add SOAP Security Header (UsernameToken) information to code-first Webservice Generated WSDL

[亡魂溺海] 提交于 2020-01-23 19:07:26
问题 I'm developing a code-first WebService with Apache CXF + Spring. My web service expects the UsernameToken to be present in SOAP request header in order to authenticate the calling client. My question is, is there any way to add SOAP security header (UsernameToken) definition somewhere in the Java code or configuration file, so the generated WSDL will have the security (UsernameToken) included? Please advice. Many thanks :) 回答1: Information about required tokens can be published in WSDL using

soapUI - embbed XML in a request using groovy

前提是你 提交于 2020-01-23 17:02:33
问题 I'm making test cases on soapUI, on some steps I would use a REST quest and put XML code in the lower pane, something like <dataList> <data> 3.1416 </data> <data> 5.11 </data> </dataList> But I need to get the response and store the results that will be contained inside the XML text of the response, to verify that the web service is executing proper operations and then send more requests using the received results. Thanks everyone! 回答1: I could solve this using properties and Property

ASP.Net web service won't return JSON - Always XML

╄→гoц情女王★ 提交于 2020-01-23 13:22:32
问题 I'm trying to create a simple AJAX & web service test (using C# .Net 2.0) to return data in JSON format, and I have (I believe) everything I need but I keep running into the same problem over and over again. The response from the web service is always XML. (It always has <?xml version="1.0" encoding="utf-8"?> as the 1st line). I've tried the various options that come within the ScriptMethod tag, but nothing makes any difference. The call works okay, but I get a "parsererror" with the response

Generate an XML signature digest using PHP

流过昼夜 提交于 2020-01-23 12:12:19
问题 I'm trying to implement WS-Security for my PHP SOAP client. The first step is being able to generate a valid XML digest from the outgoing request, but I haven't been able to do this. I've been looking for answers for a few days now but most of the answers end up being something like "don't solve it yourself, just use an existing Java library". That's not feasible in my current situation. I have been looking at several examples on the net trying to reproduce the same digest they have, for

ArrayOfXXX class out of soap input param of array type

末鹿安然 提交于 2020-01-23 09:34:26
问题 I have a method with input param as Array. When I generate stub out of it creates List type. But I want to know how to create a wrapper class around array type e.g. for class Apple it should create ArrayOfApple . Is there any change needs to be done in class or any specific plugin need to be used? Note: I am using JAXWS with Apache CXF implementation Below is the sample code: EmployeeService.java : @WebService(endpointInterface="com.test.EmployeeService") @SOAPBinding(style=Style.DOCUMENT)

ArrayOfXXX class out of soap input param of array type

坚强是说给别人听的谎言 提交于 2020-01-23 09:33:46
问题 I have a method with input param as Array. When I generate stub out of it creates List type. But I want to know how to create a wrapper class around array type e.g. for class Apple it should create ArrayOfApple . Is there any change needs to be done in class or any specific plugin need to be used? Note: I am using JAXWS with Apache CXF implementation Below is the sample code: EmployeeService.java : @WebService(endpointInterface="com.test.EmployeeService") @SOAPBinding(style=Style.DOCUMENT)

ArrayOfXXX class out of soap input param of array type

五迷三道 提交于 2020-01-23 09:33:12
问题 I have a method with input param as Array. When I generate stub out of it creates List type. But I want to know how to create a wrapper class around array type e.g. for class Apple it should create ArrayOfApple . Is there any change needs to be done in class or any specific plugin need to be used? Note: I am using JAXWS with Apache CXF implementation Below is the sample code: EmployeeService.java : @WebService(endpointInterface="com.test.EmployeeService") @SOAPBinding(style=Style.DOCUMENT)

What response time overhead would you expect for a webservice request compared to a simple file request?

旧城冷巷雨未停 提交于 2020-01-23 08:01:07
问题 I'm developing an asp.net webservice application to provide json-formatted data to a widget that uses jQuery.ajax to make the request. I've been using the FireBug Net view to check how long the requests for data take. In my initial prototype I was simply requesting static json data files, which on my dev machine were obviously returned very quickly by IIS - in around 2 to 5ms, even if not present in the browser's cache. Now I've connected to the webservice I'm concerned that the data requests