cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (CXF-1294) Problem creating several custom Headers
Date Sat, 15 Dec 2007 02:14:43 GMT

     [ https://issues.apache.org/jira/browse/CXF-1294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Benson Margulies reassigned CXF-1294:
-------------------------------------

    Assignee: Benson Margulies

> Problem creating several custom Headers
> ---------------------------------------
>
>                 Key: CXF-1294
>                 URL: https://issues.apache.org/jira/browse/CXF-1294
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.3
>         Environment: Windows XP SP2, Eclipse 3.3, JAVA 1.6.03
>            Reporter: Tim
>            Assignee: Benson Margulies
>
>   Hi all,
> we generated a Java WS Client from given wsdl-files, which should generate a SOAP Request
with several Header entries.
> At runtime one of two headers was dropped in the request.
> Excerpt from generated Code:
> <code>
> public interface TelematikSignedPortType {
>     @RequestWrapper(localName = "TelematikExecute", targetNamespace = "http://ws.gematik.de/tel/transport/v1.2",
className = "de.gematik.ws.tel.transport.v1.TelematikExecuteType")
>     @ResponseWrapper(localName = "TelematikExecuteResponse", targetNamespace = "http://ws.gematik.de/tel/transport/v1.2",
className = "de.gematik.ws.tel.transport.v1.TelematikExecuteType")
>     @WebMethod(operationName = "TelematikExecute", action = "http://ws.gematik.de/tel/transportWSDL/v1.4#telematikexecute")
>     public void telematikExecute(
>         @WebParam(targetNamespace = "http://ws.gematik.de/tel/transport/v1.2", name =
"Payload", mode = Mode.INOUT)
>         javax.xml.ws.Holder<de.gematik.ws.tel.transport.v1.TelematikExecuteType.Payload>
payload,
>         @WebParam(targetNamespace = "http://ws.gematik.de/tel/transport/v1.2", name =
"TransportHeader", header = true, mode = Mode.INOUT)
>         javax.xml.ws.Holder<de.gematik.ws.tel.transport.v1.TransportHeader> transportHeader,
>         @WebParam(targetNamespace = "http://ws.gematik.de/tel/transport/v1.2", name =
"TelematikHeader", header = true, mode = Mode.INOUT)
>         javax.xml.ws.Holder<de.gematik.ws.tel.transport.v1.TelematikHeader> telematikHeader
>     ) throws FaultMessage;
> }
> </code>
> This issue seems to be related to filling the AbstractMessageContainer with MessageParts.
This is done several times in the case of headers, overwriting  existing indices with the
container's current size. As a result the WrapperMsgInfo in WrapperClassOutInterceptor.java
gets corrupted index values, so that the first header is overwritten by the second one and
so on.
> <code>
> 		for (MessagePartInfo p : messageInfo.getMessageParts()) {
> 					if (Boolean.TRUE.equals(p
> 							.getProperty(ReflectionServiceFactoryBean.HEADER))) {
> 						MessagePartInfo mpi = wrappedMsgInfo.getMessagePart(p
> 								.getName());
>                                                 // MPI HAS CORRUPTED INDEX!
> 						if (objs.hasValue(p)) {
> 							newObjs.put(mpi, objs.get(p));
> 						}
> 					}
> 				}
> </code>
> Suggested Hotfix AbstractMessageContainer.jaa
> <code>
> 	public void addMessagePart(MessagePartInfo part) {
>                 // KEEP EXISTING INDEX IF ANY
> 		if (messageParts.containsKey(part.getName())) {
> 			part.setIndex(messageParts.get(part.getName()).getIndex());
> 		} else {
> 			part.setIndex(messageParts.size());
> 		}
> 		messageParts.put(part.getName(), part);
> 	}
> </code>
> Thx for looking into this, keep up the good work.
> cheers,
> Timmeh and Simon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message