I created the webservice stubs using axis2-1.5 s wsdl2java.bat. This created a src folder with the following structure in it:
src/net/mycompany/www/services/SessionIntegrationStub.java
The package of the SessionIntegration.java file is: package net.mycompany.www.services;
Now, I am trying to use this stub in my java code. I placed my java file in the same services folder. I set the same package. Here is my entire class:
package net.mycompany.www.services;
import net.mycompany.www.services;
public class DynamicProxy
{
public static void main(String[] args)
{
try
{
SessionIntegrationStub stub = new SessionIntegrationStub();
System.out.println(stub.getSessionIntegration("test"));
}
catch (Exception e)
{
System.out.println(e);
}
}
}
Then I tried to compile this code with the following cmd:
javac DynamicProxy.java
However I keep getting this error message:
C:data
etmycompanywwwservices>javac DynamicProxy.java
DynamicProxy.java:9: cannot find symbol
symbol : class SessionIntegrationStub
location: package net.mycompany.www.services
import net.mycompany.www.services.SessionIntegrationStub;
^
DynamicProxy.java:17: cannot find symbol
symbol : class SessionIntegrationStub
location: class net.mycompany.www.services.DynamicProxy
SessionIntegrationStub stub = new SessionIntegrationStub();
^
DynamicProxy.java:17: cannot find symbol
symbol : class SessionIntegrationStub
location: class net.mycompany.www.services.DynamicProxy
SessionIntegrationStub stub = new SessionIntegrationStub();
^
3 errors
Any idea what I am missing here?
Update 1:
I compiled the stubs (thanks to the answers below) and I got rid of the first error. I changed the import to this import net.americanapparel.www.services.*; however I still get an error for the SessionIntegrationStub: cannot find symbol. I also tried this import: net.americanapparel.www.services.SessionIntegrationStub, but that did not help either. Is there anything else I am missing?