I have a .Net Web Service which returns a single integer value. When i
call upon it from my application, no value is returned. Nothing at all
really happens. I set up breakpoints and watched it's progress and it
seems the problem is coming from when i get to this line:
androidHttpTransport.call(SOAP_ACTION, envelope);
I have a hunch that my URL string is the problem. I've tried replacing
the "localhost" in my URL string with my local and network ip with no
luck. Whenever i replace the localhost with the ip in my browser i get
Server Cannot Access or Unable to Connect pages. Does anyone know a
solution to this problem?
Here's my class calling my web service:
public class CGCountTest extends Activity {
TextView testTV;
private static final String NAMESPACE = "http://passport-america.com/
webservices/";
private static final String URL = "http://localhost:11746/
Service1.asmx";
private static final String SOAP_ACTION = "http://www.passport-
america.com/webservices/getCGCount";
private static final String METHOD_NAME = "getCGCount";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.soap_test);
TextView testTV = (TextView)findViewById(R.id.testTV);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope =
new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new
HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION,
envelope);
SoapObject
result=(SoapObject)envelope.getResponse();
String resultData = result.toString();
testTV.setText(resultData);
}
catch(Exception e)
{
//testTV.setText(e.getMessage());
}
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en