问题
I am using webMethods from the SAG and it seems if the service
pub.client.http
throws an exception on status code 401 "Unauthorized".
This leads me to the problem that I cannot handle the status code because nothing is written to the pipeline.
getLastError
does contain the string "Unauthorized" but not the status code. Except that I do not want to start parsing exception messages...
Any ideas?
回答1:
The output parameter header
from the pub.client.http
call should contain the information you’re after:
header Document Conditional. HTTP response headers.
Key Description
lines Document Fields in the response header, where key names represent
field names and values represent field values.
status String HTTP status code of the response.
statusMessage String HTTP status message of the response.
See the webMethods Integration Server Built-In Services Reference page 122 for more details.
回答2:
Asked a SAG senior consultant. This is the normal behavior. There is no flag which you can set to enforce suppression of this exception...
回答3:
According the comment from @Hugo Ferreira probably there are ACL restriction whether inside your webMethods environment, or your client URLs.
Things you should consider:
Do your webMethods server located inside closed environment wherein need to get connected to proxy to get to the outgoing request. Which is likely you can investigate by run web-browser program directly from your wM server towards the URL address (i.e using SSH to run firefox in my case and popup appeared)
The client that your request will go to, have HTTP for authentication requests
Solution
To pass this all you need to do is input the auth
user/password
or any other auth mechanism i.e kerberos, token, etc. inside the pub.client:http
来源:https://stackoverflow.com/questions/30838842/webmethods-pub-client-http-throws-error-on-401