RE: Can NE 1 help me with more kXML and kSOAP samples??

"Anne Racel" <[email protected]> Tue, 10 Jun 2003 08:41:21 -0400
Newsgroups gmane.comp.java.enhydra.kxml
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C32F2C.118B8A90
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Maybe I'm missing something.  But all I see in your request is the user
name.  I don't see where you actually add your 'xmlData' to the request.
And the error indicates it's looking for a <Custo_Appointment> tag.
  -----Original Message-----
  From: [email protected] [mailto:[email protected]]On Behalf Of
Bhanu
  Sent: Tuesday, June 03, 2003 9:05 AM
  To: [email protected]
  Subject: Kxml: Can NE 1 help me with more kXML and kSOAP samples??


  Hi,



  I am new to J2ME, just started working on a project where my J2ME
application needs to receive/send data to .NET web service. I have written a
sample code to test the service. I was able to get the data from the server.



  Now, my question here is:



  1. How do I parse and get the data from the response I got from the server
since it contains lot of things?



  2. I have this XML




<Cust_Appointment><Record><Internal_Cust_Id>1</Internal_Cust_Id><Appointment
_Type>1</Appointment_Type><Appointment_Date>5-June-2003</Appointment_Date><U
ser_Id>1</User_Id><Description><![CDATA[Mobile
Demo]]></Description><Active_Date>5-June-2002</Active_Date><Inactive_Date>

  5-June-2004</Inactive_Date></Record></Cust_Appointment>



  How do I send it to the Server?? I was able to connect to the server but
it returned a Fault as below:



  Buffer:<?xml version="1.0" encoding="utf-8"?>

  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

    <soap:Body>

      <soap:Fault>

        <faultcode>soap:Client</faultcode>

        <faultstring>Server was unable to read request. --&gt; The
&amp;lt;Cust_Appointment&amp;gt; tag from namespace  is expected. Line 1,
position 2.</faultstring>

        <detail />

      </soap:Fault>

    </soap:Body>

  </soap:Envelope>

  Here is the sample I am using right now for reading/sending data from/to
the server:



  package soaptest;



  import java.io.*;
  import javax.microedition.midlet.*;
  import javax.microedition.lcdui.*;
  import javax.microedition.io.*;



  import org.ksoap.*;
  import org.kxml.*;
  import org.kxml.io.*;
  import org.kxml.parser.*;



  public class clsHTTP extends Form implements CommandListener {



  //  static final String serviceNamespace =
"http://pocketdba.com/webservices/";
    static final String serviceNamespace = "http://tempuri.org/";
    static final String
xmlData="<Cust_Appointment><Record><Internal_Cust_Id>1</Internal_Cust_Id><Ap
pointment_Type>1</Appointment_Type><Appointment_Date>5-June-2003</Appointmen
t_Date><User_Id>1</User_Id><Description><![CDATA[Mobile
Demo]]></Description><Active_Date>5-June-2002</Active_Date><Inactive_Date>5-
June-2004</Inactive_Date></Record></Cust_Appointment>";
    TextField fromField = new TextField ("UserName :", "ss", 4,
TextField.ANY);
    StringItem resultItem = new StringItem ("", "");
    Command getCommand = new Command ("Get", Command.SCREEN, 1);
    Command sendCommand = new Command ("Send", Command.SCREEN, 2);



    public clsHTTP() {
      super("Get Data");



      append (fromField);
      append (resultItem);
      addCommand (getCommand);
      addCommand (sendCommand);



      setCommandListener (this);
    }



    public void commandAction (Command c, Displayable d) {
      if(c.getLabel()=="Get"){
        try {
          String from = fromField.getString ();
          ByteArrayOutputStream bos = new ByteArrayOutputStream ();
          SoapObject request = new SoapObject (serviceNamespace,
"DownloadAppointmentConfig");
          request.addProperty ("uName", fromField.getString ());



          ClassMap classMap = new ClassMap();
          classMap.prefixMap = new PrefixMap(classMap.prefixMap, "tns",
"http://tempuri.org/");
          SoapEnvelope envelope = new SoapEnvelope (classMap);
          envelope.setBody (request);



          XmlWriter xw = new XmlWriter (new OutputStreamWriter (bos));
          envelope.write (xw);
          xw.flush ();



          byte [] data = bos.toByteArray();
          // System.out.println (new String (data));



          HttpConnection connection = (HttpConnection) Connector.open
          ("http://MMSServer/SyncSvr/SyncSvrObj.asmx",Connector.READ_WRITE);
          connection.setRequestMethod (HttpConnection.POST);
          connection.setRequestProperty ("Content-Type", "text/xml");
          connection.setRequestProperty ("Connection", "close");
          connection.setRequestProperty ("Content-Length", ""+data.length);

connection.setRequestProperty("SOAPAction","\"http://tempuri.org/DownloadApp
ointmentConfig\"");
          OutputStream os = connection.openOutputStream ();
          os.write (data);
          os.flush ();



          InputStream is=((StreamConnection) connection).openInputStream ();
          int buffSize=200;
          byte[] buff = new byte[buffSize];
          ByteArrayOutputStream bytebuff=new
ByteArrayOutputStream(buffSize);
          int eof=0;
          while(eof!=-1) {
            eof=is.read(buff);
            if (eof!=-1) {
              bytebuff.write(buff,0,eof);
            }
          }
          is.close();



          String response = new String(bytebuff.toByteArray());
          System.out.println (response);



  /*      Reader reader = new InputStreamReader(new
          ByteArrayInputStream(bytebuff.toByteArray()));
          XmlParser parser = new XmlParser (reader);
          SoapEnvelope resultEnvelope = new SoapEnvelope ();
          resultEnvelope.parse (parser);
          resultItem.setLabel ("amount :");
          String result = (String)resultEnvelope.getResult();
          result = result.substring(0,result.indexOf(".")+3);
          resultItem.setText (" "+result);
          reader.close ();
          */
          connection.close ();
          os.close ();



        }
        catch (Exception e) {
          resultItem.setLabel ("Error:");
          resultItem.setText (e.toString ());
        }
      }
      else{



        /* Sending data to SERVER*/



        try {
          String from = fromField.getString ();
          ByteArrayOutputStream bos = new ByteArrayOutputStream ();
          SoapObject request = new SoapObject (serviceNamespace,
"Upload_Cust_Appointment");
          request.addProperty ("uName", fromField.getString ());
          request.addProperty ("fileName", "Cust_Appointment");



          ClassMap classMap = new ClassMap();
          classMap.prefixMap = new PrefixMap(classMap.prefixMap, "tns",
"http://tempuri.org/");
          SoapEnvelope envelope = new SoapEnvelope (classMap);
          envelope.setBody (request);



          XmlWriter xw = new XmlWriter (new OutputStreamWriter (bos));
          envelope.write (xw);
          xw.flush ();



           byte [] data = bos.toByteArray();




          HttpConnection connection = (HttpConnection) Connector.open
          ("http://MMSServer/SyncSvr/SyncSvrObj.asmx",Connector.READ_WRITE);
          connection.setRequestMethod (HttpConnection.POST);
          connection.setRequestProperty ("Content-Type", "text/xml");
          connection.setRequestProperty ("Connection", "close");
          connection.setRequestProperty ("Content-Length", "" +
data.length);

connection.setRequestProperty("SOAPAction","\"http://tempuri.org/Upload_Cust
_Appointment\"");
          OutputStream os = connection.openOutputStream ();
          os.write (data);
  //        os.write (xmlData.getBytes());
          os.flush ();
          os.close ();



          InputStream is=((StreamConnection) connection).openInputStream ();
          int buffSize=200;
          byte[] buff = new byte[buffSize];
          ByteArrayOutputStream bytebuff = new
ByteArrayOutputStream(buffSize);
          int eof=0;
          while(eof!=-1) {
            eof=is.read(buff);
            if (eof!=-1) {
              bytebuff.write(buff,0,eof);
            }
          }
          is.close();



          String response = new String(bytebuff.toByteArray());
          System.out.println (response);



          connection = (HttpConnection) Connector.open
          ("http://MMSServer/SyncSvr/SyncSvrObj.asmx",Connector.READ_WRITE);
          connection.setRequestMethod (HttpConnection.POST);
          connection.setRequestProperty ("Content-Type", "text/xml");
          connection.setRequestProperty ("Connection", "close");
          connection.setRequestProperty ("Content-Length", "" +
xmlData.length());

connection.setRequestProperty("SOAPAction","\"http://tempuri.org/Upload_Cust
_Appointment\"");
          os = connection.openOutputStream ();



          os.write (xmlData.getBytes());
          os.flush ();



          int datum;
          long byteCount;
          StringBuffer buffer = new StringBuffer();
          is=((StreamConnection) connection).openInputStream ();



          for(byteCount = 0; (datum=is.read()) > 0; byteCount++) {
            buffer.append((char)datum);
          }



          os.close ();



          System.out.println("==============buff=====================");
          System.out.println("Buffer:" + buffer.toString());
          System.out.println("===================================");
        }
        catch (Exception e) {
          resultItem.setLabel ("Error:");
          resultItem.setText (e.toString ());
        }
      }
    }



    private static byte[] extractXml(byte[] extractFrom){
      byte[] result;
      int off=0;
      boolean nonStop=true;
      for(int i=0;nonStop;i++){
        if (extractFrom[i]==60) {
          off=i;
          nonStop=false;
        }
      }



      result=new byte[extractFrom.length -off];
      for(int i=off;i<extractFrom.length;i++){
        result[i-off]=extractFrom[i];
      }
      return result;
    }
  }



  Any help would be appreciated.



  Thanks in advance



  Bhanu

------=_NextPart_000_0000_01C32F2C.118B8A90
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2>
<DIV><SPAN class=3D500493417-04062003><FONT face=3DArial color=3D#0000ff =
size=3D2>Maybe=20
I'm missing something.&nbsp; But all I see in your request is the user=20
name.&nbsp; I don't see where you actually add your 'xmlData' to the=20
request.&nbsp; And the error indicates it's looking for a=20
&lt;Custo_Appointment&gt; tag.</FONT></SPAN></DIV></FONT></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> =
[email protected]=20
  [mailto:[email protected]]<B>On Behalf Of =
</B>Bhanu<BR><B>Sent:</B>=20
  Tuesday, June 03, 2003 9:05 AM<BR><B>To:</B>=20
  [email protected]<BR><B>Subject:</B> Kxml: Can NE 1 help me with more =
kXML and=20
  kSOAP samples??<BR><BR></FONT></DIV>
  <DIV>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi,</SPAN><SPAN=20
  style=3D"FONT-FAMILY: 'Arial Unicode MS'"><o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am new to J2ME, just =
started=20
  working on a project where my J2ME application&nbsp;needs=20
  to&nbsp;receive/send&nbsp;data to .NET web service. I have written a =
sample=20
  code to test the service. I was able to get the data from the server.=20
  </SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Now, my question here=20
  is:</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><STRONG><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">1. How do I parse and =
get the data=20
  from the response I got from the server since it contains lot of=20
  things?</SPAN></STRONG><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><STRONG><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></STRONG>=20
  <o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><STRONG><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">2. I have this=20
  XML</SPAN></STRONG><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&lt;Cust_Appointment&gt;&lt;Record&gt;&lt;Internal_Cust_Id&gt;1&lt=
;/Internal_Cust_Id&gt;&lt;Appointment_Type&gt;1&lt;/Appointment_Type&gt;&=
lt;Appointment_Date&gt;5-June-2003&lt;/Appointment_Date&gt;&lt;User_Id&gt=
;1&lt;/User_Id&gt;&lt;Description&gt;&lt;![CDATA[Mobile=20
  =
Demo]]&gt;&lt;/Description&gt;&lt;Active_Date&gt;5-June-2002&lt;/Active_D=
ate&gt;&lt;Inactive_Date&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">5-June-2004&lt;/Inactive_Date&gt;&lt;/Record&gt;&lt;/Cust_Appointm=
ent&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><STRONG><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">How do I send it to the =
Server?? I=20
  was able to connect to the server but it&nbsp;returned a Fault as=20
  below:</SPAN></STRONG><SPAN=20
  style=3D"FONT-FAMILY: 'Arial Unicode MS'; mso-fareast-font-family: =
'Times New Roman'"><o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Buffer:&lt;?xml =
version=3D"1.0"=20
  encoding=3D"utf-8"?&gt;</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&lt;soap:Envelope =
xmlns:soap=3D"<A=20
  =
href=3D"http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap=
.org/soap/envelope/</A>"&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;=20
  &lt;soap:Body&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;=20
  &lt;soap:Fault&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;faultcode&gt;soap:Client&lt;/faultcode&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;faultstring&gt;Server was unable to read request. --&amp;gt; The=20
  &amp;amp;lt;Cust_Appointment&amp;amp;gt; tag from namespace&nbsp; is =
expected.=20
  Line 1, position 2.&lt;/faultstring&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;detail /&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;=20
  &lt;/soap:Fault&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;=20
  &lt;/soap:Body&gt;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&lt;/soap:Envelope&gt;</SPAN><SPAN=20
  style=3D"FONT-FAMILY: 'Arial Unicode MS'; mso-fareast-font-family: =
'Times New Roman'"><o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><STRONG><I><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here is the sample I am =
using=20
  right now for reading/sending data from/to the=20
  server:</SPAN></I></STRONG><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">package=20
  soaptest;</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">import =
java.io.*;<BR>import=20
  javax.microedition.midlet.*;<BR>import =
javax.microedition.lcdui.*;<BR>import=20
  javax.microedition.io.*;</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">import =
org.ksoap.*;<BR>import=20
  org.kxml.*;<BR>import org.kxml.io.*;<BR>import=20
  org.kxml.parser.*;</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">public class clsHTTP =
extends Form=20
  implements CommandListener {</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">//&nbsp; static final =
String=20
  serviceNamespace =3D "<A=20
  =
href=3D"http://pocketdba.com/webservices/">http://pocketdba.com/webservic=
es/</A>";<BR>&nbsp;=20
  static final String serviceNamespace =3D "<A=20
  href=3D"http://tempuri.org/">http://tempuri.org/</A>";<BR>&nbsp; =
static final=20
  String=20
  =
xmlData=3D"&lt;Cust_Appointment&gt;&lt;Record&gt;&lt;Internal_Cust_Id&gt;=
1&lt;/Internal_Cust_Id&gt;&lt;Appointment_Type&gt;1&lt;/Appointment_Type&=
gt;&lt;Appointment_Date&gt;5-June-2003&lt;/Appointment_Date&gt;&lt;User_I=
d&gt;1&lt;/User_Id&gt;&lt;Description&gt;&lt;![CDATA[Mobile=20
  =
Demo]]&gt;&lt;/Description&gt;&lt;Active_Date&gt;5-June-2002&lt;/Active_D=
ate&gt;&lt;Inactive_Date&gt;5-June-2004&lt;/Inactive_Date&gt;&lt;/Record&=
gt;&lt;/Cust_Appointment&gt;";<BR>&nbsp;=20
  TextField fromField =3D new TextField ("UserName :", "ss", 4,=20
  TextField.ANY);<BR>&nbsp; StringItem resultItem =3D new StringItem =
("",=20
  "");<BR>&nbsp; Command getCommand =3D new Command ("Get", =
Command.SCREEN,=20
  1);<BR>&nbsp; Command sendCommand =3D new Command ("Send", =
Command.SCREEN,=20
  2);</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp; public clsHTTP()=20
  {<BR>&nbsp;&nbsp;&nbsp; super("Get Data");</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; =
append=20
  (fromField);<BR>&nbsp;&nbsp;&nbsp; append =
(resultItem);<BR>&nbsp;&nbsp;&nbsp;=20
  addCommand (getCommand);<BR>&nbsp;&nbsp;&nbsp; addCommand=20
  (sendCommand);</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;=20
  setCommandListener (this);<BR>&nbsp; }</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp; public void =
commandAction=20
  (Command c, Displayable d) {<BR>&nbsp;&nbsp;&nbsp;=20
  if(c.getLabel()=3D=3D"Get"){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try=20
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String from =3D=20
  fromField.getString ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  ByteArrayOutputStream bos =3D new ByteArrayOutputStream=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SoapObject request =
=3D new=20
  SoapObject (serviceNamespace,=20
  =
"DownloadAppointmentConfig");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
  request.addProperty ("uName", fromField.getString =
());</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  ClassMap classMap =3D new=20
  ClassMap();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
classMap.prefixMap =3D=20
  new PrefixMap(classMap.prefixMap, "tns", "<A=20
  =
href=3D"http://tempuri.org/">http://tempuri.org/</A>");<BR>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  SoapEnvelope envelope =3D new SoapEnvelope=20
  (classMap);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
envelope.setBody=20
  (request);</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  XmlWriter xw =3D new XmlWriter (new OutputStreamWriter=20
  (bos));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; envelope.write=20
  (xw);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xw.flush=20
  ();</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  byte [] data =3D=20
  bos.toByteArray();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //=20
  System.out.println (new String (data));</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  HttpConnection connection =3D (HttpConnection)=20
  Connector.open<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ("<A=20
  href=3D"http://mmsserver/SyncSvr/SyncSvrObj.asmx"><FONT=20
  =
color=3D#0000ff>http://MMSServer/SyncSvr/SyncSvrObj.asmx",Connector.READ_=
WRITE</FONT></A>);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestMethod=20
  (HttpConnection.POST);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Content-Type",=20
  "text/xml");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Connection",=20
  "close");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Content-Length",=20
  ""+data.length);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty("SOAPAction","\"<A=20
  =
href=3D"http://tempuri.org/DownloadAppointmentConfig/">http://tempuri.org=
/DownloadAppointmentConfig\</A>"");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
  OutputStream os =3D connection.openOutputStream=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os.write=20
  (data);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os.flush=20
  ();</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  InputStream is=3D((StreamConnection) connection).openInputStream=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int=20
  buffSize=3D200;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte[] =
buff =3D new=20
  byte[buffSize];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  ByteArrayOutputStream bytebuff=3Dnew=20
  =
ByteArrayOutputStream(buffSize);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
  int eof=3D0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
while(eof!=3D-1)=20
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
eof=3Dis.read(buff);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
  if (eof!=3D-1)=20
  =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
bytebuff.write(buff,0,eof);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
  }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  is.close();</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  String response =3D new=20
  =
String(bytebuff.toByteArray());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
  System.out.println (response);</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">/*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  Reader reader =3D new=20
  InputStreamReader(new<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
ByteArrayInputStream(bytebuff.toByteArray()));<BR>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;=20
  XmlParser parser =3D new XmlParser=20
  (reader);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SoapEnvelope=20
  resultEnvelope =3D new SoapEnvelope=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resultEnvelope.parse =

  (parser);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
resultItem.setLabel=20
  ("amount :");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String =
result =3D=20
  =
(String)resultEnvelope.getResult();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
  result =3D=20
  =
result.substring(0,result.indexOf(".")+3);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;=20
  resultItem.setText (" =
"+result);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  reader.close ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  */<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connection.close=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os.close=20
  ();</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (Exception e)=20
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resultItem.setLabel=20
  ("Error:");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
resultItem.setText=20
  (e.toString ());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}<BR>&nbsp;&nbsp;&nbsp;=20
  }<BR>&nbsp;&nbsp;&nbsp; else{</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*=20
  Sending data to SERVER*/</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try=20
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String from =3D=20
  fromField.getString ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  ByteArrayOutputStream bos =3D new ByteArrayOutputStream=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SoapObject request =
=3D new=20
  SoapObject (serviceNamespace,=20
  =
"Upload_Cust_Appointment");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
  request.addProperty ("uName", fromField.getString=20
  ());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request.addProperty =

  ("fileName", "Cust_Appointment");</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  ClassMap classMap =3D new=20
  ClassMap();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
classMap.prefixMap =3D=20
  new PrefixMap(classMap.prefixMap, "tns", "<A=20
  =
href=3D"http://tempuri.org/">http://tempuri.org/</A>");<BR>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  SoapEnvelope envelope =3D new SoapEnvelope=20
  (classMap);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
envelope.setBody=20
  (request);</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  XmlWriter xw =3D new XmlWriter (new OutputStreamWriter=20
  (bos));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; envelope.write=20
  (xw);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xw.flush=20
  ();</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  byte [] data =3D bos.toByteArray();</SPAN><o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  HttpConnection connection =3D (HttpConnection)=20
  Connector.open<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ("<A=20
  href=3D"http://mmsserver/SyncSvr/SyncSvrObj.asmx"><FONT=20
  =
color=3D#0000ff>http://MMSServer/SyncSvr/SyncSvrObj.asmx",Connector.READ_=
WRITE</FONT></A>);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestMethod=20
  (HttpConnection.POST);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Content-Type",=20
  "text/xml");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Connection",=20
  "close");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Content-Length", "" +=20
  data.length);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty("SOAPAction","\"<A=20
  =
href=3D"http://tempuri.org/Upload_Cust_Appointment/">http://tempuri.org/U=
pload_Cust_Appointment\</A>"");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
  OutputStream os =3D connection.openOutputStream=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os.write=20
  (data);<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os.write=20
  (xmlData.getBytes());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
os.flush=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os.close=20
  ();<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  InputStream is=3D((StreamConnection) connection).openInputStream=20
  ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int=20
  buffSize=3D200;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; byte[] =
buff =3D new=20
  byte[buffSize];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  ByteArrayOutputStream bytebuff =3D new=20
  =
ByteArrayOutputStream(buffSize);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
  int eof=3D0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
while(eof!=3D-1)=20
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
eof=3Dis.read(buff);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
  if (eof!=3D-1)=20
  =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
bytebuff.write(buff,0,eof);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
  }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  is.close();<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  String response =3D new=20
  =
String(bytebuff.toByteArray());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
  System.out.println (response);<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection =3D (HttpConnection)=20
  Connector.open<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ("<A=20
  href=3D"http://mmsserver/SyncSvr/SyncSvrObj.asmx"><FONT=20
  =
color=3D#0000ff>http://MMSServer/SyncSvr/SyncSvrObj.asmx",Connector.READ_=
WRITE</FONT></A>);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestMethod=20
  (HttpConnection.POST);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Content-Type",=20
  "text/xml");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Connection",=20
  "close");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty ("Content-Length", "" +=20
  xmlData.length());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  connection.setRequestProperty("SOAPAction","\"<A=20
  =
href=3D"http://tempuri.org/Upload_Cust_Appointment/">http://tempuri.org/U=
pload_Cust_Appointment\</A>"");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
  os =3D connection.openOutputStream ();<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  os.write =
(xmlData.getBytes());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  os.flush ();<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  int datum;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long=20
  byteCount;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringBuffer =
buffer =3D=20
  new StringBuffer();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  is=3D((StreamConnection) connection).openInputStream =
();<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  for(byteCount =3D 0; (datum=3Dis.read()) &gt; 0; byteCount++)=20
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
buffer.append((char)datum);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
  }<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  os.close ();<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
System.out.println("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dbuff=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D");<BR>&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  System.out.println("Buffer:" +=20
  buffer.toString());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
System.out.println("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D");<BR>&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;=20
  }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (Exception e)=20
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resultItem.setLabel=20
  ("Error:");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
resultItem.setText=20
  (e.toString ());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}<BR>&nbsp;&nbsp;&nbsp;=20
  }<BR>&nbsp; }<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp; private static =
byte[]=20
  extractXml(byte[] extractFrom){<BR>&nbsp;&nbsp;&nbsp; byte[]=20
  result;<BR>&nbsp;&nbsp;&nbsp; int off=3D0;<BR>&nbsp;&nbsp;&nbsp; =
boolean=20
  nonStop=3Dtrue;<BR>&nbsp;&nbsp;&nbsp; for(int=20
  i=3D0;nonStop;i++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
(extractFrom[i]=3D=3D60)=20
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  off=3Di;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  nonStop=3Dfalse;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}<BR>&nbsp;&nbsp;&nbsp;=20
  }<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp; =
result=3Dnew=20
  byte[extractFrom.length -off];<BR>&nbsp;&nbsp;&nbsp; for(int=20
  =
i=3Doff;i&lt;extractFrom.length;i++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  result[i-off]=3DextractFrom[i];<BR>&nbsp;&nbsp;&nbsp; =
}<BR>&nbsp;&nbsp;&nbsp;=20
  return result;<BR>&nbsp; }<BR>}</SPAN><SPAN=20
  style=3D"FONT-FAMILY: 'Arial Unicode MS'; mso-fareast-font-family: =
'Times New Roman'"><o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">&nbsp;<o:p></o:p></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Any help would be=20
  appreciated.<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks in=20
  advance<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">&nbsp;<o:p></o:p></SPAN></P>
  <P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
  style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">Bhanu</SPAN></P></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0000_01C32F2C.118B8A90--