*juragan2 java yg baik hati saya mo tanya neh saya ada xml :* *<definitions targetNamespace="urn:kursService"> - <types> - <xsd:schema targetNamespace="urn:kursService"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/> </xsd:schema> </types> - <message name="kursRequest"> <part name="dollar" type="xsd:int"/> </message> - <message name="kursResponse"> <part name="return" type="xsd:long"/> </message> - <portType name="KursPortType"> - <operation name="kurs"> <input message="tns:kursRequest"/> <output message="tns:kursResponse"/> </operation> </portType> - <binding name="KursBinding" type="tns:KursPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> - <operation name="kurs"> <soap:operation soapAction="urn:kursService#kurs" style="rpc"/> - <input> <soap:body use="encoded" namespace="urn:kursService" encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/"/> </input> - <output> <soap:body use="encoded" namespace="urn:kursService" encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> - <service name="Kurs"> - <port name="KursPort" binding="tns:KursBinding"> <soap:address location="http://192.168.102.33/andi/kurs.php"/> </port> </service> </definitions>* *
berikut adalah source code saya yg akan saya pasang di wtk menggunakan lib wingfoot* * import com.wingfoot.soap.Call; import com.wingfoot.soap.Envelope; import com.wingfoot.soap.transport.HTTPTransport; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.Form; import javax.microedition.lcdui.StringItem; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.TextField; import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; /** * * @author iwan */ public class kursClient extends MIDlet implements CommandListener, Runnable { private Form form; private TextField input; private StringItem output; private Command cmOk; private Command cmExit; private Display display; public kursClient() { form = new Form("Kurs Client"); input = new TextField("Duit", "", 10, TextField.NUMERIC); output = new StringItem("",""); cmOk = new Command("OK", Command.OK,1); cmExit = new Command("EXIT", Command.EXIT, 2); form.append(input); form.append(output); form.addCommand(cmOk); form.addCommand(cmExit); form.setCommandListener(this); } protected void startApp() throws MIDletStateChangeException { display = Display.getDisplay(this); display.setCurrent(form); //throw new UnsupportedOperationException("Not supported yet."); } protected void pauseApp() { //throw new UnsupportedOperationException("Not supported yet."); } protected void destroyApp(boolean unconditional){ //throw new UnsupportedOperationException("Not supported yet."); } public void commandAction(Command c, Displayable d) { if(c==cmOk) new Thread(this).start(); if(c==cmExit) { destroyApp(false); notifyDestroyed(); } //throw new UnsupportedOperationException("Not supported yet."); } public void run() { try { String url = "http://192.168.100.7:8901/kurs.php"; Call c = new Call(); c.setMethodName("kurs"); c.addParameter("dollar", input.getString()); HTTPTransport transport = new HTTPTransport(url, null); transport.getResponse(true); Envelope res = c.invoke(transport); output.setText("Rp. "+String.valueOf(res.getParameter(0))); } catch(Exception e) { output.setText(e.toString()); } //throw new UnsupportedOperationException("Not supported yet."); } } * *permasalahannya output yg dihasilkan selalu null* *mohon bantuan solusi nya, atau ada cara lain untuk develop mobile web service client thanx*