IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  REST API POST Response is coming null for Java Service in Postman

    Posted 09/30/20 02:01 AM

    Hi,
    I have created Document Reference Request & Response in Input/Output Parameter in Java Service. I have generated Java Code which is modified to map the right attributes,
    Request:

     {
    "Sender": "Buyer1",
    "Orders": [{
    "OrderID": "100",
    "SKU": "01",
    "UnitPrice": "100",
    "Quantity": "20"
    }]
    }
    
    

    Response:

     {
    "Sender": "Buyer1",
    "Orders": [
    {
    "OrderID": "100",
    "SKU": "01",
    "UnitPrice": "100",
    "Quantity": "20"
    }
    ],
    "Response": {
    "Response": {
    "Customer": null,
    "Orders": [
    {
    "OrderID": null,
    "AmountDue": null
    }
    ]
    }
    }
    }
    

    Can someone guide me why null is coming in Response in POSTMAN?

    Thanks!


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB
    #webMethods-io-Integration


  • 2.  RE: REST API POST Response is coming null for Java Service in Postman

    Posted 09/30/20 02:28 AM

    Hi @harleen.kaur

    Could you please post some screenshots of your flow or attached a word document with all screenshots if there are many?

    Thanks and Regards
    Prasad Pokala


    #webMethods-io-Integration
    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: REST API POST Response is coming null for Java Service in Postman

    Posted 09/30/20 02:55 AM

    Creating a Java Service.docx (93.1 KB)

    @Prasad_Pokala Attached document with all the details.

    Let me know if anything else required.

    Thanx!


    #webMethods-io-Integration
    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: REST API POST Response is coming null for Java Service in Postman

    Posted 09/30/20 03:10 AM

    Hey, @harleen.kaur

    Just seems like small issue. I guess the control is not going inside the for loop where OrderId and UnitPrice are being assigned.
    Can you put println steps before and after it as below?

                           if ( Orders != null)
    {
    System.out.println("***** Inside IF, Before Loop *****");
    for ( int i = 0; i < Orders.length; i++ )
    {
    System.out.println("***** Inside Loop *****");
    IDataCursor OrdersCursor = Orders[i].getCursor();
    
    

    Monitor if you are seeing any of these logs being printed in the “wrapper.log” file of your IS.
    If they are not, then it means control is not even going till there… some control is not even going there… so keep debugging until you find which if statement is culprit…


    #webMethods-io-Integration
    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: REST API POST Response is coming null for Java Service in Postman

    Posted 09/30/20 03:28 AM

    I have checked the logs and find out its not going to print statement. I put print statement above and find out that request is giving null.

    System.out.println("***** Test *****");
    // Request
    IData	Request = IDataUtil.getIData( pipelineCursor, "Request" );
    System.out.println("***** Request *****" + Request);
    if ( Request != null)
    {
    IDataCursor RequestCursor = Request.getCursor();
    

    #Flow-and-Java-services
    #webMethods
    #webMethods-io-Integration
    #Integration-Server-and-ESB


  • 6.  RE: REST API POST Response is coming null for Java Service in Postman

    Posted 10/05/20 08:51 AM


  • 7.  RE: REST API POST Response is coming null for Java Service in Postman

    Posted 10/01/20 12:16 PM

    Harleen,

    Your issue is about sending input parameters to the service.

    You are using the /ìnvoke/ form. This method does’nt support JSONs. as input.
    Options: either

    • use the /restv2/ form - if you want to keep the JSON input data, or
    • keep the using the /invoke/form; in this case have to change the input data format to XML.

    References (straightly about the subject):

    • “Creating a Client that Submits an XML Document via HTTP”, in Service Development Help.pdf.
    • “Example of Defining a REST V2 Resource Operation”, in Service Development Help.pdf.

    For broader info, please refer to the topics:

    • “Submitting and Receiving XML Documents”, in Service Development Help.pdf
    • “Working with REST”, in Service Development Help.pdf

    #Integration-Server-and-ESB
    #webMethods-io-Integration
    #webMethods
    #Flow-and-Java-services