RE: XML Document as parameter

<[email protected]> Wed, 24 Sep 2003 08:04:42 +0300
Newsgroups gmane.comp.java.enhydra.ksoap
Message-ID <[email protected]>
Hi JM,
    below is a sample code for generating this kind of xml
 
<agency>
  <name>...</name>
  <tel>..</tel>
  <email>...</email>
  <contacted>...</contacted>
</agency>
 
   SoapObject method = new SoapObject(" http://www.tgmm.com/agenciesdemo", "agency");
   method.addProperty("name", name);
   method.addProperty("tel", phone);
   method.addProperty("email", email);
   method.addProperty("contacted", contact);
   method.addProperty("contactperson",person); 
   SoapSerializationEnvelope envelope =
    new SoapSerializationEnvelope(SoapSerializationEnvelope.VER10);
 
   envelope.bodyOut = method;
   System.err.println("connecting to new endpoint...");
    HttpTransport ht = new HttpTransport(" http://localhost:8080/struts/insert.do");//http://services.xmethods.net/soap <http://localhost:8080/struts/insert.do> ");
    try {
        System.err.println("midlet calling axis.......");
        ht.call(" http://localhost:8080/struts/insert.do", envelope);
    }  catch (Exception e) {
     System.err.println("edxceptjoen");
     e.printStackTrace();
    }

 
 
 
i hope  it'll help u in building ur XML..
for more complex samples, check this, from Michael Yuan (which is on this mailing list also :-)
 
http://www.javaworld.com/javaworld/jw-08-2002/jw-0823-wireless.html
 
 
regards
    marco
 
 

-----Original Message-----
From: ext José Manuel Castro Preciado [mailto:[email protected]]
Sent: 24 September, 2003 02:36
To: [email protected]
Subject: RE: Ksoap: XML Document as parameter



Hi, 
 
well, the general idea of this app (that i have to develop) is use a stateless session ejb web service... with no servlets... this ejb have a method with a javax.xml.transform.Source as parameter, i have read this as a way for receive xml documents, using the SOAP type 'Source' (or i'm missunderstood something)... buy like i say, my problem is to send the document from a ksoap :(  ... i read the examples you mention, but none of them use xml document as parameter (or i miss one)..
 
thanks...
JM

[email protected] wrote:

Hi ,
    yes u  can. i have done it using a serverside servlet that parses a 'saaj-style' document and returns another
XML document..
 
there are some samples in the ksoap website.
 
regards
marco

-----Original Message-----
From: ext José Manuel Castro Preciado [mailto:[email protected]]
Sent: 24 September, 2003 01:26
To: [email protected]
Subject: Ksoap: XML Document as parameter


Hi, 
 
I just begin to see web services, using kSoap... i had test the examples from the page, but no of them is use a xml document as parameter...
 
I'm developing a little example with an iPaq using webservices, but i need to send a xml document, in other word, have to work with document-style SOAP, not with RPC-style...
 
My question is: can i do this using kSoap?
 
Thanks a lot...
 
JM




  _____  

Do You Yahoo!?
 <http://espanol.yahoo.com/mail_tagline/*http://espanol.news.yahoo.com>  Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo.
Visíta Yahoo!  <http://espanol.yahoo.com/mail_tagline/*http://espanol.news.yahoo.com> Noticias.




José Manuel 




  _____  

Do You Yahoo!?
 <http://espanol.yahoo.com/mail_tagline/*http://espanol.news.yahoo.com>  Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo.
Visíta Yahoo!  <http://espanol.yahoo.com/mail_tagline/*http://espanol.news.yahoo.com> Noticias.