Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. cant recive data from WebService via Android ksoap2

cant recive data from WebService via Android ksoap2

Scheduled Pinned Locked Moved Android
csharpandroidwcfjavaasp-net
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    goldsoft
    wrote on last edited by
    #1

    i'am trying to send string to webservice and get replay from. i use android studio for programming on java for android and visual-studio 2010 for programming the C# webservice. i have this code on android private static final String SOAP_ACTION = "http://tempuri.org/HELO"; private static final String OPERATION_NAME = "HELO";// your webservice web method name private static final String WSDL_TARGET_NAMESPACE = "http://tempuri.org/"; private static final String SOAP_ADDRESS = "http://10.0.0.2/WS\_TEST/Service1.asmx"; SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, OPERATION_NAME); PropertyInfo info= new PropertyInfo(); info = new PropertyInfo(); //Set Name info.setName("HELO"); //Set Value info.setValue("New User"); //Set dataType info.setType(String.class); //Add the property to request object request.addProperty(info); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS); try { httpTransport.call(SOAP_ACTION, envelope); Object response = envelope.getResponse(); tvData1.setText(response.toString()); } catch (Exception exception) { tvData1.setText(exception.toString()); } and this my C# WebService [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HELO(string Name) { return "Hello : " + Name; } } and i got only Helo: without the string that i send instead of Helo: New User thans

    A 1 Reply Last reply
    0
    • G goldsoft

      i'am trying to send string to webservice and get replay from. i use android studio for programming on java for android and visual-studio 2010 for programming the C# webservice. i have this code on android private static final String SOAP_ACTION = "http://tempuri.org/HELO"; private static final String OPERATION_NAME = "HELO";// your webservice web method name private static final String WSDL_TARGET_NAMESPACE = "http://tempuri.org/"; private static final String SOAP_ADDRESS = "http://10.0.0.2/WS\_TEST/Service1.asmx"; SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, OPERATION_NAME); PropertyInfo info= new PropertyInfo(); info = new PropertyInfo(); //Set Name info.setName("HELO"); //Set Value info.setValue("New User"); //Set dataType info.setType(String.class); //Add the property to request object request.addProperty(info); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS); try { httpTransport.call(SOAP_ACTION, envelope); Object response = envelope.getResponse(); tvData1.setText(response.toString()); } catch (Exception exception) { tvData1.setText(exception.toString()); } and this my C# WebService [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HELO(string Name) { return "Hello : " + Name; } } and i got only Helo: without the string that i send instead of Helo: New User thans

      A Offline
      A Offline
      Afzaal Ahmad Zeeshan
      wrote on last edited by
      #2

      I would suggest debugging to see if WCF is capturing the value being passed or not. It may be caused by the value not being passed to the function, or value being empty string or something.

      The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups