Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ERROR: 02-16 15:07:58.596: I/JSONObject(2856): rslt string::java.net.ConnectException: failed to connect to /192.168.137.161 (port 8080): connect failed: ENETUNREACH (Network is unreachable)


WEB SERVICE IS DEPLOYED ON IIS.




Java
public final String WSDL_TARGET_NAMESPACE = "http://www.dhyey.com/";

	
	public final String SOAP_ADDRESS = "http://192.168.137.161/StellarWebService/StellarService.asmx";

	

	public WebServices() {
		// TODO Auto-generated constructor stub
	}
	
	public String logincall(String username, String userpassword, String isAdmin) {

		final String SOAP_ACTION = "http://www.dhyey.com/Login_android";

		final String OPERATION_NAME = "Login_android";

		SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,
				OPERATION_NAME);

		PropertyInfo pi = new PropertyInfo();

		pi.setName("UserName");
		pi.setValue(username);

		pi.setType(String.class);
		request.addProperty(pi);

		pi = new PropertyInfo();

		pi.setName("Password");
		pi.setValue(userpassword);
		pi.setType(String.class);
		request.addProperty(pi);
		
		pi = new PropertyInfo();

		pi.setName("isAdmin");
		pi.setValue(isAdmin);
		pi.setType(String.class);
		request.addProperty(pi);


		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		envelope.dotNet = true;

		envelope.setOutputSoapObject(request);

		HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);
		Object response = null;

		try {
			httpTransport.call(SOAP_ACTION, envelope);
			response = envelope.getResponse();

		} catch (Exception exception) {
			response = exception.toString();
		}

		return response.toString();

	}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900