非法属性:NewDataSet(.net) [英] illegal property: NewDataSet (.net)

查看:86
本文介绍了非法属性:NewDataSet(.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  //  错误:java.lang.RuntimeException:非法属性:NewDataSet  
// (第50行)
// .net webservice和ksoap2 used(plz help :))

package com.hoteljobs;
import java.util.ArrayList;
import java.util.HashMap;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;

import android.util.Log;
public class Businesslogic_GetEdu {
final static 字符串 JobSeekerID = JobSeekerID;
final static 字符串 UgQualificationID = UgQualificationID;
final static String UgSpecialization = UgSpecialization;
final static String UgInstituteID = UgInstituteID;
final static 字符串 PgQualificationID = PgQualificationID;
final static 字符串 PgSpecialization = PgSpecialization;
final static 字符串 PgInstituteID = PgInstituteID;
final static 字符串 DeplomaName = DeplomaName;
final static 字符串 InstitutionName = InstitutionName;
final static 字符串 InstitutionName1 = InstitutionName1;
final static 字符串 QualificationName = QualificationName;
final static 字符串 QualificationName1 = QualificationName1;
public static ArrayList< hashmap>< string,string>> XMLparser_Edu_details( String JobSeekerName){
ArrayList< hashmap>< string,>> user_list = new ArrayList< hashmap>< string,>>();
SoapObject newob = null;
final 字符串 METHOD_NAME = Educational_Details;
final String SOAP_ACTION = http://tempuri.org/Education_Details;
final 字符串 NAMESPACE = http://tempuri.org/;
final String URL = http://hoteljob.wisknowtech.com/Get_Education.asmx;
尝试
{
对象响应;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.encodingStyle = SoapEnvelope.ENC;
SoapObject Request = new SoapObject(NAMESPACE,METHOD_NAME);
Request.addProperty( JobSeekerName,JobSeekerName);
envelope.dotNet = true;
envelope.setOutputSoapObject(Request);
AndroidHttpTransport httptransport;
httptransport = new AndroidHttpTransport(URL);
httptransport.debug = true;
尝试
{
httptransport.call(SOAP_ACTION,envelope);
response = envelope.getResponse();
newob =(SoapObject)envelope.bodyIn;
SoapObject diettype_listResult =(SoapObject)newob.getProperty( Educational_DetailsResult);
SoapObject diffgram =(SoapObject)diettype_listResult.getProperty( diffgram);
SoapObject NewDataSet =(SoapObject)diffgram.getProperty( NewDataSet);
int totalrest = NewDataSet.getPropertyCount();
Log.i( Manish totalrest: + totalrest);
int i = 0;
for (i = 0; i< totalrest; i ++)>
{
Log.i( Manish inner for i = + i);
HashMap< string,> userprofilelist = new HashMap< string,>();
SoapObject Table =(SoapObject)NewDataSet.getProperty(i);
// userprofilelist.put(JobSeekerID,Table.getProperty(JobSeekerID)。toString());
userprofilelist.put(UgQualificationID,Table.getProperty( UgQualificationID)的ToString());
userprofilelist.put(UgSpecialization,Table.getProperty( UgSpecialization)。toString() );
userprofilelist.put(UgInstituteID,Table.getProperty( UgInstituteID)。toString() );
userprofilelist.put(PgQualificationID,Table.getProperty( PgQualificationID)。toString() );
userprofilelist.put(PgSpecialization,Table.getProperty( PgSpecialization)。toString() );
userprofilelist.put(PgInstituteID,Table.getProperty( PgInstituteID)。toString() );
userprofilelist.put(DeplomaName,Table.getProperty( DeplomaName)。toString() );
userprofilelist.put(QualificationName,Table.getProperty( QualificationName)。toString() );
// userprofilelist.put(QualificationName1,Table.getProperty(QualificationName1)。toString());
userprofilelist.put(InstitutionName,Table.getProperty( InstitutionName)的ToString());
// userprofilelist.put(InstitutionName1,Table.getProperty(InstitutionName1)。toString());
user_list.add(userprofilelist);
Log.i( manish 成功的教育细节);
}
}
catch (例外e){
Log.i( manish inner捉);
e.printStackTrace();
System.out.println( 错误: + e);
}
}
catch (例外e){
Log.i( manish outer捉);
}
return user_list;
}
}< / hashmap>< / hashmap>< / hashmap>

解决方案

寻找这里 http://hoteljob.wisknowtech.com/Get_Education.asmx?WSDL [ ^ ]您正在寻找的属性似乎被称为DataSet而不是NewDataSet ...

//error:java.lang.RuntimeException: illegal property: NewDataSet
//(Line no.50)
//.net webservice and ksoap2 used (plz help :))

package com.hoteljobs;
import java.util.ArrayList;
import java.util.HashMap;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;

import android.util.Log;
public class Businesslogic_GetEdu {	
	final static String JobSeekerID = "JobSeekerID";
	final static String UgQualificationID = "UgQualificationID";
	final static String UgSpecialization = "UgSpecialization";
	final static String UgInstituteID = "UgInstituteID";
	final static String PgQualificationID = "PgQualificationID";
	final static String PgSpecialization = "PgSpecialization";
	final static String PgInstituteID = "PgInstituteID"; 
	final static String DeplomaName = "DeplomaName";
	final static String InstitutionName = "InstitutionName"; 
 	final static String InstitutionName1 = "InstitutionName1";
	final static String QualificationName = "QualificationName"; 
	final static String QualificationName1 = "QualificationName1";
	public static ArrayList<hashmap><string,string>>  XMLparser_Edu_details(String JobSeekerName) {		
		ArrayList<hashmap><string,>> user_list = new ArrayList<hashmap><string,>>();
		SoapObject newob = null;
		final String METHOD_NAME = "Educational_Details";		
		final String SOAP_ACTION = "http://tempuri.org/Educational_Details";
		final String NAMESPACE = "http://tempuri.org/";
		final String URL = "http://hoteljob.wisknowtech.com/Get_Education.asmx";				
		try
		{
			Object response;
			SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
			envelope.encodingStyle = SoapEnvelope.ENC;
			SoapObject Request = new SoapObject(NAMESPACE , METHOD_NAME);			
			Request.addProperty("JobSeekerName", JobSeekerName); 			
			envelope.dotNet = true;
			envelope.setOutputSoapObject(Request);
			AndroidHttpTransport httptransport ;
			httptransport = new AndroidHttpTransport(URL);						
			httptransport.debug=true;		    
			try
			{				
				httptransport.call(SOAP_ACTION,envelope);				
				response = envelope.getResponse();				
				newob = (SoapObject)envelope.bodyIn;												
				SoapObject diettype_listResult = (SoapObject) newob.getProperty("Educational_DetailsResult") ;				
				SoapObject diffgram = (SoapObject) diettype_listResult.getProperty("diffgram") ;				
				SoapObject NewDataSet = (SoapObject) diffgram.getProperty("NewDataSet") ;				
				int totalrest=NewDataSet.getPropertyCount();				
				Log.i("Manish","totalrest:"+totalrest);
				int i=0;
				for(i=0;i<totalrest;i++)>
				{				
				Log.i("Manish","inner for i="+i);
				HashMap<string,> userprofilelist=new HashMap<string,>();
				SoapObject Table = (SoapObject) NewDataSet.getProperty(i);
				//userprofilelist.put(JobSeekerID, Table.getProperty("JobSeekerID").toString());				
				userprofilelist.put(UgQualificationID, Table.getProperty("UgQualificationID").toString());				
				userprofilelist.put(UgSpecialization, Table.getProperty("UgSpecialization").toString());				
				userprofilelist.put(UgInstituteID, Table.getProperty("UgInstituteID").toString());				
				userprofilelist.put(PgQualificationID, Table.getProperty("PgQualificationID").toString());				
				userprofilelist.put(PgSpecialization, Table.getProperty("PgSpecialization").toString());				
				userprofilelist.put(PgInstituteID, Table.getProperty("PgInstituteID").toString());				
				userprofilelist.put(DeplomaName, Table.getProperty("DeplomaName").toString());				
				userprofilelist.put(QualificationName, Table.getProperty("QualificationName").toString());				
				//userprofilelist.put(QualificationName1, Table.getProperty("QualificationName1").toString());
				userprofilelist.put(InstitutionName, Table.getProperty("InstitutionName").toString());				
				//userprofilelist.put(InstitutionName1, Table.getProperty("InstitutionName1").toString());
				user_list.add(userprofilelist);					
				Log.i("manish","Successful Education Detail");				
			    }															
			 }
			catch (Exception e) {
				Log.i("manish","inner catch");
			       e.printStackTrace();
				System.out.println("error:" + e);
			}              
		}
		catch (Exception e) {
			Log.i("manish","outer catch");		
		}
		return user_list;
	}
}</hashmap></hashmap></hashmap>

解决方案

Looking here http://hoteljob.wisknowtech.com/Get_Education.asmx?WSDL[^] It seems that the property you are looking for is called "DataSet" not "NewDataSet"...


这篇关于非法属性:NewDataSet(.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆