开发者

Importing SOAP Webservice into Android Project Causes Error

开发者 https://www.devze.com 2023-02-15 07:09 出处:网络
I have a working Android project using IntelliJ. I utilize IntelliJ\'s menu option:\'Generate Java Code from Wsdl\'

I have a working Android project using IntelliJ.

I utilize IntelliJ's menu option: 'Generate Java Code from Wsdl'

I see the class being built, and IntelliJ seems to validate everything in the IDE, but when I invoke the webservice methods that were generated I get

 java.lang.NoClassDefFoundError: com.mydomain.testapp.sms.SendSMS

What could I being doing wrong that would cause my class not to be found? I've tried this with several publicly available web services to rule out the webservice with the same error.

Here is one of the test WSD开发者_StackOverflowL: http://www.aswinanand.com/sendsms.php?wsdl

And the specific code:

SendSMS s = new SendSMS();
s.getSendSMSPort().sendSMSToMany("8135551212", "", "8135551212", "Testing SMS Send");   

EDIT

Tried another webservice

http://www.esendex.com/secure/messenger/soap/SendService.asmx?wsdl

With the same basic usage:

SendService ss = new SendService();
String s = ss.getSendServiceSoap().sendMessage("8135165861", "Testing SMS", MessageType.TEXT);

With the exact same results.


I don't have any idea about the "intellij", but i took a look at the WSDL that you have provided. The WSDL looks fine, but i see that it is a "RPC/encoded" style service. "RPC/encoded" style services are not very inter-operable, so i would suggest that you try it with a "document/literal" style service instead of a "RPC/encoded" style.

0

精彩评论

暂无评论...
验证码 换一张
取 消