camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: how to deal with a response soap header?
Date Mon, 13 Oct 2008 14:20:56 GMT
Hi

Which Camel and CXF version are you using?
>From you description , I think it should be a CXF issue?
Can you fill a JIAR[1] and submit your test case to it?

[1] https://issues.apache.org/jira/browse/CXF

Willem

Sky Wang wrote:
> hi,
> I hava a webservice application, which receive a soap header + soap body,
> and response a soap header + soap body.
> When i use WSDLToJava tool to create the java code from wsdl, it creates an
> interface for me as follow:
>   @WebService(targetNamespace = "http://com.aspire/", name = "Service")
>   @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
>   @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>   public interface Service{
>       @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>       @WebMethod
>       public void serviceReq(
>           @WebParam(partName = "request", name = "serviceReq",
> targetNamespace = "http://com.aspire/xsd")
>           aspire.com.xsd.ServiceReq request,
>           @WebParam(partName = "requestHeader", name = "serviceHeader",
> targetNamespace = "http://com.aspire/xsd", header = true)
>           aspire.com.xsd.ServiceHeader requestHeader,
>           @WebParam(partName = "response", mode = WebParam.Mode.OUT, name =
> "serviceResponse", targetNamespace = "http://com.aspire/xsd")
>           javax.xml.ws.Holder<aspire.com.xsd.ServiceResponse> response,
>           @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT,
> name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header =
> true)
>           javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>       );
>   }
> 
> I implement the routing rule in the xml file. In my processor, i only need
> set response body and response header.I have traced the exchange object of
> the processor, the exchange.out element is null, and  the exchange.in
> element is a CxfMessage object. The exchange.in.body element is a
> MessageContentList object: Object[0] is ServiceReq,  Object[1] is
> ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> 
> So i put response body into Object[2], and put response header into
> Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
> 	  List inBody = (List) in.getBody();
> 	  Holder holderBody = (Holder)inBody.get(2);
> 	  holderBody .value = body;// body is a ServiceResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
> 	  holderHeader .value = header;//header is a ServiceHeader object
> 
> But, when i run the application, i got an
> Exception:java.lang.OutOfMemoryError: Java heap space.
> I  debuged into program, there is an Infinite Loop occured at the       
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: (inObjects == outObjects) = true, which leads to an
> Infinite Loop.
> 
> Any ideas? 
> 
> Greetings 
> 
> Sky wang
> 
> 
> 


Mime
View raw message