saravanan77

Context matching...

Discussion created by saravanan77 on Jun 17, 2014

Hi,

 

In our SOAP service, we have 2 operations. 

Sample Request/Response :-

 

Operation 1 request always comes first followed by Operation 2.

 

Operation 1 Request / Response

------------------------------

 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

  <soap:Body>

    <ns1:Op1>

     <ns1:KV ns1:Key="Trace" ns1:Value="1416289000275000"/>
      <ns1:KV ns1:Key="ReceiverLastName" ns1:Value="***"/>

    </ns1:Op1>

  </soap:Body>

</soap:Envelope>

 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soap:Header>

  <soap:Body>

    <Op1Response>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="Trace" d3p1:Value="1416289000275000"/>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="ResponseCode" d3p1:Value="000083"/>

    </PaymentRiskDecisionResponse>

  </soap:Body>

</soap:Envelope>

 

Operation 2 Request / Response

------------------------------

 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

  <soap:Body>

    <ns1:Op2 >

      <ns1:KV ns1:Key="Trace" ns1:Value="1416289000275000"/>

    </ns1:Op2>

  </soap:Body>

</soap:Envelope>

 

Operation 2 response depends on Operation 1 ReceiverLastName value. 

 

If Op 1 ReceiverLastName is "***" then Op 2 response will be

 

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soap:Body>

    <Op2Response>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="Response" d3p1:Value="000000"/>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="Trace" d3p1:Value="1416289000275000"/>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="Option_X" d3p1:Value="1234567"/>

    </Op2Response>

  </soap:Body>

</soap:Envelope>

 

 

If Op 1 ReceiverLastName is "YYY" then Op 2 response will be

 

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soap:Body>

    <Op2Response>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="Response" d3p1:Value="000000"/>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="Trace" d3p1:Value="1416289000275000"/>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="Option_Y" d3p1:Value="ABCDEF"/>

      <d3p1:KV d3p1:CRUD="ADD" d3p1:Key="Option_Z" d3p1:Value="987654"/>   

    </Op2Response>

  </soap:Body>

</soap:Envelope>

 

Trace value will be same in both Operation 1 & Operation 2 request.  Basically on Op 1 request, i need to store the ReceiversLastName against Trace value in context/session.  When i receive Op2, i need to pull out ReceiversLastName based on Trace value from context/session and generate response accordingly.


Queries :-


1. How to store and retrieve from session/context if any ?

2. How to get the operation name in VSM(work flow) and take different route in workflow?


Saravanan A

Outcomes