API Enablement

  • 1.  MQ service says call IBM

    IBM Champion
    Posted Sun September 20, 2020 01:14 PM
    I am using he stock query service. I have a curl request


    + curl --insecure -X post -H Content-Type: application/json -i --cacert cacert.pem --cert adcdd.pem:password --key adcdd.key.pem https://10.1.3.10:9443/zosConnect/services/stockQuery?action=invoke
    HTTP/1.1 500 Internal Server Error
    X-Powered-By: Servlet/3.1
    Content-Type: application/json; charset=UTF-8
    Content-Language: en-US
    Content-Length: 270
    Set-Cookie: LtpaToken2=YksaIToWHb7t3IomXP45cBRT5AVwVpYSarJ3PrZUEKKH6Op71Z0Ra8niv2r5HLXZGz/iz9VPAnkVx4m+mB9TeAQ50OVSubN1Ufsfa2k8EMYHEaFfQ4yJfTUbm+aPo/eh3iDkDv8AKwdbv0zolOL8Socoh810iWI9OPL4I9Qjus+d56NMUCRtzeJxugCoTXZF3G5FSD7W1dxfqWk7VKBTR/pLSg200bUS3g4v7lCKEJHm70XmaP/zHYCo99Hx8+LDNqIyFPOxITq7PTlYRXuHMK/zU1NbOb6OHk7QrqgO5NjSV+Vtu5QQxImWdKnPMTo7; Path=/; HttpOnly
    Connection: Close
    Date: Sun, 20 Sep 2020 17:11:24 GMT
    Expires: Thu, 01 Dec 1994 16:00:00 GMT
    Cache-Control: no-cache="set-cookie, set-cookie2"

    {"action":"Contact the IBM service organization and provide this error message along with any associated information.","message":"BAQM0004E: The request to service 'stockQuery' caused an unexpected internal error.","explanation":"An unexpected internal error occurred."}colin@colin-ThinkCentre-M920s:~$

    The ffdc has

    ------Start of DE processing------ = ∇9/20/20 18:09:24:064 BST∆
    Exception = java.lang.NullPointerException
    Source = com.ibm.zosconnect.service.mq.MQServiceProvider
    probeid = 0005
    Stack Dump = java.lang.NullPointerException
     at com.ibm.zosconnect.service.mq.MQServiceInvocationData.getRequestBytes(Unknown Source)
     at com.ibm.zosconnect.service.mq.MQServiceInvocation.prepareMessageForSend(Unknown Source)
     at com.ibm.zosconnect.service.mq.TwoWayMQServiceInvocation.sendMessage(Unknown Source)
     at com.ibm.zosconnect.service.mq.TwoWayMQServiceInvocation.invoke(Unknown Source)
     at com.ibm.zosconnect.service.mq.MQService.invoke(Unknown Source)
     at com.ibm.zosconnect.internal.ZosConnectServiceImpl.invoke(Unknown Source)
     at com.ibm.zosconnect.internal.ServiceManagerImpl.invoke(Unknown Source)
     at com.ibm.zosconnect.internal.web.ServiceProxyServlet$21.run(Unknown Source)
     at com.ibm.ws.webcontainer.async.ServiceWrapper.wrapAndRun(ServiceWrapper.java:236)
     at com.ibm.ws.webcontainer.async.ContextWrapper.run(ContextWrapper.java:28)
     at com.ibm.ws.webcontainer.async.WrapperRunnableImpl.run(WrapperRunnableImpl.java:89)
     at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:239)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
     at java.lang.Thread.run(Thread.java:818)
                                                                                                                        

    If this is a user error ( quite possibly) it should have better diagnostics so it does not say "PHONE IBM"

    regards

    Colin






  • 2.  RE: MQ service says call IBM

    Posted Mon September 21, 2020 11:01 AM
    i have same issue

    ------------------------------
    pitcho papito
    ------------------------------



  • 3.  RE: MQ service says call IBM

    Posted Tue September 22, 2020 03:10 AM
    Edited by Sue BAYLISS Tue September 22, 2020 05:02 AM

    Hi Colin and Pitcho, 

    We will investigate why you received that exception and improve the product behaviour.

    Please can you retry your curl POST request, but additionally including a request payload to be sent to the service:

    For example, if you are using the MQ service provider sample stockQuery.sar file shipped with the sample server template sampleMqStockManager, add command argument:

    --data "{\"SQREQ\": {\"ITEM_ID\": 2033 }}" -H "Content-Type:application/json"

    For example, a full curl command to invoke this service:

    curl -i -X POST http://host:port/zosConnect/services/stockQuery?action=invoke --data "{ \"SQREQ\": { \"ITEM_ID\": 2033 }}" -H "Content-Type:application/json"

    This should receive the response:

    {"SQRESP":{"ITEM_ID":2033,"ITEM_DESC":"A description.","ITEM_COST":4,"ITEM_COUNT":500}}

    Regards, Sue

    ------------------------------
    Sue Bayliss
    IBM z/OS Connect EE
    ------------------------------