ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Σπύρος Αναστασόπουλος <winwas...@gmail.com>
Subject ODE and SOAP Headers
Date Mon, 01 Jun 2009 11:12:16 GMT
Hi

I have a problem with the use of SOAP headers.

I want to implement a BPEL process that receives
a message, adds a SOAP Header and passes it to a
second web service.

The wsdl for the bpel process has not a header binding
since it is not required.

The wsdl for the second process has a header binding

<wsdl:message name="CachePairRequest">
  <wsdl:part name="parameters" element="tns:CachePair"/>
  <wsdl:part name="cacheID" element="tns:CacheID"/>
</wsdl:message>

<wsdl:operation name="CachePair">
  <soap:operation soapAction="http://www.stark.org/Cache/CachePair"
style="document"/>
  <wsdl:input>
    <soap:header message="tns:CachePairRequest" part="cacheID" use="literal"/>
    <soap:body message="tns:CachePairRequest" parts="parameters" use="literal"/>
  </wsdl:input>
</wsdl:operation>

I believe that the wsdl is correct. I use the JDK 6 wsimport tool
and the generated client code correctly handles the SOAP header.

The bpel snippet for the header is
<assign>
  <copy>
  <from><literal>
  <CacheID xmlns="http://www.stark.org/Cache">BADC0C0A</CacheID>
  </literal></from>
  <to>$CacheRequest.cacheID</to>
  </copy>
</assign>

However when i run it, an error message is logged

org.apache.ode.axis2.OdeFault: Message is missing required part: cacheID

        at org.apache.ode.axis2.util.SoapMessageConverter.handleSoapHeaderDef(So
apMessageConverter.java:245)
        at org.apache.ode.axis2.util.SoapMessageConverter.createSoapHeaders(Soap
MessageConverter.java:210)
        at org.apache.ode.axis2.util.SoapMessageConverter.createSoapRequest(Soap
MessageConverter.java:166)
        at org.apache.ode.axis2.SoapExternalService.invoke(SoapExternalService.j
ava:123)
        at org.apache.ode.axis2.MessageExchangeContextImpl.invokePartner(Message
ExchangeContextImpl.java:52)
        at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(BpelRuntimeC
ontextImpl.java:772)
        at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:100)
        at sun.reflect.GeneratedMethodAccessor180.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:4
51)
        at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
        at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntime
ContextImpl.java:847)
        at org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeNewInstance(Pa
rtnerLinkMyRoleImpl.java:203)
        at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java
:202)
        at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(BpelProcess.ja
va:370)
        at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineIm
pl.java:415)
        at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerIm
pl.java:377)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(SimpleSchedu
ler.java:386)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(SimpleSchedu
ler.java:380)
        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(Simpl
eScheduler.java:208)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleSchedule
r.java:379)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleSchedule
r.java:376)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: Message is missing required part:
 cacheID
        at org.apache.ode.utils.wsdl.Messages.msgOdeMessageMissingRequiredPart(M
essages.java:164)
        ... 28 more

It seems that the message generated by ODE is invalid.

The assignment passes without errors. If for example
i enter a non-existent part like cacheIDAAAA then an
error message is displayed during deployment.

Also if i change the wsdl to

<soap:body message="tns:CachePairRequest" parts="parameters cacheID"
use="literal"/>

and remove the header binding
then the CacheID element is correctly appended to the SOAP Body.

I tested against both ODE 1.2 and 1.3.2 running on tomcat 6.0.18
and the problem remains.
Can anyone provide an example of correct SOAP Header usage or
give me some hints to find the error?

Thanks in advance
Anastasopoulos Spyros

Mime
View raw message