It's all about the answers!

Ask a question

RTC - why can't I access an external web service in attribute customization javascrip?


Renato Gosdal (61) | asked Dec 01 '16, 12:40 p.m.
 We have an attribute customization javascript in RTC, which get values returned from an external web service as represented the snippet below, but we are getting  connection refused, registered by ccm.log. Trying to access the web service directly through the browser is ok. 

Is the the external webservice consumed directly by the javascript in browser, or it is somehow tunneled through the rtc server? Which ip get the connection refused, the browser or rtc server?

Attribute customization javascript:

var HttpConnectorParameters= com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters;

dojo.declare("br.gov.acme.alm.ValueSetProviderUg", null, {

    getFilteredValueSet: function(attributeId, workItem, context, filter) {
        var params= new HttpConnectorParameters();
params.url= "https://alm.acme/wsbialm/bialm/toALM/ugsAtivas";
        params.xpath= "//xml/ug";
        params.columnXpaths= ["./id","./sigla"];
        params.columnIds= ["id","sigla"];
        params.ignoreInvalidCertificates = true;
        var connector= context.getDataConnector("HttpConnector");
        var values= connector.get(params);
        ...
 
2016-12-01 09:30:50,701 [WebContainer : 21 @@ 11:40 <unauthenticated> <Initial Page Load@b294e4f9-d1ab-4ffa-8a39-1bc598133770> /jts/auth/authrequired] ERROR com.ibm.team.workitem.common                        - Error invoking value set provider 'com.ibm.team.workitem.valueproviders.VALUE_SET_PROVIDER._YeIPUA1hEeK-uduOWhvCZw'
com.ibm.team.repository.common.TeamRepositoryException: Problems accessing 'https://alm.acme/wsbialm/bialm/toALM/ugsAtivas': Connection to https://alm.acme refused
at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider.handleException(ScriptAttributeValueProvider.java:267)
at com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider.getFilteredValueSet(ScriptAttributeValueProvider.java:133)

        ... (some stack omitted)

at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to https://alm.acme refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
at com.ibm.team.workitem.service.internal.connector.HttpConnector.get(HttpConnector.java:255)
at sun.reflect.GeneratedMethodAccessor3731.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invok

One answer



permanent link
Ralph Schoon (55.5k23642) | answered Dec 02 '16, 1:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 You are not authenticated. Maybe check https://jorgediazblog.wordpress.com/2012/06/27/work-item-customization-httpconector-and-oauth-in-rtc-4-0-for-oslc/ for how to authenticate?

Your answer


Register or to post your answer.