Tuesday, January 28, 2014

Android calls ASMX issues, life and death unsuccessful.


            
I saw them in the online code is very simple, but I'm not here to live or die, why ah?
I just follow this tutorial to get, http://hi.baidu.com/java6666/blog/item/9fa635176b517f06962b4332.html

I downloaded and imported the jar package, add the then write a few lines of code
private static String SOAP_ACTION = "http://tempuri.org/HelloWorld";

private static String NAMESPACE = "http://tempuri.org/";
private static String METHOD_NAME = "HelloWorld";

private static String URL = "http://192.168.1.100:92/MyWebService.asmx?WSDL";



@ Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);

/ / Initialize soap request + add parameters
try
{
SoapObject request = new SoapObject (NAMESPACE, METHOD_NAME);
}
catch (Exception e)
{
String a = e.getMessage ();
}


}

It's that simple lines of code, an execution to SoapObject request = new SoapObject (NAMESPACE, METHOD_NAME); mistake, say what Source Not Found error:
/ / Compiled from InvocationTargetException.java (version 1.5: 49.0, super bit)
public class java.lang.reflect.InvocationTargetException extends java.lang.Exception {

/ / Method descriptor # 8 () V
/ / Stack: 3, Locals: 1
protected InvocationTargetException ();
0 aload_0 [this]
1 invokespecial java.lang.Exception () [1]
4 new java.lang.RuntimeException [2]
7 dup
8 ldc [3]
10 invokespecial java.lang.RuntimeException (java.lang.String) [4]
13 athrow
Line numbers:
[Pc: 0, line: 5]
Local variable table:
.......

Baffled, please help us to see how the matter?
Reply:
Android development environment ADT17 later, to refer to a jar, add a reference to the object in addition to before, you need to select the package in the Order and Export.

Specifically, is this: Select the Project -> Java Build Path-> Select Label Order and Export-> select the class did not find the jar package or project contains -> click OK.

See if it is the cause of this?
Reply:
Android development environment ADT17 later, to refer to a jar, add a reference to the object in addition to before, you need to select the package in the Order and Export.

Specifically, is this: Select the Project -> Java Build Path-> Select Label Order and Export-> select the class did not find the jar package or project contains -> click OK.

See if it is the cause of this?
Reply:
Sure enough, this is the problem, like all elected
Reply:
2nd floor badly ah, really suddenly resolved
Reply:

Reply:
GOOD V F
Reply:

Reply:
Powerful, really master ah

No comments:

Post a Comment