Author Message
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Orchestration Designer: 7.1
Tomcat: 8.0
Java: 1.8/8.0

I have a rest web service operation that I'm trying to invoke and have run into a couple of problems. The details of the rest service operation are as follows:

HTTP Method: Post
URL Format: Query or Path
Input Parameters: None
Message Body: <XML formatted string>
Output Parameters: decryptedValue
Output Format: String
Use Java Object: Checked
Customer Content Type: text/plain

For the first issue, when I attempt to execute the rest operation, the application hangs until when the request is sent to the server. I see a log entry on the server when the request is received, and when it's sent back. However, the OD application sits there even after the request has been received from the server, until the time out value has been reached.

If I add each of the variables from the XML formatted string to the Input Parameters dialog, the rest operation works without fail. The problem is this causes the variables and values to be added to the query string or the path string, which means the information is logged to standard tomcat server request logs. This exposes the information, which fails the customers security requirements.

Why is the Input Parameters a required element?

For the second issue, the rest service returns plain text. No XML, no JSON, no HTML. Although the return has no effect (I've tried every combination so far), the returned value does not get assigned to the Output Parameter assigned variable. I see the result in the web service response, but the value is not assigned to the variable. I've tried both with and without the "Use Java Object" checkbox selected. Currently, the value is selected because that's the only way to select the "String" Output Format, however no matter what is selected, the returned value does not get assigned to the variable. Unfortunately, since the value is not assigned to the variable, I can't even attempt to post-process the results in a custom servlet.

How can I obtain the rest result value?

If needed, I can provide a working sample rest service application and speech application. IDK if it matters, but the rest services are based on Jersey.

Thank you,
Michael
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
See the attached image as well, but my test with plain text worked fine.


14/06/2017 07:40:23:931 DEBUG - 5381FB3B15EBE718AE41DA87943F4B54:/TestRestPost : Web Service Request -> http://localhost:8080/TestRestPost/restposttext.jsp
header :content-type as -> application/x-www-form-urlencoded; charset=UTF-8
header :soapaction as -> ""
header :user-agent as -> Axis2
header :host as -> localhost:8080
Query String :null
14/06/2017 07:40:24:734 INFO - 5381FB3B15EBE718AE41DA87943F4B54:/TestRestPost : Response had content type: application/xml. Retrying call with new type...
header :content-type as -> application/x-www-form-urlencoded; charset=UTF-8
header :soapaction as -> ""
header :user-agent as -> Axis2
header :host as -> localhost:8080
Query String :null
14/06/2017 07:40:24:749 DEBUG - 5381FB3B15EBE718AE41DA87943F4B54:/TestRestPost : Storing [blah blah it worked
] to: returnValue
14/06/2017 07:40:24:749 DEBUG - 5381FB3B15EBE718AE41DA87943F4B54:/TestRestPost : Web Service Reply <- blah blah it worked

14/06/2017 07:40:24:753 INFO - In Progress | session id:sess4588147 | TestRestPost:plaintext | ***** | ***** | returnValue | blah blah it worked
| undefined

  • [Thumb - Capture.PNG]
[Disk] Download
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
What is the content-type the rest service use using? WHen I set the return type to text/plain, I noticed that the code did a retry on the request. It seems the connector is written to expect xml or json. In the previous example I set the content-type to application/xml even though I was just returning plain text.


14/06/2017 07:49:24:897 INFO - 699B5D887BDF0E5A44AD1DAC16A933FE:/TestRestPost : Starting REST web service operation [textplain]
14/06/2017 07:49:25:329 DEBUG - 699B5D887BDF0E5A44AD1DAC16A933FE:/TestRestPost : Web Service Request -> http://localhost:8080/TestRestPost/restposttext.jsp
header :content-type as -> application/x-www-form-urlencoded; charset=UTF-8
header :soapaction as -> ""
header :user-agent as -> Axis2
header :host as -> localhost:8080
Query String :null
14/06/2017 07:49:26:048 INFO - 699B5D887BDF0E5A44AD1DAC16A933FE:/TestRestPost : Response had content type: text/plain. Retrying call with new type...
header :content-type as -> application/x-www-form-urlencoded; charset=UTF-8
header :soapaction as -> ""
header :user-agent as -> Axis2
header :host as -> localhost:8080
Query String :null
14/06/2017 07:49:26:062 DEBUG - 699B5D887BDF0E5A44AD1DAC16A933FE:/TestRestPost : Storing [blah blah it worked
] to: returnValue
14/06/2017 07:49:26:062 DEBUG - 699B5D887BDF0E5A44AD1DAC16A933FE:/TestRestPost : Web Service Reply <- blah blah it worked

14/06/2017 07:49:26:066 INFO - In Progress | session id:sess1535032 | TestRestPost:plaintext | ***** | ***** | returnValue | blah blah it worked
| undefined

MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Thanks Ross,

How do I enable that level of logging for Rest requests? That might help me debug. I definitely don't get the same results as you're getting.

Thanks again.
Michael
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline

This logging is from a simple jsp page I use as the "web service". The jsp just prints out data and returns a result.

header :content-type as -> application/xml; charset=UTF-8
header :soapaction as -> ""
header :user-agent as -> Axis2
header :host as -> localhost:8080
header :content-length as -> 16
Query String :null
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Here is the app I used to test.
Filename TestRestPostMD.zip [Disk] Download
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Thanks again. The content type on the return is set to "Custom Content Type" and the value is "text/plain". When it's set to this value, the rest operation only performs a single request.

I should be able to log the same information then from my rest service, just not to the OD logs. Currently, I'm only logging that the request was processed, since right now there is no logic to handle the input values, and the return is hard-coded as a string value. Again, this is just to get the interface working.

I'll update after I've had time to get into this project (later today).

Thanks again,
Michael
Go to:   
Mobile view