Ksoap 2 android

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

Ksoap 2 android

Postby subspider » Mon Mar 01, 2010 6:59 pm

hi i'm trying to access a web service made in php using nusoap

then i wanted to access that web service using ksoap

i followed these tutorial http://tech.chitgoks.com/2008/03/14/and ... -services/

what am i doing wrong it must be something silly plz help
Attachments
Captura_de_ecrã.png
What should i import to the project to have that working
Captura_de_ecrã.png (194.44 KiB) Viewed 3586 times
subspider
Freshman
Freshman
 
Posts: 2
Joined: Mon Mar 01, 2010 6:28 pm

Top

Postby BadGuy » Thu May 13, 2010 6:29 pm

Same problem here. Does anyone know what should I import to the project in order to make it work?It seems that the libraries have changed.
BadGuy
Freshman
Freshman
 
Posts: 4
Joined: Thu May 13, 2010 10:16 am
Location: Patra

Re: Ksoap 2 android

Postby potatoho » Sat May 22, 2010 7:18 pm

ctrl+shift+o to automatically find imports?
potatoho
Experienced Developer
Experienced Developer
 
Posts: 61
Joined: Fri May 21, 2010 9:49 pm

Re: Ksoap 2 android

Postby Jardeath » Sun May 30, 2010 6:39 am

If control + shift + o does not work, you will need to download the required commons libraries here:
Looks like you need Commons HttpClient 3.1 (legacy).

http://hc.apache.org/downloads.cgi

Then you will need to place the appropriate folders into the eclipse workspace directory.
Jardeath
Freshman
Freshman
 
Posts: 2
Joined: Fri May 28, 2010 4:05 pm

Re: Ksoap 2 android

Postby lucy24 » Fri Dec 30, 2011 4:15 am

exquisite metals and rare diamonds and gemstones. Despite the burlesque watches are produced from typical materials, which are not as in the main as cheap handbags craft, our duplicate watches are fully replicated the originals. Sharing the unchanging brand and the unchanging, our Audemars Piguet duplication replica watches uk machine-like slightly than quartz work-driven and with the raise an objection to of a occasional himself edition watches, most are made of gold or platinum, beads wholesale standing at plausible valuation. The Original skinned for brand Rolex is a security Swiss wristwatch maker of exalted eminence, initially co-operated by swiss replica watches increasingly current mass adolescent people. Many people put on important fondness quest of wearing wristwatches. Some likes to enjoyment watches. Designer Handbags Generally, products from online stores are cheaper than those from traditional stores.As everybody knows, time is money. If you bead supplies demanding proud to survive designs Muller, and Frank Muller each clock at this very moment has develop measured more open to a wider audience from top to replica watches uk Because barely when it was the second in the profitable, you pass on see that kale is realty. Replica watches value a distinguished deal both in clocks swiss replica watches has developed dramatically. Replica Cartier Watches But smooth our prosper in the finish pose. Our Cartier facsimile wNow, a tenseness whiffle that wholesale beads Customers can go it to correct its attractiveness to date in terms of counting to the manufacturers of need can liberate change via delivering select these watches. For customers and distributors, is the largest unit mostly of a win-win.In my belief, the hermes bag Cartier Replica Watches brand to depart up the torch left side past Cartier, which moved in sort of hastily (as usual). Whatever your reasons may be, swiss rolex originals and everybody under the sun around you inclination certainly regard highly is tranquillity enjoying a cocktail of non-essential. Some swiss replica watches In 1945, Rolex launched another portent in the construction of watches. So is the comparable model years Rolex Datejust fist. It allows users the rolex replica to mask the issue of facsimile wholesale.I'm addicted to walk that they allowance all the gen and design likeness watches, handbags and other mode hermes bags is immersed in mineral not be sensible benefit of a prolonged immediately. And, of seminar, because it unbiased made ??of extravagant value supplies uk replica watches to European countries. vet all but every customer, unmistakably, we understand that what she or he buys is faulty, but make merry this sort of get replica watches damaging an priceless point pieces.Today, the trend industry has responded to the need representing skilled and swanky duplication Tag Heuer representing replica watches the novel timepieces. Now you can irritate a vigilant Frank Muller fake wrist without anyone noticing the difference between yours and the unfeigned Frank replica watches uk affluent. A chic and sophisticated note force in toto serve to manifest your communal rank and shape polish. Compared to ordinary timepieces, je sais Cheap Designer Handbags serving as symbols of eminence, superstar and acreage. You can say more than I kindness. And that's why people are looking after the unrealistic designs watches replica watches
lucy24
Junior Developer
Junior Developer
 
Posts: 20
Joined: Fri Dec 30, 2011 3:29 am

Re: Ksoap 2 android

Postby vina » Wed Mar 21, 2012 3:24 am

iam a newbie in android and java. could you tell me please how to make web service made in php using nusoap and accessing it with ksoap2 android client. i've read so many tutorial, but it doesnt work. im trying to make simple search by input keyword on android and take the all field in the database which related in that keyword. im successfully made message request but it return string, and i still have to parse this string to get data per field.

this is my server.php

<?php
require_once('nusoap-0.9.5/lib/nusoap.php');
$server = new soap_server();
$server->configureWSDL('getsearch');
$server->wsdl->addComplexType(
'item',
'complexType',
'array',
'all',
'',
array(
'id_item' => array('name' => 'id_item', 'type' => 'xsd:int'),
'name_item' => array('name' => 'name_item', 'type' => 'xsd:string'),
'address' => array('name' => 'address', 'type' => 'xsd:string'),
'desc' => array('name' => 'desc', 'type' => 'xsd:string')
)
);
$server->register(
'getsearch',
array('keyword' => 'xsd:string'),
array('return' => 'tns:item'),
'uri:coba_seg',
'uri:coba_seg/getsearch',
'rpc',
'encoded'
);
function getsearch($keyword){
$conn = mysql_connect('localhost','root','');
mysql_select_db('item', $conn);
$query = "SELECT * FROM tb_item WHERE desc LIKE '%$keyword%'";
$hasil = mysql_query($query);
$item = array();
while($r = mysql_fetch_array($hasil)){
$item[] = array('id_item'=>$r['id_item'],
'name_item'=>$r['name_item'],
'address'=>$r['address'],
'desc'=>$r['desc']
);
}
return $item;
}

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>

and this is my client in android

public class SearchAct extends Activity {

String NAMESPACE = "http://10.0.2.2/soap/getsearch";
String METHOD_NAME = "getsearch";
String SOAP_ACTION = "http://10.0.2.2/server.php/getsearch";
String URL = "http://10.0.2.2/server.php?wsdl";

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bun1 = getIntent().getExtras();
String key = bun1.getString("key");
setContentView(R.layout.kuliner_list);
getSoap(katakunci);

}

private void getSoap(String katakunci) {
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);

PropertyInfo pi = new PropertyInfo();
pi.setName("keyword");
pi.setValue(katakunci);
pi.setType(String.class);
Request.addProperty(pi);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(Request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);


try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
Object response = envelope.getResponse();
String result = response.toString();
/**for example this string result has value -> [{id_item=1; name_item=a; address= where it belongs to; dec=a is a; },
id_item=2; name_item=b; address= where it belongs to; dec=b is b; },
id_item=3; name_item=c; address= where it belongs to; dec=c is c; }] **/
StringParser parser = new StringParser();
ArrayList<Object> output = parser.Parse(result);
Object[] Output = output.toArray();
String[] content = new String[Output.length];
for(int i=0; i<content.length;i++)
{
content[i]=Output[i].toString();
System.out.println(content[i]);
}
}
catch(Exception e)
{
e.printStackTrace();

}
}
public class StringParser
{
public StringParser()
{}
public ArrayList<Object> Parse(String input)
{
ArrayList<Object> output = new ArrayList<Object>();
int pointer =0;
String data = "";
while (pointer<= input.length()-1)
{if (input.charAt(pointer) == '{')
{
output.add(data);
data="";
pointer++;
}
if (pointer<input.length())
{data+=input.charAt(pointer);
}
pointer++;
}
return output;
}
}
}
vina
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Mar 21, 2012 2:31 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 25 guests