NullPointerException using webservice translator against a webservice
that's missing 'Content-Type' in the response header
--------------------------------------------------------------------------------------------------------------------------
Key: TEIID-2956
URL:
https://issues.jboss.org/browse/TEIID-2956
Project: Teiid
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Misc. Connectors
Affects Versions: 8.7
Environment: windows 7, teiid 8.7
Reporter: gaurav singhal
Assignee: Steven Hawkins
Fix For: 8.8, 8.7.1
If you deploy a vdb that uses the webservices translator in teiid 8.7, and that
webservice doesn't have 'Content-Type' set in the response headers then the
web service connector code throws a NullPointerException as it tries to retrieve the
Content-Type and use it. This happens in the WSConnectionImpl.java class on these 2 lines
specifically:
ArrayList contentTypes = (ArrayList)this.responseContext.get("content-type");
//$NON-NLS-1$
return new HttpDataSource(url, (InputStream)response.getEntity(),
(String)contentTypes.get(0));
so basically the contentTypes array is null if the response header doesn't containt
any 'Content-Type' specified and then 2nd line gets the NullPointerException.