web service problem

Put your problem here if it does not fit any of the other categories.

web service problem

Postby DaltonGR » Thu Apr 07, 2011 7:09 am

Good morning,
i have a web service, live on the web, it can be accessed by a browser by www.mytest.gr/serv/myservice.asmx. Its a .NET web service. When i try this code it returns "HOST IS UNRESOLVED"

Code: Select all
final String URL = "http://www.mytest.gr/serv/myservice.asmx";
      final String NAMESPACE = "http://www.myTest.gr/serv/";
      final String METHOD_NAME = "getCategories";
      final String SOAP_ACTION = "http://www.myTest.gr/getCategories";
      JSONArray x = null;
      ArrayList<Categories> lstCategories = new ArrayList<Categories>();
      StringBuilder sb = new StringBuilder();
      
      SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request);

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);


as i mentioned, the web service works great when used from the browser. When i try to access it through KSoap2 it returns the error. By the way this web service returns JSON string.
DaltonGR
Junior Developer
Junior Developer
 
Posts: 13
Joined: Fri Jan 28, 2011 5:32 pm

Top

Re: web service problem

Postby imbroken » Thu Apr 07, 2011 1:02 pm

Internet permission is set?
imbroken
Senior Developer
Senior Developer
 
Posts: 131
Joined: Thu Jan 06, 2011 6:57 pm
Location: Germnay

Re: web service problem

Postby DaltonGR » Thu Apr 07, 2011 1:07 pm

yes internet permission is set.
i changed the www.mytest.gr url to its physical address(000.000.000.000) and the error is
04-07 12:06:21.177: ERROR/error message getData(6344): expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <html>@1:6 in java.io.InputStreamReader@43ba3ad0)

cant figure out wat is going wrong. If i CTRL+click the link in eclipse, it works perfectlly. If i use it through the emulator or a device it returns the above error...
DaltonGR
Junior Developer
Junior Developer
 
Posts: 13
Joined: Fri Jan 28, 2011 5:32 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 16 guests