草庐IT

jersey-client

全部标签

java - 无法加载“类路径资源 [org/springframework/ws/client/core/WebServiceTemplate.properties]

我编写了一些代码,其中我正在使用另一个网络服务并使用WebServiceTemplate向该网络服务发送请求。但是当该代码触发时,我得到以下异常。我已经检查了SpringCore的库,一切似乎都正常,但不知道为什么这个服务会抛出这样的异常。应用程序上下文:服务:publicclassManageContactServiceextendsWebServiceGatewaySupport{privateWebServiceTemplatemanageContactsWSTemplate;publicWebServiceTemplategetManageContactsWSTemplate(

java - 如何在 Java Jersey Application 中使用查询参数?

我正在学习教程并使用了Stackoverflow问题here.这是我的Java类:packagecom.crunchify.tutorial;importjavax.ws.rs.DefaultValue;importjavax.ws.rs.GET;importjavax.ws.rs.Path;importjavax.ws.rs.Consumes;importjavax.ws.rs.QueryParam;importjavax.ws.rs.core.Context;importjavax.ws.rs.core.MediaType;importjavax.ws.rs.core.Multiv

java - Jersey 演示应用程序中的 MediaType.APPLICATION_XML 和 MediaType.APPLICATION_JSON

一旦我得到这个问题LatestJerseyexampledoesnotwork的答案,我就遇到了另一个奇怪的问题:服务器,GET方法工作正常。我测试并添加了一些测试代码helloworld-pure-jax-rs例子,尤其是为JSON添加了POST请求:packageorg.glassfish.jersey.examples.helloworld.jaxrs;importjavax.ws.rs.Consumes;importjavax.ws.rs.GET;importjavax.ws.rs.POST;importjavax.ws.rs.Path;importjavax.ws.rs.Pa

java - 如何在 yml 中获取我的配置值 - 使用 dropwizard(微服务)Jersey D.I @Injection?

这是我的代码片段。这是我的yml文件:productionServer:host:production-server.amazonaws.compublicIp:xx.xx.xx.xxprivateIp:xx.xx.xx.xxuserName:xx.xx.xx.xxpassword:xx.xx.xx.xxremoteFilePath:fake/path/fileName:test.txtprivateKey:private-public-key.ppkserver:applicationConnectors:-type:httpport:8080-type:httpsport:8443

java - Jersey Client 能否自动将 POJO 实体编码为 application/x-www-form-urlencoded,还是我需要编写自定义 MessageBodyWriter?

我正在使用Jersey的Client调用RESTful网络服务与Jackson一起处理JSON的序列化。我还使用JSONConfiguration.FEATURE_POJO_MAPPING设置让Jackson自动将我的POJO序列化为JSON。我将我的POJO发送到的远程服务使用MediaType.APPLICATION_FORM_URLENCODED并生成MediaType.APPLICATION_JSON_TYPE。我是否必须创建自己的MessageBodyWriter实现来处理POJO序列化到application/x-www-form-urlencoded中,或者Jersey是

java - Jersey Restful 失败,错误为 "java.lang.NoSuchMethodException: Could not find a suitable constructor"

基于Jersey的简单restful代码importjavax.ws.rs.ApplicationPath;importjavax.ws.rs.core.Application;importcom.yakima.core.webservice.resource.UserResource;importorg.glassfish.jersey.jettison.JettisonFeature;importorg.glassfish.jersey.server.ResourceConfig;importjava.util.HashSet;importjava.util.Set;importj

java - 使用dropwizard + jersey client时如何避免依赖冲突

我编写并运行了DropWizardRESTAPI。其中一个资源端点实际上写了一封电子邮件,但是一旦我添加以下依赖项,DropWizard就开始在启动时失败com.sun.jerseyjersey-client1.18.1com.sun.jerseyjersey-core1.18.1com.sun.jersey.contribsjersey-multipart1.18.1DropWizard依赖项是:io.dropwizarddropwizard-core0.8.1启动报错真的很长,总结如下WARN[2015-05-0120:06:08,887]org.glassfish.jersey.

java - Jersey 客户端发布二进制数据应用程序八位字节/流

我想使用JerseyClient执行二进制数据的发布。与curl等价的是:curl-v--header"Content-Type:application/octet-stream"--data-binary"abc"http://example.com我在官方文档中找不到如何做:http://jersey.java.net/documentation/latest/user-guide.html#client谢谢。 最佳答案 我认为您可以使用封装二进制数据的实体调用POST请求,如下所示:Clientclient=ClientBui

java - 使用@EnableOAuth2Client 的 OAuth2 客户端手动配置不起作用

我正在关注this官方spring文档中使用@EnableOAuth2Client手动配置OAuth2客户端的教程。由于某种原因,它不起作用。当我运行应用程序并访问http://localhost:8080/login时,我看到的是基本表单登录,而不是Google登录选项。(由于我的用例,我需要使这个手动配置工作。)但是,在我不使用OAuth2AuthenticationProcessingFilters进行任何手动配置的情况下,@EnableOauth2Sso代码工作正常。在这种情况下,我在访问我的登录页面时获得了谷歌登录选项。有人可以帮帮我吗。我添加了以下代码:这是与@Enable

java - Dropwizard 中的 Jersey 过滤器设置一些全局 FreeMarker 变量

我正在阅读https://jersey.github.io/documentation/latest/filters-and-interceptors.html和http://www.dropwizard.io/1.1.4/docs/manual/core.html#jersey-filters尝试做这个:@CookieParam("User-Data")userData:String,@HeaderParam("User-Agent")userAgent:String,我的网络应用程序的每个资源GET方法都不需要。userData是来自cookie的json数据,其中包含“name”