java - Android Application consuming a WebService on a GlassFish server using ksoap2 -


i have android application consumes webservice located on glassfish server on laptop. when both laptop , device connected wifi, works intended. when try access webservice when device connected mobile 3g net throws timeout error:

w/system.err(3835): java.net.connectexception: failed connect >/[routeripaddress] (port 8080): connect failed: etimedout (connection timed out)

i have configurated router forward http laptops ip , port 8080.

this code calling webservice:

public class webservice { //namespace of webservice - can found in wsdl private static string namespace = "http://service.marcusjacobsson.com/"; //webservice url - wsdl file location     private static string url = "http://[myroutersipaddress]:8080/webserviceproject/hellowebservice?wsdl"; //soap action uri again namespace + web method name private static string soap_action = "http://service.marcusjacobsson.com/";  public static string[] invokehelloworldws(string webmethname) {     string[] resultarray = null;     // create request     soapobject request = new soapobject(namespace, webmethname);            // create envelope     soapserializationenvelope envelope = new soapserializationenvelope(             soapenvelope.ver11);     // set output soap object     envelope.setoutputsoapobject(request);     // create http call object     httptransportse androidhttptransport = new httptransportse(url);      try {         // invoke web service         androidhttptransport.call(soap_action+webmethname, envelope);         // response         soapobject response = (soapobject) envelope.bodyin;          if(response!=null){             int count = response.getpropertycount();             resultarray = new string[count];             for(int i=0;i<count;i++){                 resultarray[i]=response.getproperty(i).tostring();             }         }         return resultarray;      } catch (exception e) {         //print error         e.printstacktrace();     }      //return restxt calling object     return resultarray; }     } 

what causing application not being able connect laptop on mobile internet, works when both devices running on same wifi? (some config needed ip addresses)

thanks in advance answers or tips on how debug issue.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -