cxf

org.apache.cxf.interceptor.Fault: Unmarshalling Error: Illegal character (NULL, unicode 0) encountered: not valid in any content

强颜欢笑 提交于 2021-02-19 06:37:05
问题 I am using a cxf webservice which uses local transport and accessing the webservice from java application. Webservice is reading a file and sending through webservice call. I am using the byte size as 512. Suppose the file size is 1200. First two attempt of retrieving the file is success and for the last chunk i am getting org.apache.cxf.interceptor.Fault: Unmarshalling Error: Illegal character (NULL, unicode 0) encountered: not valid in any content. Here chunk represents 512 bytes. I am

Setting CharacterEscapeHandler variable on a Marshaller doesn't work as expected in CXF

强颜欢笑 提交于 2021-02-19 04:16:00
问题 I'm using Apache CXF to implement some WebServices at server side. I have to implement a WebService that returns a string (Holder) with some values separated by tab character. Apache CXF encodes character tab as a tab, but our client (that can not be change...) doesn't accept it and only read tabs encoded as . So I tried to simply make a replaceAll on the string to change \t for , but an escapeHandler on Marshaller changes it to 	 . Then I tried to create a customCharacterEscapeHandler

Setting CharacterEscapeHandler variable on a Marshaller doesn't work as expected in CXF

两盒软妹~` 提交于 2021-02-19 04:14:38
问题 I'm using Apache CXF to implement some WebServices at server side. I have to implement a WebService that returns a string (Holder) with some values separated by tab character. Apache CXF encodes character tab as a tab, but our client (that can not be change...) doesn't accept it and only read tabs encoded as . So I tried to simply make a replaceAll on the string to change \t for , but an escapeHandler on Marshaller changes it to 	 . Then I tried to create a customCharacterEscapeHandler

cxf setting Nonce and created in SOAP wsse header

家住魔仙堡 提交于 2021-02-17 03:20:33
问题 I wanted to inject Nonce and Created element in WSSE security header using CXF. <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-6"> <wsse:Username>==Username==</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0

Change HttpTransportFactory cxf 2.7.3

♀尐吖头ヾ 提交于 2021-02-11 15:40:57
问题 I'm trying to change the HttpURLConnection that the cxf HTTPTransportFactory uses. Cxf (version 2.7.3) uses HTTPTransportFactory for http/https request. The HTTPTransportFactory uses Conduit of type URLConnectionHTTPConduit . URLConnectionHTTPConduit has method: createConnection which returns HttpURLConnection . I need to replace HttpURLConnection with my own custom one, lets call it CustomHttpURLConnection . I managed to change the TransportFactory that cxf uses by: Creating class that

Spring alternative to JAXRSClientFactory

我怕爱的太早我们不能终老 提交于 2021-02-11 14:58:31
问题 I have an interface with javax-ws-rs annotations for endpoints, and I am creating JAXRSClientFactory from cxf. Interface looks like this @Path("/ws") public interface TheWebServiceResource { @Path( "/" ) @Produces( { MediaType.APPLICATION_JSON } ) @GET Response handshake() ; } Then I create the resource TheWebServiceResource myResource = JAXRSClientFactory.create(url, cls, providers, features, conf); Now I know I could change the annotations to spring ones - @RequestMapping above the

How to set the Host header in JAX-RS / Apache CXF

自古美人都是妖i 提交于 2021-02-11 14:46:25
问题 I am trying to access a service over HTTPS but due to restrictive network settings I am trying to make the request through an ssh tunnel. I create the tunnel with a command like: ssh -L 9443:my-service.com:443 sdt-jump-server The service is only available via HTTPS, its hosted with a self-signed certificate, and it is behind a load-balancer that uses either the hostname or an explicit Host header to route incoming requests to the appropriate backend service. I am able to invoke the endpoint

CXFServlet throws java.lang.NoSuchMethodError:

时光总嘲笑我的痴心妄想 提交于 2021-02-11 14:17:37
问题 java.lang.NoSuchMethodError: org.codehaus.stax2.ri.EmptyIterator.getInstance()Lorg/codehaus/stax2/ri/EmptyIterator; at com.ctc.wstx.sw.OutputElementBase.getPrefixes(OutputElementBase.java:358) at org.apache.cxf.staxutils.StaxUtils.writeStartElement(StaxUtils.java:793) at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:741) at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:705) at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage

What is the Java Apache CXF equivalent of C# WCF AddressHeader?

。_饼干妹妹 提交于 2021-02-11 13:53:58
问题 I'm trying to access an old SOAP based system written in C# from a Java backend service. This C# application is looking for an AddressHeader to be populated with a specific value on every request. I'm using Apache CXF to create the requests to this service. Unfortunately, for the life of me, I cannot find out how to add this address header to each of the requests. Does anyone know what the equivalent in Java is and how to add it using Apache CXF? 回答1: The address header is the same as the

What is the Java Apache CXF equivalent of C# WCF AddressHeader?

纵然是瞬间 提交于 2021-02-11 13:51:04
问题 I'm trying to access an old SOAP based system written in C# from a Java backend service. This C# application is looking for an AddressHeader to be populated with a specific value on every request. I'm using Apache CXF to create the requests to this service. Unfortunately, for the life of me, I cannot find out how to add this address header to each of the requests. Does anyone know what the equivalent in Java is and how to add it using Apache CXF? 回答1: The address header is the same as the