Hi

How can i get the XML response from the Nusoap php web server

any idea about that

On Wed, Jun 24, 2009 at 11:21 PM, feda al-shahwan <fa.alshah...@gmail.com>wrote:

> Thank you for your response but could you please give me more details
> because my soap envelope doesnot contain a method it is just hello and what
> to put in the property field?
> Thanks
>
> On Tue, Jun 23, 2009 at 5:25 AM, sagar.indianic 
> <sagar.india...@gmail.com>wrote:
>
>>
>> You dont need to parse manually...
>> First get the "ksoap2-j2se-full-2.1.2.jar".. Search you will get it..
>>
>> then use the following code..
>>
>> private static String SOAP_ACTION = "namespace/FunName";
>>    private static String METHOD_NAME = "method_name";
>>    private static final String NAMESPACE = "namespace";
>>    private static final String URL = "Url of web service";
>>
>> SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
>>                request.addProperty("field of web service", variable);
>>
>>        SoapSerializationEnvelope envelope = new
>> SoapSerializationEnvelope(SoapEnvelope.VER11);
>>        envelope.setOutputSoapObject(request);  // same as
>> envelope.bodyOut = request;
>>
>>        HttpTransportSE httpTransport = new HttpTransportSE(URL);
>>        httpTransport.call(SOAP_ACTION, envelope); //This sends a soap
>> request and response will be in envelope only.
>>
>> Now check for envelope.bodyIn will give you response from webservice.
>> This will give you SoapObject. Retrieve response strings from the
>> SoapObject method.
>>
>>
>> On Jun 22, 10:17 am, Desu Vinod Kumar <vinny.s...@gmail.com> wrote:
>> > Hi  everyone
>> >
>> > i am looking for soap web services in android. my hand also will help to
>> u
>> >
>> > actually i need to connect the PHP soap web services in android
>> >
>> > i need to get the response from the PHP server and should return it in
>> xml
>> > format.
>> >
>> > can any body give me suggestions regarding this
>> >
>> > i have tried some small code but it is unexpectedly quiting
>> >
>> > if any android runtime errors in log cat is any problem
>> >
>> > how can i clear that android runtime errors in log cat what i am getting
>> ...
>> >
>> > Here is my code
>> >
>> > protected void onCreate(Bundle icicle)
>> >     {
>> >
>> >     super.onCreate(icicle);
>> >
>> >     // SOAP Request for the FindServiceSOAP.GetRatingInfo web service
>> >     String soapRequestXML = "<?xml version=\"1.0\"
>> encoding=\"utf-8\"?>\n" +
>> >                             "<soap:Envelope xmlns:soap=\"
>> http://schemas.xmlsoap.org/soap/envelope/\"; " +
>> >                             "               xmlns:xsi=\"
>> http://www.w3.org/2001/XMLSchema-instance\"; " +
>> >                             "               xmlns:xsd=\"
>> http://www.w3.org/2001/XMLSchema\";>\n" +
>> >                             "    <getRating xmlns=\"http://tempuri.org
>> \">\n"
>> > +
>> >                             "    </getRating>\n" +
>> >                             "  </soap:Body>\n" +
>> >                             "</soap:Envelope>";
>> >
>> >     String url = "http://www.hasdhs.com/ask.php";;
>> >     HttpClient client = new HttpClient();
>> >
>> >     PostMethod postMethod = new PostMethod(url);
>> >
>> >  // Construct a SOAP request by hand
>> >     StringBuffer request = new StringBuffer();
>> >     request.append(soapRequestXML);
>> >
>> >     postMethod.setRequestBody(request.toString());
>> >     postMethod.setRequestHeader("Content-Type","text/xml;
>> charset=utf-8");
>> >     postMethod.setRequestHeader("SOAPAction",
>> >                                              "\"http://tempuri.org\"";);
>> >
>> >     int statusCode = 0;
>> >     try {
>> >         statusCode = client.executeMethod(postMethod);
>> >     } catch (IOException e) {
>> >         Log.d("ReverseGeoCoder", e.toString(), e);
>> >     }
>> >
>> >  // Parse the SOAP Response
>> >     MyContentHandler myContentHandler = new MyContentHandler();
>> >     try {
>> >         SAXParser parser =
>> SAXParserFactory.newInstance().newSAXParser();
>> >
>> >     } catch (Exception e) {
>> >         Log.d("ISizzle", e.toString(), e);
>> >     }
>> >
>> >     // Display the response details.
>> >     List list = myContentHandler.getRating();
>> >     String[] items = new String[list.size()];
>> >     for (int i = 0; i < list.size(); i++)
>> >     {
>> >         MyContentHandler.GetRating rating = (MyContentHandler.GetRating)
>> > list.get(i);
>> >     }
>> >  // Show the data in the list view
>> >     ListView listView = (ListView) findViewById(R.id.data);
>> >     listView.setAdapter(new ArrayAdapter<String>(this,
>> >             android.R.layout.simple_list_item_1,
>> >             items));
>> >     postMethod.releaseConnection();
>> >     }
>> >
>> > }
>> >
>> > thanks in advance
>> >
>> >
>> >
>> > On Sat, Jun 20, 2009 at 8:08 PM, fifi <fa.alshah...@gmail.com> wrote:
>> >
>> > > I would like to parse a soap envelope using KSOAP2 how can  I start
>> I
>> > > am new and I tried the following code but i couldnot. Also I would
>> > > like to display the parsed elements on the screen?Thanks
>> >
>> > > package parsingsteps;
>> >
>> > > import java.io.*;
>> > > import org.ksoap2.SoapEnvelope;
>> > > import org.kxml2.io.KXmlParser;
>> > > import org.xmlpull.v1.XmlPullParserException;
>> >
>> > > /**
>> > >  *
>> > >  * @author fa00064
>> > >  */
>> > > public class ParsingSteps {
>> >
>> > >    /**
>> > >     * @param args the command line arguments
>> > >     */
>> > >    public static void main(String[] args) {
>> > >        try{
>> > >       // String msg="<hello>World!</hello>";
>> > >        String msg = "<SOAP-ENV:Envelope " + "xmlns:SOAP-ENV=\"http://
>> > >www.w3.org/2001/12/soap-envelope\" " + "xmlns:xsi=\"http://www.w3.org/
>> > > 2001/XMLSchema-instance <http://www.w3.org/%0A2001/XMLSchema-instance>\"
>> "
>> > > +"xmlns:xsd=\"http://www.w3.org/2001/
>> > > XMLSchema\"& gt;" +
>> > >         "<SOAP-ENV:Body>" +
>> > >         "<result>" +
>> > >         "<message xsi:type=\"xsd:string\">Hello World</message>" +
>> > >         "</result>" +
>> > >         "</SOAP-ENV:Body>" +
>> > >         "</SOAP-ENV:Envelope>";
>> >
>> > >      //  byte[] in= msg.getBytes();
>> >
>> > >        KXmlParser parser=new KXmlParser();
>> > >        parser.setInput(new StringReader(msg));
>> > >       SoapEnvelope soapenvelope= new SoapEnvelope
>> > > (SoapEnvelope.VER12);
>> > >        //soapenvelope.parse(parser);
>> > >        soapenvelope.parseBody(parser);
>> >
>> > >          }
>> > >        catch (IOException e) {
>> > >               System.out.println("Error reading URI: " + e.getMessage
>> > > ());
>> > >        } catch (XmlPullParserException e) {
>> > >              System.out.println("Error in parsing: " + e.getMessage
>> > > ());
>> > >        }
>> > >      //  String result=parser.getName();
>> > >        //System.out.println(result);
>> > >    }
>> > > }
>> >
>> > --
>> > Regards
>> > -------------------
>> > Desu Vinod Kumar
>> > vinny.s...@gmail.com
>>  > 09916009493
>>
>> --
>> Eng. Feda AlShahwan
>> College of Technology Studies
>> Puplic Authority for Applied Education & Training
>>
>>
>> >>
>>


-- 
Regards
-------------------
Desu Vinod Kumar
vinny.s...@gmail.com
09916009493

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to