package com.sabirjan.wangluo;

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



public class fangwenService {

	

	private static final String NAMESPACE = "http://tempuri.org/";
	private static final String URL = "http://218.195.228.51/Service.asmx";
	public String callChaXunWeiHan(String word)
    {
		String s=null;
        try {
            SoapObject request = new SoapObject(NAMESPACE, "ChaXunWeiHan");
            request.addProperty("weiwenzi", word);
            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.bodyOut = request;
            envelope.dotNet=true;
            envelope.setOutputSoapObject(request);
            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
         //   androidHttpTransport.debug=true;
            androidHttpTransport.call("http://tempuri.org/ChaXunWeiHan", envelope);
            Object result = (Object)envelope.getResponse().toString();
            String str=result.toString();
            s=str;
          
        } catch (Exception e) {
           s=e.getMessage();
            }
        return s;
        
    }
	public String callChaXunHanWei(String word)
    {
		String s=null;
        try {
            SoapObject request = new SoapObject(NAMESPACE, "ChaXunHanWei");
            request.addProperty("hanzi", word);
            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.bodyOut = request;
            envelope.dotNet=true;
            envelope.setOutputSoapObject(request);
            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
         //   androidHttpTransport.debug=true;
            
            androidHttpTransport.call("http://tempuri.org/ChaXunHanWei", envelope);
            Object result = (Object)envelope.getResponse().toString();
            String str=result.toString();
            s=str;
          
        } catch (Exception e) {
           s=e.getMessage();
            }
        return s;
        
    }
}
