[
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<String> par1,
@WebParam(name="par2") WrappedList<String> 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<Header> 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<String> par1,
@WebParam(name="par2") WrappedList<String> 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<Header> 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: [email protected]
> 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<String> par1,
> @WebParam(name="par2") WrappedList<String> 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<Header> 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