cxf

Can a web service return a stream?

家住魔仙堡 提交于 2019-12-20 09:55:09
问题 I've been writing a little application that will let people upload & download files to me. I've added a web service to this applciation to provide the upload/download functionality that way but I'm not too sure on how well my implementation is going to cope with large files. At the moment the definitions of the upload & download methods look like this (written using Apache CXF): boolean uploadFile(@WebParam(name = "username") String username, @WebParam(name = "password") String password,

CXF 2.7.14 + WSS4J + Websphere 7 ClassCastException

ぐ巨炮叔叔 提交于 2019-12-20 07:38:00
问题 we are using WSS4JOutInterceptor to sign outgoing soap message from our application. We have tested the application on Tomcat without any problems, but on Websphere (7) we keep getting the ClassCastException: java.lang.ClassCastException: org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory incompatible with javax.xml.crypto.dsig.XMLSignatureFactory at javax.xml.crypto.dsig.XMLSignatureFactory.findInstance(XMLSignatureFactory.java:202) at javax.xml.crypto.dsig.XMLSignatureFactory

Configure CXF JAX-WS service to work with MOXY

天涯浪子 提交于 2019-12-20 04:50:26
问题 Although I've added a jaxb.properties with MOXY factory and I see that the JAXB was switched to moxy, CXF has a method named createRIContext in the JAXBUtils class which loads hard coded the sun JAXB implementation. Is there a way to override it and use moxy instead? The problematic code is the following: // fall back if we're using another jaxb implementation try { riContext = JAXBUtils.createRIContext(contextClasses .toArray(new Class[contextClasses.size()]), tns); } It loads hard coded the

Webservice client, should i keep service or port instance?

こ雲淡風輕ζ 提交于 2019-12-20 02:13:20
问题 i am developing web service client with cxf codegen and it generating class MyService extends Service for client part. My question now is when i am creating client, should be MyService object created each time i want send request or keep it and each time create Port? Or can i keep Port as well? What is the best way to make client? Thanks 回答1: Keeping the Port around is definitely the best performing option, but keep in mind the thread safety aspects: http://cxf.apache.org/faq.html#FAQ

Why CXF / JAXB read whole InputStream into memory before marshalling to SOAP message

浪子不回头ぞ 提交于 2019-12-19 14:03:11
问题 INFO - Sample code I've set up sample code (SSCCE) for you to help track the problem: https://github.com/ljader/test-cxf-base64-marshall The problem I'm integrating with 3rd party JAX-WS service, so I cannot change the WSDL. The 3rd party webservice expects Base64 encoded bytes to perform some operation on them - they expect that client sends whole bytes in SOAP message. They don't want to change to MTOM / XOP, so I'm stuck with current requirements. I decided to use CXF to easily set up

How to specify frontend for wsdl2java in a pom.xml?

大兔子大兔子 提交于 2019-12-19 06:52:05
问题 I found this great tip about adding -fe jaxws21 to the wsdl2java command to have it generate jaxws 2.1 compliant code instead of 2.2, but Maven's pom.xml doesn't seem to like this addition when placed like this: <goals> <goal>wsdl2java -fe jaxws21</goal> </goals> What is the correct way of specifying a frontend for wsdl2java that's used in a pom.xml? 回答1: If you are using cxf-codegen-plugin, you can add the arguments in extraargs element: <executions> <execution> <configuration> <wsdlOptions>

Are CXF client proxies thread safe?

巧了我就是萌 提交于 2019-12-19 06:14:12
问题 I'm using CXF to generate SOAP client classes. In the CXF documentation, they write Are JAX-WS client proxies thread safe? Official JAX-WS answer: No. According to the JAX-WS spec, the client proxies are NOT thread safe. To write portable code, you should treat them as non-thread safe and synchronize access or use a pool of instances or similar. CXF answer: CXF proxies are thread safe for MANY use cases. The exceptions are: (I'm omitting their description of these use cases) For most "simple"

how to make cxf-xjc-plugin generate sources in utf-8

孤者浪人 提交于 2019-12-19 05:56:23
问题 I try to generate java classes from xsd in a maven project using cxf-xjc-plugin. It runs fine, but the generated source files get platform specific encoding (cp1251 on a windows pc) instead of utf-8. If any xsd types contain non-latin characters in schema annotations, then they become readable only in that specific encoding and the compiler later complains with [WARNING] /C:/.../SomeType.java:[17,4] unmappable character for encoding UTF-8 . Please help me force utf-8 for sources generation.

cxf + wss4j + maven NoSuchMethod error

若如初见. 提交于 2019-12-19 05:49:09
问题 trying to use the cxf+wss4j using maven. Created both the service and client without any compilation issues. The service runs fine in tomcat. Issue: When I run the client code, I get "java.lang.NoSuchMethodError: org.apache.xml.security.utils.I18n.init(Ljava/util/ResourceBundle;)V". This class is in xmlsec jar which comes along with cxf distribution. pom.xml for service project: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

cxf + wss4j + maven NoSuchMethod error

最后都变了- 提交于 2019-12-19 05:48:08
问题 trying to use the cxf+wss4j using maven. Created both the service and client without any compilation issues. The service runs fine in tomcat. Issue: When I run the client code, I get "java.lang.NoSuchMethodError: org.apache.xml.security.utils.I18n.init(Ljava/util/ResourceBundle;)V". This class is in xmlsec jar which comes along with cxf distribution. pom.xml for service project: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi