Hi Buddhimala,

By looking at the ESB wire-log, it seems like the data is converted to
JSON. Were there any errors logged in the APIM console or in the ESB
console?

Thanks & Regards,
Mushthaq

On Tue, Nov 21, 2017 at 10:07 AM, Buddhimala Ranasinghe <[email protected]
> wrote:

> Hi All,
>
> I'm trying to implement the scenario as shown in the following diagram.
> [image: Inline image 1]
>
> The WSDL for my BE can be found in the following location.
> http://192.168.55.160:9763/services/NawalokaPatientService?wsdl
>
> I created an API with CRUD operations inside API Manager. For GET method
> I'm sending the request to the "read" method in my legacy BE. The sample
> response from my BE for the request will be as follows.
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> ">
>    <soapenv:Header>
>       <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-
> 1.0.xsd">
>          <wsu:Timestamp wsu:Id="Timestamp-54" xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-
> 200401-wss-wssecurity-utility-1.0.xsd">
>             <wsu:Created>2017-11-20T10:30:41.878Z</wsu:Created>
>             <wsu:Expires>2017-11-20T10:35:41.878Z</wsu:Expires>
>          </wsu:Timestamp>
>       </wsse:Security>
>    </soapenv:Header>
>    <soapenv:Body>
>       <ns:readResponse xmlns:ns="http://service.sample.nawaloka.com";>
>          <ns:return xsi:type="ax27:Patient" xmlns:ax27="http://dto.
> service.sample.nawaloka.com/xsd" xmlns:ax25="http://service.
> sample.nawaloka.com/xsd" xmlns:xsi="http://www.w3.org/
> 2001/XMLSchema-instance">
>             <ax27:insurer xsi:type="ax27:Insurer">
>                <ax27:insurerEmail>?</ax27:insurerEmail>
>                <ax27:insurerName>?</ax27:insurerName>
>                <ax27:insurerPhone>?</ax27:insurerPhone>
>             </ax27:insurer>
>             <ax27:medical xsi:nil="true"/>
>             <ax27:parentGuardian xsi:type="ax27:ParentGuardian">
>                <ax27:guardianEmail>?</ax27:guardianEmail>
>                <ax27:guardianName>?</ax27:guardianName>
>                <ax27:guardianPhone>?</ax27:guardianPhone>
>             </ax27:parentGuardian>
>             <ax27:patientContact xsi:type="ax27:PatientContact">
>                <ax27:address>?</ax27:address>
>                <ax27:email>?</ax27:email>
>                <ax27:phone>?</ax27:phone>
>             </ax27:patientContact>
>             <ax27:patientFullName>abc</ax27:patientFullName>
>             <ax27:patientId>[email protected]</ax27:patientId>
>             <ax27:physician xsi:type="ax27:Physician">
>                <ax27:physicianEmail>M.Rajan</ax27:physicianEmail>
>                <ax27:physicianName>?</ax27:physicianName>
>                <ax27:physicianPhone>?</ax27:physicianPhone>
>             </ax27:physician>
>          </ns:return>
>       </ns:readResponse>
>    </soapenv:Body>
> </soapenv:Envelope>
>
> But my response should be in JSON format so that I tried to convert the
> response into JSON using "<property name="messageType" scope="axis2"
> value="application/json"/>"
>
> But my problem is, in my response to the client, it should only contain 
> *insurer
> details, parentGuardian, patientContact, patientFullName and patientId*.
> Therefore, I tried of defining a custom payload as follows.
>
> <property name="messageType" scope="axis2" value="application/json"/>
>                <payloadFactory media-type="json">
>                   <format>
>                 {
>                 "patient":{
>                         "insurer": "$1",
>                         "parentGuardian": "$2",
>                         "patientContact": "$3",
>                         "patientFullName": "$4",
>                         "patientId": "$5"
>
>
>                 }
>             }
>         </format>
>                   <args>
>                      <arg evaluator="json" expression="$.readResponse.
> return.insurer"/>
>                      <arg evaluator="json" expression="$.readResponse.
> return.parentGuardian"/>
>                      <arg evaluator="json" expression="$.readResponse.
> return.patientContact"/>
>                      <arg evaluator="json" expression="$.readResponse.
> return.patientFullName"/>
>                      <arg evaluator="json" expression="$.readResponse.
> return.patientId"/>
>                   </args>
>                </payloadFactory>
>
>                <send/>
> But, when I invoke the service, I cannot see any response at client side.
> I'm attaching the wirelogs for my ESB and APIM.
>
> Can you please help me to solve this problem?Where am I doing wrong?
> --
>
>
> *Buddhimala Ranasinghe*
> Software Engineer-Support Team | WSO2
> Emil: [email protected]
> Mobile:+94771563138 <+94%2077%20156%203138>
> Web:http://wso2.com
> [image: https://wso2.com/signature] <https://wso2.com/signature>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Mushthaq Rumy
*Software Engineer*
Mobile : +94 (0) 779 492140 <%2B94%20%280%29%20773%20451194>
Email : [email protected]
WSO2, Inc.; http://wso2.com/
lean . enterprise . middleware.

<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to