Hi,
I'm still with my experience of integration of PHP and ODE, and I'm
closed to complete.
I can send with PHP a one-way request to ODE with some callback
information. ODE can recognize the EPR and the sessionId.
Then, after some (successful) assign, ODE send a one-way request to
another PHP script, which can read the message and send it by mail to
me. This script take into acount the callback information sent by ODE
(<callback><Adresse>...</Adress><session>...<session></callback).
Then, by clicking on a link in the message I received, I lauch another
PHP script which picks up the callback received from ODE and send back a
request to the process.
ODE receives the request, makes an implicite correlation and wakes up
the right instance. I can see my sessionID in the log.
Then it has to do an Assign to initialize the response toward the
initial "client", which I implemented once again as a PHP WS.
The endpoint used by ODE is correct.
But at this point, ODE falls in error. You'll find below a part of the log.
It seems that the error occurs in the function "InvokePartner" which,
according to svn, has been replaced by the functions
"InvokeReliablePartner" and "InvokeUnreliablePartner" one year ago, but
may be that does'nt matter.
The exception is "java.lang.NullPointerException", thus I suspect
something is wrong in the preceding Assign. I've learnt that this kind
of step is a little bit sensible.
While ODE should call the PHP WS, nothing appears in the access.log of
http. Thus the error occurs before the invocation.
Here's the log:
---------------------------------------------------------------------------------------------------------
DEBUG - GeronimoLog.debug(66) | >> handleWorkEvent(jobData={final=true,
mexid=hqejbhcnphr3k60kw2ielr,
pid={http://sample.bpel.org/bpel/sample}ValidationProcess-76, retry=3,
type=INVOKE_INTERNAL})
DEBUG - GeronimoLog.debug(66) | InvokeInternal event for mexid
hqejbhcnphr3k60kw2ielr
DEBUG - GeronimoLog.debug(66) | GET MEX property
org.apache.ode.bpel.myRoleSessionId = hqejbhcnphr3k60kw2ieln
DEBUG - GeronimoLog.debug(66) | GET MEX property
org.apache.ode.bpel.myRoleSessionId = hqejbhcnphr3k60kw2ieln
DEBUG - GeronimoLog.debug(66) | GET MEX property
org.apache.ode.bpel.partnerRoleSessionId = null
DEBUG - GeronimoLog.debug(66) | INPUTMSG: 26.callback: MSG RCVD
keys=[{CorrelationKey setId=-1, values=[hqejbhcnphr3k60kw2ieln]}]
mySessionId=hqejbhcnphr3k60kw2ieln partnerSessionId=null
DEBUG - GeronimoLog.debug(66) | INPUTMSG: 26.callback: ckey
{CorrelationKey setId=-1, values=[hqejbhcnphr3k60kw2ieln]} route is to
[EMAIL PROTECTED]
DEBUG - GeronimoLog.debug(66) | INPUTMSG: 26.callback: ROUTING to
instance 10962
DEBUG - GeronimoLog.debug(66) | BpelRuntimeContextImpl created for
instance 10962. INDEXED STATE={{OScope
'__PROCESS_SCOPE:ValidationProcess' id=3}::0=[ACTIVE(...)],
OPickReceive#42-ReceptionChoix::13=[ACTIVITYGUARD(...)],
OSequence#27-Notification::2=[SEQUENCE(self=(OSequence#27-Notification,TerminationChannel#3,ParentScopeChannel#5),
[EMAIL PROTECTED],
remaining=[OPickReceive#42-ReceptionChoix, {OAssign : LectureReponse,
joinCondition=null}, {OScope 'CompteRendu' id=55}])],
OPickReceive#42-ReceptionChoix::14=[PICK(...)], {OScope
'__PROCESS_SCOPE:ValidationProcess' id=3}::0=[SCOPE(...)],
OSequence#27-Notification::1=[ACTIVITYGUARD(...)]}
DEBUG - GeronimoLog.debug(66) | Resolving endpoint reference <?xml
version="1.0" encoding="UTF-8"?>
<EndpointReference xmlns="http://www.w3.org/2005/08/addressing"><session
xmlns="http://www.intalio.com/type/session">48bd271f1a2bb</session><Address>http://arrigo-dev/Notification/onResult.php</Address></EndpointReference>
DEBUG - GeronimoLog.debug(66) | INVOKING PARTNER:
partnerLink={PartnerLinkInstance
partnerLinkDecl=OPartnerLink#25,scopeInstanceId=11972}, op=onResult
channel=null)
DEBUG - GeronimoLog.debug(66) | INVOKE PARTNER (SEP):
sessionId=hqejbhcnphr3k60kw2ielm partnerSessionId=48bd271f1a2bb
DEBUG - GeronimoLog.debug(66) | Invoking a partner operation: onResult
ERROR - GeronimoLog.error(108) | Method "run" in class
"org.apache.ode.bpel.runtime.INVOKE" threw an unexpected exception.
java.lang.NullPointerException
at
org.apache.ode.axis2.MessageExchangeContextImpl.invokePartner(MessageExchangeContextImpl.java:51)
at
org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(BpelRuntimeContextImpl.java:775)
----------------------------------------------------------------------------------
Here's my BPEL process:
<?xml version="1.0" encoding="UTF-8"?>
<bpws:process exitOnStandardFault="yes" name="ValidationProcess"
suppressJoinFailure="no"
targetNamespace="http://sample.bpel.org/bpel/sample"
xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:ns="http://www.example.org/client/"
xmlns:ns0="http://bpel.lmcu.fr/xsd/Validation"
xmlns:ns1="http://bpel.lmcu.fr/Notification/"
xmlns:ns2="http://bpel.lmcu.fr/tests/Validation"
xmlns:tns="http://sample.bpel.org/bpel/sample">
<bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
location="ValidationProcess.wsdl"
namespace="http://sample.bpel.org/bpel/sample"/>
<bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
location="Notification.wsdl"
namespace="http://bpel.lmcu.fr/Notification/"/>
<bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
location="client.wsdl" namespace="http://www.example.org/client/"/>
<bpws:import importType="http://www.w3.org/2001/XMLSchema"
location="Notification.xsd"
namespace="http://bpel.lmcu.fr/xsd/Validation/request"/>
<bpws:partnerLinks>
<bpws:partnerLink initializePartnerRole="no"
myRole="ValidationProcessProvider" name="client"
partnerLinkType="tns:ValidationProcessPLT"
partnerRole="ValidationProcessRequester"/>
<bpws:partnerLink initializePartnerRole="yes"
myRole="NotifierRole" name="Notification"
partnerLinkType="tns:NotificationPLT"
partnerRole="NotifiedRole"/>
</bpws:partnerLinks>
<bpws:variables>
<bpws:variable messageType="tns:ValidationProcessRequestMessage"
name="input"/>
<bpws:variable messageType="ns:onResultRequest" name="output"/>
<bpws:variable messageType="ns1:transmitRequest" name="Message"/>
<bpws:variable messageType="ns1:transmitResponse" name="Response1"/>
<bpws:variable messageType="ns1:callbackRequest" name="choice"/>
</bpws:variables>
<bpws:correlationSets>
<bpws:correlationSet name="CorrelationSet"/>
</bpws:correlationSets>
<bpws:sequence name="Notification">
<bpws:receive createInstance="yes" name="DemandeNotification"
operation="initiate" partnerLink="client"
portType="tns:ValidationProcess" variable="input"/>
<bpws:assign name="Initialisations" validate="no">
<bpws:copy keepSrcElementName="no">
<bpws:from part="payload" variable="input"/>
<bpws:to part="requete" variable="Message"/>
</bpws:copy>
</bpws:assign>
<bpws:invoke inputVariable="Message" name="EnvoiMessage"
operation="transmit" outputVariable="Response1"
partnerLink="Notification" portType="ns1:NotifiedPT"/>
<bpws:receive name="ReceptionChoix" operation="callback"
partnerLink="Notification" portType="ns1:NotifierPT"
variable="choice"/>
<bpws:assign name="LectureReponse" validate="no">
<bpws:copy>
<bpws:from>
<bpws:literal>
<rep:onResultRequest
xmlns:rep="http://www.example.org/client/">
<rep:result/>
</rep:onResultRequest>
</bpws:literal>
</bpws:from>
<bpws:to part="parameters" variable="output"/>
</bpws:copy>
<bpws:copy keepSrcElementName="no">
<bpws:from part="response" variable="choice">
<bpws:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[/response]]></bpws:query>
</bpws:from>
<bpws:to part="parameters" variable="output">
<bpws:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[/ns:result]]></bpws:query>
</bpws:to>
</bpws:copy>
</bpws:assign>
<bpws:invoke inputVariable="output" name="CompteRendu"
operation="onResult" partnerLink="client" portType="ns:client"/>
</bpws:sequence>
</bpws:process>
---------------------------------------------------------------------------------------------
the client.wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.example.org/client/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="client"
targetNamespace="http://www.example.org/client/">
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.org/client/">
<xsd:element name="onResultRequest"
type="tns:onResultRequestType"></xsd:element>
<xsd:complexType name="onResultRequestType">
<xsd:sequence>
<xsd:element name="result" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="onResultRequest">
<wsdl:part element="tns:onResultRequest" name="parameters"/>
</wsdl:message>
<wsdl:portType name="client">
<wsdl:operation name="onResult">
<wsdl:input message="tns:onResultRequest"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="clientSOAP" type="tns:client">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="onResult">
<soap:operation
soapAction="http://www.example.org/client/onResult" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="clientWS">
<wsdl:port binding="tns:clientSOAP" name="clientPort">
<soap:address
location="http://arrigo-dev/Notification/onResult.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-----------------------------------------------------------------------------------------
Thanks in advance for your responses,
regards,
Ph.
--