This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java in General and the fly likes cannot find symbol method getResponseHeader(java.lang.String,java.lang.String) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "cannot find symbol method getResponseHeader(java.lang.String,java.lang.String)" Watch "cannot find symbol method getResponseHeader(java.lang.String,java.lang.String)" New topic

cannot find symbol method getResponseHeader(java.lang.String,java.lang.String)

Davidson Rajapal

Joined: Nov 02, 2011
Posts: 20
Hi friends,

I have the following code. When I execute it is throwing this Error "cannot find symbol method getResponseHeader".. Can you Please help me to solve this Error. I have pointed all the below jar files but still Error exists.



public class try2

private static String nameSpaceID = "cogndvldap";
private static String userName = "worknjn";
private static String password = "layuin";
public ContentManagerService_Port cmService;
private static String reportSearchPath1 = "/content/package[@name='Z_USHH ROME Inventory Reporting']/folder[@name='USHH']/folder[@name='USHH - ROME']/report[@name='ROME Literature Spreadsheet']";
private static String saveLocation1 = "C:/Report";
public ReportService_Port reportService = null;

public static void main(String args[])

try2 mainClass = new try2(); // instantiate the class

// Step 1: Connect to the Cognos services

// Step 2: Logon to Cognos
mainClass.logonToCognos(nameSpaceID, userName, password);

catch(Exception e)

public void connectToCognos(String dispatcherURL)
ContentManagerService_ServiceLocator cmServiceLocator = new ContentManagerService_ServiceLocator();


cmService = cmServiceLocator.getcontentManagerService(new""));

catch (Exception e)

// Step 2: Logon to Cognos

public void logonToCognos(String nsID, String user, String pswd)
StringBuffer credentialXML = new StringBuffer();

String encodedCredentials = credentialXML.toString();
XmlEncodedXML xmlCredentials = new XmlEncodedXML();

cmService.logon(xmlCredentials, null);
SOAPHeaderElement temp = ((Stub)cmService).getResponseHeader("", "biBusHeader");
BiBusHeader CMbibus = (BiBusHeader)temp.getValueAsType(new QName ("","biBusHeader"));
((Stub)cmService).setHeader("","biBusHeader", CMbibus);

catch (Exception ex)



C:\Program Files\Java\jdk1.6.0_27\bin>javac cannot find symbol
symbol : method getResponseHeader(java.lang.String,java.lang.String)
location: class
SOAPHeaderElement temp = ((Stub)cmService).getResponseHeader("ht
tp://", "biBusHeader");
1 error
Paul Clapham

Joined: Oct 14, 2005
Posts: 19869

But the error message says that this class: is the one which doesn't have that method. It's pretty clear that the class came from, not from Apache. You should look in one of Cognos's jars if you want to find that class. Or better still, read their documentation.
Davidson Rajapal

Joined: Nov 02, 2011
Posts: 20

I tried by changing the Header file from "" to "org.apache.axis.client.Stub"
but I am receiving this below New Error


C:\Program Files\Java\jdk1.6.0_27\bin>java try2
java.lang.ClassCastException: com.cognos.developer.schemas.bibus._3.ContentManag
erServiceStub cannot be cast to org.apache.axis.client.Stub
at try2.logonToCognos(
at try2.main(

Can you please help me to solve this Error.
Michael Mann

Joined: Nov 10, 2011
Posts: 3
Imho is this still the same "core" problem you already had in that track:

By the way, because of that this is not a java in general problem, it's still a cognos
problem and you should have posted it in the forum you posted your first problem.
Ask an admin to move it to that forum.

For me the problem is still the same, that you're using a code sample designed for cognos 10
with your cognos 8 api and jars. The only possibilty to guess which methods
in cognos 10 correspond to api methods in cognos 8 is using a javadoc of both versions.
Do you have that? And even with that it's not a trivial task.
So my suggestion is also still the same: Send a mail to the author of your code sample (the ibm guy) and ask him
if he can help you.
He should have the api documentation and the skill to help you.
subject: cannot find symbol method getResponseHeader(java.lang.String,java.lang.String)
jQuery in Action, 3rd edition