Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 707D4E3B8 for ; Fri, 11 Jan 2013 17:38:13 +0000 (UTC) Received: (qmail 72306 invoked by uid 500); 11 Jan 2013 17:38:13 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 72285 invoked by uid 500); 11 Jan 2013 17:38:13 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 72276 invoked by uid 99); 11 Jan 2013 17:38:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 17:38:13 +0000 Date: Fri, 11 Jan 2013 17:38:13 +0000 (UTC) From: "Daniel Kulp (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CXF-4745) jaxb errors when calling with @WebParam and header=true MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Kulp updated CXF-4745: ----------------------------- Description: When calling a method with @WebParam and header=true in the signature like the following: {code:java} @WebResult(targetNamespace = "http://test2.test1/", name = "returnedValFromTestSOAP") public String testSOAP(@WebParam(mode = WebParam.Mode.IN, header = true, name = "credentials") Credentials credentials, @WebParam(name="par1") WrappedList par1, @WebParam(name="par2") WrappedList par2); {code} the call fails (the parameters are not correctly put in the message). Without the header=true the call it is ok and the message it is correctly formatted. The soap header it is formed in an intercetor: {code:java} package test1.test3; import java.util.List; import javax.xml.bind.JAXBException; import org.apache.cxf.binding.soap.SoapHeader; import org.apache.cxf.binding.soap.SoapMessage; import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; import org.apache.cxf.headers.Header; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.jaxb.JAXBDataBinding; import org.apache.cxf.phase.Phase; import javax.xml.namespace.QName; import test1.test2.Credentials; public class CustomSOAPHeaderOutInterceptor extends AbstractSoapInterceptor { public CustomSOAPHeaderOutInterceptor() { super(Phase.PRE_PROTOCOL); } @Override public void handleMessage(SoapMessage message) throws Fault{ SoapMessage soapMessage = (SoapMessage) message; List
list = message.getHeaders(); QName q = new QName("http://test2.test1/", "credentials"); Credentials credentials = new Credentials(); credentials.setUsername("uname"); credentials.setPassword("password"); credentials.setDomain("domain"); JAXBDataBinding dataBinding = null; try { dataBinding = new JAXBDataBinding(credentials.getClass()); } catch (JAXBException e1) { e1.printStackTrace(); } SoapHeader header = new SoapHeader(q, credentials, dataBinding); list.add(header); } } {code} was: When calling a method with @WebParam and header=true in the signature like the following: @WebResult(targetNamespace = "http://test2.test1/", name = "returnedValFromTestSOAP") public String testSOAP(@WebParam(mode = WebParam.Mode.IN, header = true, name = "credentials") Credentials credentials, @WebParam(name="par1") WrappedList par1, @WebParam(name="par2") WrappedList par2); the call fails (the parameters are not correctly put in the message). Without the header=true the call it is ok and the message it is correctly formatted. The soap header it is formed in an intercetor: package test1.test3; import java.util.List; import javax.xml.bind.JAXBException; import org.apache.cxf.binding.soap.SoapHeader; import org.apache.cxf.binding.soap.SoapMessage; import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; import org.apache.cxf.headers.Header; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.jaxb.JAXBDataBinding; import org.apache.cxf.phase.Phase; import javax.xml.namespace.QName; import test1.test2.Credentials; public class CustomSOAPHeaderOutInterceptor extends AbstractSoapInterceptor { public CustomSOAPHeaderOutInterceptor() { super(Phase.PRE_PROTOCOL); } @Override public void handleMessage(SoapMessage message) throws Fault{ SoapMessage soapMessage = (SoapMessage) message; List
list = message.getHeaders(); QName q = new QName("http://test2.test1/", "credentials"); Credentials credentials = new Credentials(); credentials.setUsername("uname"); credentials.setPassword("password"); credentials.setDomain("domain"); JAXBDataBinding dataBinding = null; try { dataBinding = new JAXBDataBinding(credentials.getClass()); } catch (JAXBException e1) { e1.printStackTrace(); } SoapHeader header = new SoapHeader(q, credentials, dataBinding); list.add(header); } } > jaxb errors when calling with @WebParam and header=true > ------------------------------------------------------- > > Key: CXF-4745 > URL: https://issues.apache.org/jira/browse/CXF-4745 > Project: CXF > Issue Type: Bug > Components: JAX-WS Runtime > Affects Versions: 2.7.1 > Environment: Windows 7 64 bit, jdk with jre 32 bit 1.6.0_18. Eclipse Helios sr2 > Reporter: bogdantudor74@gmail.com > Labels: cxf, runtime > Fix For: 2.7.3 > > Attachments: camelcxf.zip > > > When calling a method with @WebParam and header=true in the signature like the following: > {code:java} > @WebResult(targetNamespace = "http://test2.test1/", name = "returnedValFromTestSOAP") > public String testSOAP(@WebParam(mode = WebParam.Mode.IN, header = true, name = "credentials") Credentials credentials, > @WebParam(name="par1") WrappedList par1, > @WebParam(name="par2") WrappedList par2); > {code} > the call fails (the parameters are not correctly put in the message). Without the header=true the call it is ok and the message it is correctly formatted. The soap header it is formed in an intercetor: > {code:java} > package test1.test3; > import java.util.List; > import javax.xml.bind.JAXBException; > import org.apache.cxf.binding.soap.SoapHeader; > import org.apache.cxf.binding.soap.SoapMessage; > import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; > import org.apache.cxf.headers.Header; > import org.apache.cxf.interceptor.Fault; > import org.apache.cxf.jaxb.JAXBDataBinding; > import org.apache.cxf.phase.Phase; > import javax.xml.namespace.QName; > import test1.test2.Credentials; > public class CustomSOAPHeaderOutInterceptor extends AbstractSoapInterceptor > { > public CustomSOAPHeaderOutInterceptor() { > super(Phase.PRE_PROTOCOL); > } > @Override > public void handleMessage(SoapMessage message) throws Fault{ > SoapMessage soapMessage = (SoapMessage) message; > List
list = message.getHeaders(); > QName q = new QName("http://test2.test1/", "credentials"); > Credentials credentials = new Credentials(); > > credentials.setUsername("uname"); > credentials.setPassword("password"); > credentials.setDomain("domain"); > > JAXBDataBinding dataBinding = null; > try { > dataBinding = new JAXBDataBinding(credentials.getClass()); > } catch (JAXBException e1) { > e1.printStackTrace(); > } > SoapHeader header = new SoapHeader(q, credentials, dataBinding); > list.add(header); > } > } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira