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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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 java.net.URL("http://cog8dv01.merck.com:26423/p2pd/servlet/dispatch/"));

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("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader");
BiBusHeader CMbibus = (BiBusHeader)temp.getValueAsType(new QName ("http://developer.cognos.com/schemas/bibus/3/","biBusHeader"));
((Stub)cmService).setHeader("http://developer.cognos.com/schemas/bibus/3/","biBusHeader", CMbibus);

catch (Exception ex)



C:\Program Files\Java\jdk1.6.0_27\bin>javac try2.java
try2.java:240: cannot find symbol
symbol : method getResponseHeader(java.lang.String,java.lang.String)
location: class com.cognos.org.apache.axis.client.Stub
SOAPHeaderElement temp = ((Stub)cmService).getResponseHeader("ht
tp://developer.cognos.com/schemas/bibus/3/", "biBusHeader");
1 error
Paul Clapham

Joined: Oct 14, 2005
Posts: 18712

But the error message says that this class: com.cognos.org.apache.axis.client.Stub is the one which doesn't have that method. It's pretty clear that the class came from cognos.com, 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 "com.cognos.org.apache.axis.client.Stub" 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(try2.java:242)
at try2.main(try2.java:189)

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)