IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
Topic
  • 3 replies
  • Latest Post - ‏2019-01-14T03:28:54Z by ZhouXin
Edwardohometown
Edwardohometown
4 Posts

Pinned topic BAQR1133E: Method POST is not allowed

‏2019-01-10T19:51:15Z | zosconnect

So I am trying to call an apirequestor with a POST method from my batch cobol program.  The actual api has a POST and a GET method.  The GET call works but when I try to do the post I get the following :

"errorMessage":"BAQR1133E: Method POST is not allowed.

 

The API has a POST and I see it defined in the generated copybooks from the buildkit but it keeps failing.

 I do see in Server.xlm that the POST method is allowed for the cors calls.

Anyone have any ideas?

Updated on 2019-01-10T20:24:11Z at 2019-01-10T20:24:11Z by Edwardohometown
  • ZhouXin
    ZhouXin
    3 Posts

    Re: BAQR1133E: Method POST is not allowed

    ‏2019-01-11T02:46:08Z  

    Hi Edward,

     

    You may notice there is input parameter length field in z/OS Connect generated copybook. If you don't provide length data to this length field, z/OS Connect api requester function will ignore the input parameter, it think this is POST call. Hence, you got error "method is not allowed".

     

    Please move length data to this input parameter length field, then move data to the input parameter, the "method is not allowed" should be solved.

    For example, appid is the required input parameter

    MOVE API-KEY             TO appid.         
    MOVE APPID-LENGTH TO appid-length. 

     

          - Xin

    Updated on 2019-01-11T02:47:54Z at 2019-01-11T02:47:54Z by ZhouXin
  • Edwardohometown
    Edwardohometown
    4 Posts

    Re: BAQR1133E: Method POST is not allowed

    ‏2019-01-11T13:35:48Z  
    • ZhouXin
    • ‏2019-01-11T02:46:08Z

    Hi Edward,

     

    You may notice there is input parameter length field in z/OS Connect generated copybook. If you don't provide length data to this length field, z/OS Connect api requester function will ignore the input parameter, it think this is POST call. Hence, you got error "method is not allowed".

     

    Please move length data to this input parameter length field, then move data to the input parameter, the "method is not allowed" should be solved.

    For example, appid is the required input parameter

    MOVE API-KEY             TO appid.         
    MOVE APPID-LENGTH TO appid-length. 

     

          - Xin

    Thanks for the quick reply, but I actually do move the length.

     

    Here is my copy book:

       06 ReqBody.                                                                                                       
         09 doc-num                       PIC S9(9) COMP-5 SYNC.                                             
         09 doc.                                               
           12 doc2-length                   PIC S9999 COMP-5 SYNC.                                                    
           12 doc2                          PIC X(255).  

    And here is the code:

     MOVE +1                                   TO DOC-NUM.       
     MOVE WS-CART-PERSON-ID TO DOC2.          
     MOVE LENGTH OF DOC2       TO DOC2-LENGTH.

     

     

     

     

     

  • ZhouXin
    ZhouXin
    3 Posts

    Re: BAQR1133E: Method POST is not allowed

    ‏2019-01-14T03:28:54Z  

    Thanks for the quick reply, but I actually do move the length.

     

    Here is my copy book:

       06 ReqBody.                                                                                                       
         09 doc-num                       PIC S9(9) COMP-5 SYNC.                                             
         09 doc.                                               
           12 doc2-length                   PIC S9999 COMP-5 SYNC.                                                    
           12 doc2                          PIC X(255).  

    And here is the code:

     MOVE +1                                   TO DOC-NUM.       
     MOVE WS-CART-PERSON-ID TO DOC2.          
     MOVE LENGTH OF DOC2       TO DOC2-LENGTH.

     

     

     

     

     

    Edward, suggest to make some change to your COBOL application, see sample in IBM Knowledge Center.

     MOVE +1                                   TO DOC-NUM.       
     MOVE WS-CART-PERSON-ID TO DOC2 in doc(1).          
     MOVE LENGTH OF DOC2       TO DOC2-LENGTH in doc(1).

    https://www.ibm.com/support/knowledgecenter/en/SS4SVW_3.0.0/facilitating/sample_array_string.html#develop_app_apirequester