On Thu, Oct 27, 2011 at 3:24 PM, jp_listero <[email protected]> wrote: > OK, but I don't known how to fix it. > > And I don't if are chars from my request or response. In this case > only send numbers in the params ... > may be are at the response because the Exception is at unmarshall .... > thats is correct ?
The above I cannot read. 'if are chars?' The rules are simple: only valid xml 1.0 chars can occur in xs:string data. If you need to send code points that are not xml 1.0, you need to encode them somehow. The simplest thing to do us to use base64Binary, if somewhat verbose. It depends on the lengths of the strings. > > thanks. > > 2011/10/24 David Karlsen <[email protected]>: >> See this recent thread about the same: >> http://cxf.547215.n5.nabble.com/String-with-Ctrl-Character-marshalling-unmarshalling-error-td4924570.html >> >> 2011/10/24 jp_listero <[email protected]>: >>> and what caracters are forbidden ? >>> >>> how I fix that ? >>> something like this: >>> >>> System.Text.Encoding.UTF8.GetString(value); >>> >>> ? >>> >>> thanks! >>> >>> 2011/10/22 Benson Margulies <[email protected]>: >>>> This happens when you have an xs:string element in your service and >>>> you try to pass a value that contains a character forbidden in XML >>>> 1.0. Yes, there are Unicode characters forbidden in XML 1.0, such as >>>> the form feed (or, in your case, SUBSTITUTE). If you must send >>>> characters outside of XML 1.0, you have to use some other XML schema >>>> type other than string, or move the data to an attachment. >>>> >>>> On Sat, Oct 22, 2011 at 3:18 PM, jp_listero <[email protected]> wrote: >>>>> hi, >>>>> >>>>> I implemented a client with CXF and I have some times exceptions like this >>>>> >>>>> [javax.xml.stream.XMLStreamException: ParseError at [row,col]:[16,27] >>>>> Message: An invalid XML character (Unicode: 0x1a) was found in the >>>>> element content of the document.] >>>>> at >>>>> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:426) >>>>> at >>>>> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362) >>>>> at >>>>> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339) >>>>> at >>>>> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:610) >>>>> at >>>>> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:530) >>>>> at >>>>> org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:114) >>>>> at >>>>> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:188) >>>>> at >>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) >>>>> at >>>>> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658) >>>>> at >>>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139) >>>>> at >>>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022) >>>>> at >>>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947) >>>>> at >>>>> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) >>>>> at >>>>> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632) >>>>> at >>>>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) >>>>> at >>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) >>>>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472) >>>>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302) >>>>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) >>>>> at >>>>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) >>>>> at >>>>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123) >>>>> ... 8 more >>>>> >>>>> >>>>> this is my source code: >>>>> >>>>> private void initWs1Config(){ >>>>> JaxWsProxyFactoryBean factoryBean = new >>>>> JaxWsProxyFactoryBean(); >>>>> factoryBean.setServiceClass(WspresC4SoapPort.class); >>>>> factoryBean.setAddress("http://"+getIpPort()+getUrlC4()); >>>>> >>>>> String endpointURL= "http://"+getIpPort()+getUrlC4(); >>>>> port = (WspresC4SoapPort)factoryBean.create(); >>>>> BindingProvider bp = (BindingProvider)port; >>>>> >>>>> bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, >>>>> endpointURL); >>>>> >>>>> Client client = ClientProxy.getClient(port); >>>>> HTTPConduit http = (HTTPConduit) client.getConduit(); >>>>> HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); >>>>> httpClientPolicy.setConnectionTimeout(36000); >>>>> httpClientPolicy.setAllowChunking(false); >>>>> http.setClient(httpClientPolicy); >>>>> >>>>> AuthorizationPolicy authorization = new >>>>> AuthorizationPolicy(); >>>>> >>>>> authorization.setUserName(getUser()); >>>>> authorization.setPassword(getPassword()); >>>>> http.setAuthorization(authorization); >>>>> } >>>>> >>>>> maybe is something in the server side ? >>>>> thanks ! >>>>> >>>> >>> >> >> >> >> -- >> -- >> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen >> >
