本文整理汇总了Java中org.ksoap2.serialization.SoapPrimitive类的典型用法代码示例。如果您正苦于以下问题:Java SoapPrimitive类的具体用法?Java SoapPrimitive怎么用?Java SoapPrimitive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SoapPrimitive类属于org.ksoap2.serialization包,在下文中一共展示了SoapPrimitive类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Banner
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
public static String Banner(String webMethName) {
String resTxt = null;
// Create request
SoapObject request = new SoapObject(NAMESPACE, webMethName);
// Create envelope
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
// Set output SOAP object
envelope.setOutputSoapObject(request);
// Create HTTP call object
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
// Invole web service
androidHttpTransport.call(SOAP_ACTION + webMethName, envelope);
// Get the response
SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
// Assign it to fahren static variable
resTxt = response.toString();
} catch (Exception e) {
e.printStackTrace();
resTxt = "Error occured";
}
return resTxt;
}
示例2: setStringValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setStringValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
String res = trObj.toString();
f.set(originalObjec, res);
}
} catch (Exception e) {
if (!(e instanceof ClassCastException))
e.printStackTrace();
try {
f.set(originalObjec, null);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例3: setBooleanValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setBooleanValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
boolean b = Boolean.valueOf(trObj.toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, false);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例4: setDoubleValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setDoubleValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
double b = Double.valueOf(trObj.toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例5: setFloatValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setFloatValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
float b = Float.valueOf(trObj.toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例6: setIntValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setIntValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
int b = Integer.valueOf(trObj.toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例7: setStringValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setStringValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
String res = trObj.getValue().toString();
f.set(originalObjec, res);
}
} catch (Exception e) {
if (!(e instanceof ClassCastException))
e.printStackTrace();
try {
f.set(originalObjec, null);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例8: setBooleanValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setBooleanValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
boolean b = Boolean.valueOf(trObj.getValue().toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, false);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例9: setDoubleValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setDoubleValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
double b = Double.valueOf(trObj.getValue().toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例10: setFloatValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setFloatValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
float b = Float.valueOf(trObj.getValue().toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例11: setIntValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private static void setIntValue(Object originalObjec, SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
int b = Integer.valueOf(trObj.getValue().toString());
f.set(originalObjec, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(originalObjec, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例12: setStringValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private void setStringValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
String res = trObj.getValue().toString();
f.set(this, res);
}
} catch (Exception e) {
if (!(e instanceof ClassCastException))
e.printStackTrace();
try {
f.set(this, null);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例13: setBooleanValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private void setBooleanValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
boolean b = Boolean.valueOf(trObj.getValue().toString());
f.set(this, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(this, false);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例14: setDoubleValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private void setDoubleValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
double b = Double.valueOf(trObj.getValue().toString());
f.set(this, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(this, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}
示例15: setFloatValue
import org.ksoap2.serialization.SoapPrimitive; //导入依赖的package包/类
private void setFloatValue(SoapObject object, String name, Field f, boolean isAttribute) {
try {
SoapPrimitive trObj = isAttribute ? (SoapPrimitive) object.getAttribute(name) : (SoapPrimitive) object.getProperty(name);
if (trObj!=null) {
float b = Float.valueOf(trObj.getValue().toString());
f.set(this, b);
}
} catch (Exception e) {
e.printStackTrace();
try {
f.set(this, 0);
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
}
}