我有一个SOAP Web服务。 从SoapUI调用它时,无论消息内容的大小如何,请求都能正常工作。 如果我从Apache CXF客户端代码发出相同的请求,它可以处理小请求,但如果我的消息内容太长,我会得到“连接重置”,但有以下exception: Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source) at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source) at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read1(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source) at sun.net.www.http.HttpClient.parseHTTP(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1606) at […]
当我根据配置获得wsdl时,我已经开始工作了,但是我想告诉它使用特定地址进行服务调用并使用wsdl的本地副本。 MyWebService serviceDefinition = new MyWebService(new URL(wsdlLocation)); service = serviceDefinition.getMyWebServicePort(); 有谁知道这方面的最佳做法? xml请求有效。 Test Name 55555555 代理xml请求不起作用。 Test Name 55555555
如果字符串看起来像一个数字,例如。 111 CXF不会将其作为字符串返回,而是作为数字返回。 可以看出,我使用的是JSON提供程序。 如何强制它,提供正确的JSON字符串? {object:{“name”:”111″}} instead of {object:{“name”:111}} 提前致谢…
目前我正在使用CXF,但由于CXF中的以下代码: // fall back if we’re using another jaxb implementation try { riContext = JAXBUtils.createRIContext(contextClasses .toArray(new Class[contextClasses.size()]), tns); } CXF加载Moxy和RI JAXB上下文(可能依赖于非标准API)。 在我的情况下,启动时间和内存的开销太高了。 我正在寻找一个良好的开源JAX-WS实现(CXF替换),它将按预期与Moxy一起使用。
我使用SecurityContextHolder在我的JAX-RS资源中获取用户名,并且可以正常工作: @Path(“/myresource”) public class MyResoure { @Get public String getUserName() { return SecurityContextHolder.getContext().getAuthentication().getName(); } } 但我想将SecurityContext注入到类字段中(以编写JUnit测试)。 我尝试了一些记录的方法: 使用javax.ws.rs.core.SecurityContext我得到一个NullPointerException ,因为securityContext始终为null 。 @Path(“/myresource”) public class MyResoure { @Context private javax.ws.rs.core.SecurityContext securityContext; @Get public String getUserName() { return securityContext.getUserPrincipal().getName(); } } 使用org.apache.cxf.security.SecurityContext (请参阅Apache CXF文档 ),我得到一个NullPointerException ,因为securityContext.getUserPrincipal()始终为null 。 @Path(“/myresource”) public class MyResoure { @Context private org.apache.cxf.security.SecurityContext securityContext; @Get public […]
我遇到了自升级到CXF 2.7.7后无法理解的错误。 在进行Web服务调用时,CXF会报告此exception: org.apache.cxf.interceptor.Fault: Unexpected element {http://schema.myorg.com/GetReference/}ReferenceResponse found. Expected {http://services.myorg.com/}getReferences 这没有任何意义,因为ReferenceResponse正是我期望的响应。 getReferences这个名称似乎是指被调用的@WebMethod注释方法的名称。 此方法的返回类型是ReferenceResponse。 我错过了什么?
我使用Apache CXF 2.4.2,当我从数据库向用户返回一些对象时,我想要排除一些属性(例如,密码)。 如何在不创建临时课的情况下做到这一点? 这有注释吗?
我想知道我是否在jax-ws中使用了generics方法,例如: public List getSomething() jax-ws支持这个吗? 在客户端,该方法的返回方式是什么样的?
我有一个来自外部WS的WSDL文件,我正在连接到该文件。 我正在尝试使用CXF(适用于JAX-WS)。 但我从其他系统得到错误。 所以我决定看一下我们发送到该系统的数据,唯一不同的是CXF设置了空的SOAPAction http头。 我进行了一些阅读,看起来只有已知的解决方案直接指向WSDL。 但我已经这样做了。 有人对此有所了解吗? 头: POST /somepath HTTP/1.1 Content-Type: text/xml; charset=UTF-8 Accept: */* Authorization: Basic SOAPAction: “” User-Agent: Apache CXF 2.7.6 Cache-Control: no-cache Pragma: no-cache Host: somehost:8080 Connection: keep-alive Content-Length: 2791
我正在使用CXF和@WebService注释。 它生成WSDL文件作为一个大文件,有没有办法告诉它在XSD文件中外部生成wsdl:types并将它们导入WSDL?