Hi,
I'm struggling a little attempting to consume this web service (it is homework related but not actual homework). This BPEL process seems to provide asynchronous callbacks, I'm just not sure exactly how it is to be used. The wsimport generated the classes below:
> AttributedQName.java
> AttributedURI.java
> EndpointReferenceType.java
> N6368808CreditFlow.java
> N6368808CreditFlowCallback.java
> N6368808CreditFlowCallbackService.java
> N6368808CreditFlowProcessRequest.java
> N6368808CreditFlowProcessResponse.java
> N6368808CreditFlow_Service.java
> ObjectFactory.java
> ReferencePropertiesType.java
> Relationship.java ServiceNameType.java
> package-info.java
The N6368808CreditFlow.java is the interface with the initiate method which is I assume the credit method as it is the only method available, it takes a request as a parameter. Whereas the N6368808CreditFlowCallback.java contains an onResult method which takes a Response as a parameter.
How does one consume this service? I've been able to call the method but not get a response sent back (not sure how to get a response as the onResult method doesn't do anything and the initiate method returns void (not even a callback or response)).
Here is my code so far:
N6368808CreditFlow_Service service1 = new N6368808CreditFlow_Service();
N6368808CreditFlow port = service1.getN6368808CreditFlowPort();
N6368808CreditFlowProcessRequest rqt = new N6368808CreditFlowProcessRequest();
rqt.setSsn("123456789");
port.initiate(rqt);
System.out.println("Done");
Which according to the BPEL console works and it is given "123456789", my question is how do you get the response?
Here is a snippet from the BPEL source:
<sequence name="main">
<!--
Receive input from requestor. (Note: This maps to operation defined in n6368808_CreditFlow.wsdl)
-->
<receive name="receiveInput" partnerLink="client" portType="client:n6368808_CreditFlow" operation="initiate" variable="inputVariable" createInstance="yes"/>
<!--
Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
-->
- <scope name="getCreditRating">
- <sequence name="Sequence_1">
- <assign name="assign_SSN">
- <copy>
<from variable="inputVariable" part="payload" query="/client:n6368808_CreditFlowProcessRequest/client:ssn"/>
<to variable="invoke_CRS_process_InputVariable" part="payload" query="/ns1:ssn"/>
</copy>
</assign>
<invoke name="invoke_CRS" partnerLink="CreditRatingService" portType="ns1:CreditRatingService" operation="process" inputVariable="invoke_CRS_process_InputVariable" outputVariable="invoke_CRS_process_OutputVariable"/>
- <assign name="return_SSN">
- <copy>
<from variable="invoke_CRS_process_OutputVariable" part="payload" query="/ns1:rating"/>
<to variable="outputVariable" part="payload" query="/client:n6368808_CreditFlowProcessResponse/client:creditRating"/>
</copy>
</assign>
</sequence>
</scope>
<invoke name="callbackClient" partnerLink="client" portType="client:n6368808_CreditFlowCallback" operation="onResult" inputVariable="outputVariable"/>
</sequence>
</process>