Integration

Get Involved. Join the Conversation.

Topic

    logu Prasanth
    I made a get call-in REST adapter. I am providing XML...
    Topic posted September 30, 2019 by logu PrasanthSilver Medal: 2,000+ Points, last edited September 30, 2019, tagged Adapters, Connection, E-Business Suite, ERP Cloud, Integration, Mapping, Orchestration, PaaS, REST, SOAP, Web Services, xml 
    64 Views, 6 Comments
    Title:
    I made a get call-in REST adapter. I am providing XML SCHEMA (XSD) as response payload format. but Live payload is JSON.
    Summary:
    I made a get call-in REST adapter. I am providing XML SCHEMA (XSD) as response payload format. but Live payload is JSON.
    Content:

    HI,

    I made a get call-in REST adapter. I am providing  XML SCHEMA (XSD) as response payload format. but Live payload is JSON.

    When I am logging the data I getting below Error

    Xpath expression associated with <from> in copy assign activity is invalid.There is an user error that results in missing element value(s) in the xpath query.Please review the payload and modeling to ensure that all elements defined in the <from> xpath query have valid non-null values .
     
     

    In OIC, Is it the right approach. can we able to traverse using XSD as a format but the live payload is JSON

    Thanks in advance. 

     

     

    Comment

     

    • Mohana Gopal Selvam

      Hi Logu,

      If you have the sample JSON response, then select the response payload format as 'JSON Sample' and click the <<inline>> link and paste your JSON. It will solve your problem.

      Thanks

      Mohan

      • logu Prasanth

        Hi Mohana Gopal Selvam,

        Thank you so much.

        yes!, the Mentioned method has solve my problem, but response payload will differ(not much few fields are may include or exclude) for other scenarios.

        So is there any possible to use XSD file as response payload format.

         

         

         

    • vijayaragavan Ramasamy

      Is the response always going to be a JSON ? If so you can create a sample json with all possible elements and then use that as response payload format. 

    • Hemanth Lakkaraju

      In OIC, Is it the right approach. can we able to traverse using XSD as a format but the live payload is JSON

      Before answering I need to understand the flow/use-case better? Why would you need an XSD here but not JSON?

      If you specify XSD in rest adapter response configuration (which will default the content-type/accept to application/xml) and your actual response is JSON, ideally the invoke should fail with non-matching response types. Surprised it passed!

      What is the response you see for the invoke in activity stream? Do you see actual response or empty response?

      Coming back to your question: Yes it is possible, but answers to above questions will help design correctly.

    • KAMAL HOSSEN

      Hi,

      You can call the rest API from postman and copy the whole response and past as 'Sample Response' in connection configuration. You can also add the additional attributes/fields in the sample response, not necessarily all fields have to be there in REST response always.

      Thanks.