- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
根据我能找到的内容,我得到的代码看起来应该是正确的,但大量输出并不表明它正在使用 FastInfoset。我的理解是 Accept 应该表明它可以接受 Fastinfoset 并且响应实际上会使用它,这意味着它不是 text/xml 作为响应类型。知道我做错了什么吗?我用 Google 进行了搜索,但很难找到有关如何使用 FastInfoset 的详细信息。
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass( C360Server.class);
factory.setAddress("http://localhost:8501/cxfcontroller/cl_v5");
C360Server client = (C360Server)factory.create();
((BindingProvider)client).getRequestContext().put(
"com.sun.xml.ws.client.ContentNegotiation", "optimistic");
C360Request requestTrans = new C360Request();
... code to fill in the request ...
C360Response response = client.findContacts( requestTrans );
尽管日志记录似乎并未表明甚至尝试过 FastInfoset:
INFO: Outbound Message
---------------------------
ID: 1
Address: http://localhost:8501/cxfcontroller/cl_v5
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""], Authorization=[Basic cWFfc3VwZXI6cWFfc3VwZXI=], Accept=[*/*]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:findContacts>...bunch of xml deleted for brevity...</ns1:findContacts></soap:Body></soap:Envelope>
--------------------------------------
May 17, 2010 3:23:45 PM org.apache.cxf.interceptor.LoggingInInterceptor logging
INFO: Inbound Message
----------------------------
ID: 1
Response-Code: 200
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {content-type=[text/xml; charset=utf-8], Content-Length=[611], Server=[Jetty(6.1.x)]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:findContactsResponse>...bunch of xml spew deleted for brevity...</ns1:findContactsResponse></soap:Body></soap:Envelope>
--------------------------------------
知道我做错了什么吗?即使服务器不支持 FastInfoset,我仍然应该在请求中看到尝试协商,对吗?
最佳答案
答案是我掌握的关于如何启用它的信息已经过时了。以下工作在客户端(可能是服务器端,但我已经启用了一个 Spring 配置来处理它)。
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
// This enables FastInfoset as the communication protocol
factory.getInInterceptors().add( new FIStaxInInterceptor() );
factory.getOutInterceptors().add( new FIStaxOutInterceptor() );
... other code to set username, location, etc. goes here.
client = (C360Server) factory.create();
关于java - 如何将 FastInfoset 与 JAXWS 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2853365/
我收到此错误消息: [WARNING] Ignoring: binding file "file:/home/jeusdi/projects/salut/hes/hes-visor-api-servi
查看来自 java.net 的 JAX-WS Maven 存储库 - http://download.java.net/maven/2/com/sun/xml/ws/ 有两个类似的文件夹 - jaxw
我正在使用 JAXWS 生成 Web 服务并使用 EndPoint.publish() 提供服务以及部署 war 文件,但是一旦它处理了 100 个请求,它就不会返回第 101 个请求回复。如何配置
我一直使用 wsimport 工具从 WSDL 文件生成客户端类。然后我将它们包含到项目的源代码树中,并将它们 checkin 版本控制系统。但最近我了解到有一个名为 jaxws-maven-plug
我尝试使用以下代码生成 java 类,但由于某些 gradle 插件问题而失败。 我搜索了一下,发现有很多插件可用于生成xsd类的java,但只有很少的插件用于生成代码形式wsdl.jaxb 是我想使
是否可能,如果可能,如何? 最佳答案 实际上,WebLogic 10.3 中捆绑的 JAX-WS 实现基于 JAX-WS RI 2.1.4,如 What's New in WebLogic Serve
由于 JAX-WS 依赖于 JAXB,并且由于我观察到在 JAX-B 引用实现中解压 XML bean 的代码,我猜没有区别并且 JAXWS 客户端总是返回一个空集合,即使 web 服务结果是空元素:
我有一个使用 Axis1 制作的可用 Web 服务,我正在将其迁移到 Jaxws 我正在使用 wsimport 和 maven 从我的工作 WSDL 文件创建客户端类。 我遇到的问题是,我可以在记录器
有人可以帮我吗? 我正在尝试连接 Web 服务;这是我的代码: public class test { static Logger logger = Logger.getLogger(test
这个问题在这里已经有了答案: How to change webservice url endpoint? (4 个回答) 关闭7年前。 如何动态更改我的 JAXWS 客户端正在使用的地址?此客户端由
我需要通过 SOAP Web 服务调用长时间运行的任务,在两端使用 JAXWS,特别是在两端使用 Apache CXF 2.6。 我看到我可以在 CXF 代码生成器中启用异步方法,它为每个操作创建两个
我在 maven 3 中使用 netbeans。当我尝试使用 jaxws-maven-plugin 进行编译时,出现以下错误。 这是我的 pom
我每次尝试使用 wsdl2java 工具时都会出现同样的错误。任何想法非常感谢-fe jaxbs 没有帮助。看起来找不到tools-plugin.xml。 15:18:37.618 [main] DE
我正在用Spring构建一个Web服务。我可以构建项目并将其部署到tomcat,但是当服务器启动时,出现以下错误: Invalid NamespaceHandler class [org.apache
我正在使用带有 JaxWS maven 插件的 NetBeans。我的应用程序有大约 5 个不同的 wsdls 我需要加载。我的问题是我想阻止 maven 或 wsimport 每次重新编译我的 ws
我有一个使用 JAX-WS 创建的 WebService,我编写了一个 JUnit 以通过以下方式连接到它: public class LicenseSvcClient { private s
我已经设置了一个 JAXWS 客户端并将一个 SoapHandler 实现添加到它的 Binding handlerChain。所有这一切都是为了在服务未正常运行时查看原始服务响应。 当一切正常时,我
我对编写网络服务相当陌生。我正在使用 JAXWS 开发 SOAP 服务。我希望能够让用户登录并在我的服务中知道哪个用户正在发出命令。换句话说,进行一些 session 处理。 我见过的一种方法是使用
您好,我已经编写了一个 WSDL 文件并生成了我的 Web 服务。我现在想像这样调用该服务: res = new UpdateCatalogWebService().getUpdateCatalogP
我使用 wsimport 从 wsdl 生成类。现在我正在解决缺少的依赖项,其中一些属于 javax.xml.ws:jaxws-api: 导入 javax.xml.ws.Service; 导入 jav
我是一名优秀的程序员,十分优秀!