Can't consume webservice from Java

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\net\mycompany\www\services>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?
In which folder (from root folder of project) is SessionIntegrationStub and if SessionIntegrationStub is compiled, where (folder) is the .class file situated?

以上就是Can't consume webservice from Java的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏