Note that there are some explanatory texts on larger screens.

plurals
  1. POhow can i used php webservice in android applcation
    primarykey
    data
    text
    <p>I have some code which is working in iphone and i want to make same application in android. i must use php webservice. using soap library. i want to use following webservice <a href="http://www.medihand.org/freechoicedrivers/soap/members.php" rel="nofollow">http://www.medihand.org/freechoicedrivers/soap/members.php</a></p> <p>it is wsdl code here</p> <p> − − − − − − − − − − − − </p> <p>and i used android code which i put here</p> <p>public class start extends Activity {</p> <p>private static final String SOAP_ACTION = "urn:members#syncMemberDetails";</p> <pre><code> private static final String METHOD_NAME = "syncMemberDetails"; private static final String NAMESPACE = "http://schemas.xmlsoap.org/wsdl/"; // !!!!! IMPORTANT!!!!! THE URL OF THE CoLDFUSION WEBSERVER NOT LOCALHOST BECAUSE LOCALHOST IS THE ANDROID EMULATOR !!!!! private static final String URL = "http://www.medihand.org/freechoicedrivers/soap/members.php"; //String sample[] ={"milan","pratik"}; TextView tv; String s=""; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); /* s = " &lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\n" + "&lt;SOAP-ENV:Envelope\n"+ " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\n"+ " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n"+ " xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\n"+ " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n"+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"&gt;\n"+ " &lt;SOAP-ENV:Body&gt;\n"+ " &lt;syncMemberDetails&gt;\n"+ " &lt;values xsi:type=\"xsd:Array\"&gt;\n"+ " &lt;item&gt;\n"+ " &lt;username xsi:type=\"xsd:string\"&gt;test&lt;/username&gt;\n"+ " &lt;password xsi:type=\"xsd:string\"&gt;test&lt;/password&gt;\n"+ " &lt;dates xsi:type=\"xsd:Array\"&gt;\n"+ " &lt;item&gt;\n"+ " &lt;year xsi:type=\"xsd:int\"&gt;2010&lt;/year&gt;\n"+ " &lt;month xsi:type=\"xsd:int\"&gt;12&lt;/month&gt;\n"+ " &lt;day xsi:type=\"xsd:int\"&gt;%30&lt;/day&gt;\n"+ " &lt;sync xsi:type=\"xsd:int\"&gt;(null)&lt;/sync&gt;\n"+ " &lt;times xsi:type=\"xsd:Array\"&gt;\n"+ " &lt;item&gt;\n"+ " &lt;start xsi:type=\"xsd:int\"&gt;0&lt;/start&gt;\n"+ " &lt;finish xsi:type=\"xsd:int\"&gt;0&lt;/finish&gt;\n"+ " &lt;sync xsi:type=\"xsd:int\"&gt;0&lt;/sync&gt;\n"+ " &lt;timestamp xsi:type=\"xsd:date\"&gt;2010-11-10 18:07:44 GMT&lt;/timestamp&gt;\n"+ " &lt;/item&gt;\n"+ " &lt;/times&gt;\n"+ " &lt;/item&gt;\n"+ " &lt;item&gt;\n"+ " &lt;year xsi:type=\"xsd:int\"&gt;2010&lt;/year&gt;"+ " &lt;month xsi:type=\"xsd:int\"&gt;12&lt;/month&gt;"+ " &lt;day xsi:type=\"xsd:int\"&gt;21&lt;/day&gt;"+ " &lt;sync xsi:type=\"xsd:int\"&gt;0&lt;/sync&gt;"+ " &lt;times xsi:type=\"xsd:Array\"&gt;"+ " &lt;/times&gt;"+ " &lt;/item&gt;"+ " &lt;/dates&gt;\n"+ " &lt;/item&gt;\n"+ " &lt;/values&gt;\n"+ " &lt;/syncMemberDetails&gt;\n"+ " &lt;/SOAP-ENV:Body&gt;\n"+ "&lt;/SOAP-ENV:Envelope&gt;";*/ tv = (TextView) findViewById(R.id.title); SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME); Request.addProperty("?????", "array value"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(Request); AndroidHttpTransport aht = new AndroidHttpTransport (URL); try { aht.call(SOAP_ACTION, envelope); SoapPrimitive resultstring = (SoapPrimitive) envelope.getResponse(); Toast.makeText(this, String.valueOf(resultstring), 5000).show(); } catch(Exception E) { tv.setText("ERROR:" + E.getClass().getName() + ": " + E.getMessage()); } </code></pre> <p>} }</p> <p>what i have to write in request.addProperty(????,"value") </p> <p>in dotnew web service i used tag where ? here....so any one know plz tell me how can i access this php webservice</p> <p>i also put iphone code which is already running </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload