diff --git a/WebService/src/com/informatika/ojek/webservice/test.java b/WebService/src/com/informatika/ojek/webservice/test.java new file mode 100644 index 0000000000000000000000000000000000000000..5cb796980e783b791ab4d3d67cd19b6daa453a97 --- /dev/null +++ b/WebService/src/com/informatika/ojek/webservice/test.java @@ -0,0 +1,49 @@ +package com.informatika.ojek.webservice; + +import java.net.MalformedURLException; +import java.net.URL; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; + +public class test { + public static void main(String[] args) { + try { + String url = "http://localhost:9999/ws/profile?wsdl"; + String namespace = "http://webservice.ojek.informatika.com/"; + QName serviceQN = new QName(namespace, "ProfileService"); + Service service = Service.create(new URL(url), serviceQN); + + String portName = "ProfilePort"; + QName portQN = new QName(namespace, portName); + + IProfile sample = service.getPort(portQN, IProfile.class); + +// String[] hasil = sample.getLocation("blabla"); +// System.out.println(hasil[0]); +// System.out.println(hasil[1]); +// +// if (sample.addPreferredLocation("blabla", "Cisitu")) { +// System.out.println("sukses menambahkan"); +// } else { +// System.out.println("gagal"); +// } + +// if (sample.delPreferredLocation("blabla", "singapur")) { +// System.out.println("sukses menghapus"); +// } else { +// System.out.println("gagal"); +// } + + if (sample.updatePreferredLocation("blabla", "kucing", "Tamansari")) { + System.out.println("sukses mengupdate"); + } else { + System.out.println("gagal"); + } + + + } catch (MalformedURLException e) { + e.printStackTrace(); + } + + } +}