0

I'm trying to invoke a REST API defined by importing existing swagger (with no host property in it). I want to set it or override via compute node using the code snippets below but I got an error.

Compute node (in place before rest request node) snippets:
    --Call CopyMessageHeaders();
    --Call    CopyEntireMessage();
    SET OutputLocalEnvironment.Destination.REST.Request.BaseURL = 'http://172.x.x.x:12110/cb/common-api'; 
John Conde
  • 217,595
  • 99
  • 455
  • 496
rpj123
  • 7
  • 4
  • Error is : BIP3152S: Socket error detected whilst invoking Web service located at host 'localhost', port 80, path '/cb/common-api/InsertInput BIP3150S - No connection could be made because the target machine actively refused it. – rpj123 Mar 05 '21 at 09:53
  • **Trace log after invoking the rest request:** In below trace, I can see that the it used the base url I've set in compute node. (0x01000000:Name):WrittenDestination = ( (0x01000000:Name):REST = ( (0x03000000:NameValue):Method = 'POST' (CHARACTER) (0x03000000:NameValue):URL = 'http://172.x.x.x:12110/cb/common-api/InsertInput' (CHARACTER) – rpj123 Mar 05 '21 at 09:55
  • Are you able to call the end service using POSTMAN or any other client successfully. Would you be able to edit your original post and update the exact complete error details. In you comment, I see "Web service located at host 'localhost', port 80"....is the webservice you are trying to call present locally ? Also, ensure that you have update Compute Node's Property called Compute mode to the value "LocalEnvironment and Message" – Rohan Mar 05 '21 at 14:13
  • Thanks! I made it work by changing compute node mode from message to 'LocalEnvironment and message'. Then, uncomment the function calling the copymessageheaders. Observed in the trace that the destination changes from http to the base url ive set. – rpj123 Mar 08 '21 at 00:50

1 Answers1

0

Update the Compute Node's Property called Compute mode to the value "LocalEnvironment and Message" so that the value set in LocalEnvironment tree in Compute node propagates forward to the next node in the message flow.

Rohan
  • 607
  • 5
  • 5