本文整理汇总了Java中org.ksoap2.serialization.SoapObject.addProperty方法的典型用法代码示例。如果您正苦于以下问题:Java SoapObject.addProperty方法的具体用法?Java SoapObject.addProperty怎么用?Java SoapObject.addProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ksoap2.serialization.SoapObject
的用法示例。
在下文中一共展示了SoapObject.addProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildCustomFieldData
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private SoapObject buildCustomFieldData(Map<CustomField, String> customFieldResult, SoapObject parent) {
if(customFieldResult!=null) {
SoapObject object = new SoapObject(NAMESPACE, "CustomFieldValueForIssueDataArray");
for(Map.Entry<CustomField, String> entry : customFieldResult.entrySet()) {
SoapObject customFieldData = new SoapObject(NAMESPACE, "CustomFieldValueForIssueData");
SoapObject customField = new SoapObject(NAMESPACE, "ObjectRef");
customField.addProperty("id", entry.getKey().getId());
customField.addProperty("name", entry.getKey().getName());
customFieldData.addProperty("field", customField);
customFieldData.addProperty("value", entry.getValue());
object.addProperty("custom_fields", customFieldData);
}
parent.addProperty("custom_fields", object);
}
return parent;
}
示例2: TotalsForUser
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public Totals[] TotalsForUser(String szAuthToken, FlightQuery fq, Context c) {
SoapObject Request = setMethod("TotalsForUserWithQuery");
Request.addProperty("szAuthToken", szAuthToken);
Request.addProperty("fq", fq == null ? new FlightQuery() : fq);
Totals[] rgt = new Totals[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error retrieving totals - " + getLastError());
else {
try {
rgt = new Totals[result.getPropertyCount()];
for (int i = 0; i < rgt.length; i++) {
rgt[i] = new Totals((SoapObject) result.getProperty(i));
}
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgt;
}
示例3: AircraftForUser
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public Aircraft[] AircraftForUser(String szAuthToken, Context c) {
DBCache dbc = new DBCache();
Aircraft[] rgAc;
DBCache.DBCacheStatus dbcs = dbc.Status(TABLENAME);
if (dbcs == DBCache.DBCacheStatus.VALID) // return cached aircraft
{
rgAc = getCachedAircraft();
} else // refresh the cache
{
SoapObject Request = setMethod("AircraftForUser");
Request.addProperty("szAuthUserToken", szAuthToken);
SoapObject result = (SoapObject) Invoke(c);
if (result == null) {
setLastError(getLastError());
// just return the potentially invalid cached aircraft; it's better than nothing.
rgAc = getCachedAircraft();
} else {
rgAc = ReadResults(result, (dbcs == DBCache.DBCacheStatus.VALID_BUT_RETRY));
}
}
return rgAc;
}
示例4: FlightPathForFlight
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public LatLong[] FlightPathForFlight(String szAuthToken, int idFlight, Context c) {
LatLong[] rgll = new LatLong[0];
SoapObject Request = setMethod("FlightPathForFlight");
Request.addProperty("szAuthUserToken", szAuthToken);
Request.addProperty("idFlight", idFlight);
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Failed to get path for flight - " + getLastError());
else {
try {
rgll = new LatLong[result.getPropertyCount()];
for (int i = 0; i < rgll.length; i++)
rgll[i] = new LatLong((SoapObject) result.getProperty(i));
} catch (Exception e) {
rgll = new LatLong[0];
setLastError(getLastError() + e.getMessage());
}
}
return rgll;
}
示例5: buildNoteRequest
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private SoapObject buildNoteRequest(IssueNote note) {
SoapObject issueNoteData = new SoapObject(NAMESPACE, "IssueNoteData");
issueNoteData.addProperty("id", 0);
if(note.getReporter()!=null)
issueNoteData = this.buildAccountData(note.getReporter(), issueNoteData, "reporter");
issueNoteData.addProperty("text", note.getText());
if(!note.getView_state().equals("")) {
SoapObject objectRef = new SoapObject(NAMESPACE, "ObjectRef");
List<ObjectRef> objectRefs = getEnum("view_states");
ObjectRef ref = null;
for(ObjectRef objRef : objectRefs) {
if(objRef.getName().equals(note.getView_state())) {
ref = objRef;
break;
}
}
if(ref!=null) {
objectRef.addProperty("id", ref.getId());
objectRef.addProperty("name", ref.getName());
issueNoteData.addProperty("view_state", objectRef);
}
}
return issueNoteData;
}
示例6: buildObjectRef
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private SoapObject buildObjectRef(String strEnum, String value) {
SoapObject objectRef = new SoapObject(NAMESPACE, "ObjectRef");
List<ObjectRef> objectRefs = getEnum(strEnum);
ObjectRef ref = null;
for(ObjectRef objRef : objectRefs) {
if(objRef.getName().equals(value)) {
ref = objRef;
break;
}
}
if(ref!=null) {
objectRef.addProperty("id", ref.getId());
objectRef.addProperty("name", ref.getName());
}
return objectRef;
}
示例7: addAttachment
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public boolean addAttachment(int sid, IssueAttachment attachment) {
if(attachment.getId()!=0) {
if(!removeAttachment(attachment.getId())) {
return false;
}
}
SoapObject structRequest = new SoapObject(this.returnURL(), "mc_issue_attachment_add");
try {
structRequest.addProperty("username", this.settings.getUserName());
structRequest.addProperty("password", this.settings.getPassword());
structRequest.addProperty("issue_id", sid);
structRequest.addProperty("name", new File(attachment.getFilename()).getName());
structRequest.addProperty("file_type", new File(attachment.getFilename()).getName());
structRequest.addProperty("content", Files.readAllBytes(Paths.get(new File(attachment.getFilename()).toURI())));
structEnvelope.setOutputSoapObject(structRequest);
structTransport.call("SOAPAction", structEnvelope);
SoapObject obj = (SoapObject) structEnvelope.bodyIn;
return checkProperty(obj);
} catch (Exception ex) {
return false;
}
}
示例8: executeQueryAndGetSoapObject
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private SoapObject executeQueryAndGetSoapObject(String action, Object[][] furtherParams) throws Exception {
SoapObject structRequest = new SoapObject(this.returnURL(), action);
structRequest.addProperty("username", this.settings.getUserName());
structRequest.addProperty("password", this.settings.getPassword());
if(furtherParams!=null) {
for(Object[] param : furtherParams) {
structRequest.addProperty(param[0].toString(), param[1]);
}
}
structEnvelope.setOutputSoapObject(structRequest);
try {
structTransport.call("SOAPAction", structEnvelope);
return (SoapObject) structEnvelope.bodyIn;
} catch (Exception ex) {
return null;
}
}
示例9: send
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
/**
* 执行请求
*
* @param context
* @param url
* @param namespace
* @param action
* @param params
* @param responseHandler
*/
public void send(Context context, String url, String namespace, String action, HashMap<String, String> params, SoapResponseHandler responseHandler) {
if (params != null) {
StringBuilder paramsStr = new StringBuilder(url);
paramsStr.append('/')
.append(action);
if (params.size() > 0) {
paramsStr.append('?');
}
SoapObject rpc = new SoapObject(namespace, action);
for (Map.Entry<String, String> entry : params.entrySet()) {
rpc.addProperty(entry.getKey(), entry.getValue());
paramsStr.append(entry.getKey())
.append('=')
.append(entry.getValue())
.append('&');
}
Log.d(TAG, "sendRequest " + paramsStr.toString());
envelope.bodyOut = rpc;
}
ht = new HttpTransportSE(url, TIMEOUT);
sendRequest(ht, envelope, namespace, responseHandler, context);
}
示例10: doRequestInternal
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private <TYPE> TYPE doRequestInternal(String namespace, String action, String url, HashMap<String, Object> parameters, Class<TYPE> clazz, int soapEnvelopeVersion) throws TechnicalException {
SoapObject request = new SoapObject(namespace, action);
for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
request.addProperty(parameter.getKey(), parameter.getValue());
}
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(soapEnvelopeVersion);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(url);
try {
if (!namespace.endsWith("/")) {
namespace += "/";
}
httpTransport.call(namespace + action, envelope);
return (TYPE) envelope.getResponse();
} catch (Exception exception) {
throw new TechnicalException(exception);
}
}
示例11: DeleteImage
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public void DeleteImage(String szAuthToken, MFBImageInfo mfbii, Context c) {
SoapObject Request = setMethod("DeleteImage");
Request.addProperty("szAuthUserToken", szAuthToken);
Request.addProperty("mfbii", mfbii);
mContext = c;
new Thread(this).start();
}
示例12: UpdateImageAnnotation
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public void UpdateImageAnnotation(String szAuthToken, MFBImageInfo mfbii, Context c) {
SoapObject Request = setMethod("UpdateImageAnnotation");
Request.addProperty("szAuthUserToken", szAuthToken);
Request.addProperty("mfbii", mfbii);
mContext = c;
new Thread(this).start();
}
示例13: ToProperties
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
@Override
public void ToProperties(SoapObject so) {
so.addProperty("Comment", Comment);
so.addProperty("VirtualPath", VirtualPath);
so.addProperty("URLFullImage", URLFullImage);
so.addProperty("ThumbnailFile", ThumbnailFile);
so.addProperty("Width", Width);
so.addProperty("Height", Height);
so.addProperty("WidthThumbnail", WidthThumbnail);
so.addProperty("HeightThumbnail", HeightThumbnail);
so.addProperty("Location", Location);
so.addProperty("ImageType", ImageType);
}
示例14: ToProperties
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
@Override
public void ToProperties(SoapObject so) {
so.addProperty("PropID", idProp);
so.addProperty("FlightID", idFlight);
so.addProperty("PropTypeID", idPropType);
so.addProperty("IntValue", intValue);
so.addProperty("BoolValue", boolValue);
so.addProperty("DecValue", decValue);
AddNullableDate(so, "DateValue", dateValue);
so.addProperty("TextValue", stringValue);
}
示例15: VisitedAirportsForUser
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public VisitedAirport[] VisitedAirportsForUser(String szAuthToken, Context c) {
SoapObject Request = setMethod("VisitedAirports");
Request.addProperty("szAuthToken", szAuthToken);
VisitedAirport[] rgva = new VisitedAirport[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error retrieving visited airports - " + getLastError());
else {
Location l = MFBLocation.LastSeenLoc();
try {
rgva = new VisitedAirport[result.getPropertyCount()];
for (int i = 0; i < rgva.length; i++) {
rgva[i] = new VisitedAirport((SoapObject) result.getProperty(i));
if (l != null)
rgva[i].airport.Distance = l.distanceTo(rgva[i].airport.getLocation()) * MFBConstants.METERS_TO_NM;
}
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgva;
}