You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sky Wang <wa...@aspire-tech.com> on 2008/10/13 16:09:40 UTC
how to deal with a response soap header?
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
--
View this message in context: http://www.nabble.com/how-to-deal-with-a-response-soap-header--tp19955640s22882p19955640.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: how to deal with a response soap header?
Posted by Sky Wang <wa...@aspire-tech.com>.
I use apache-camel-1.4.0 and apache-cxf-2.1.1.
I'll fill a JIAR[1].Tanks for your reply.
willem.jiang wrote:
>
> 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
>
>
--
View this message in context: http://www.nabble.com/how-to-deal-with-a-response-soap-header--tp19955640s22882p19965625.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: how to deal with a response soap header?
Posted by Willem Jiang <wi...@gmail.com>.
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
>
>
>