Page 1 of 1

WebService-Java-Axis

PostPosted: Sat Jul 16, 2005 4:20 pm
by Myths
http://www.ohm.engr.tu.ac.th/~s5580363/axis/

dowload ไปอ่านวิธีใช้ดูละกัน
อันนี้จะเป็น Service ที่เรียกว่า Axis นะฮับ
เอาไปวางไว้ใน Tomcat เหมือนเวบธรรมดา
ก็จะได้ Service มาใช้ลงอ่านๆไปก่อน
สำหรับ file ของ axis<code> เดียว upload
ตามไปให้ทีหลัง ตอนนี้ยังส่งไม่ได้
- install_axis.pdf การติดตั้ง <ตอนนี้ยังไม่ได้ upfile ประมาณ 5-10 mb>
- Publish_Service.htm <วิธีสร้าง function>
- creating_ws.pdf <วิธีสร้าง function>


ปล. ไหนๆได้ host จากการเรียน LE ก็เอามาใช้เล่นนิดนึง

Java Web Services Developer Pack

PostPosted: Sat Aug 27, 2005 4:10 am
by Myths
http://www.cis.umassd.edu/~hxu/Projects ... bServices/
http://java.sun.com/webservices/downloa ... spack.html

อันนี้จะเป็น Packget ของ sun ประมาณ 30 mb

config อาจจะน้อยกว่า axis หน่อยนึง
เหมือนเป็น ant ไม่ค่อยเข้าใจเท่าไรลองดูละกัน

WebService C# .Net Dll

PostPosted: Sat Aug 27, 2005 4:17 am
by Myths
Webservice ของ C# ทำง่ายกว่า java พอสมควรเนื่องจาก program
ทำให้ทั้งหมดทำให้ไม่เห็น backgroud ของมันเลย
สร้าง Project เป็น WebService เอา comment ของ HelloWorld ก็เสร็จแล้ว

ทำ dll file ก็สร้าง Project เป็น Class Library แล้วเขียน class ที่มี method ให้เรียกใช้
พอ build ก็จะได้ dll file ออกมา

เวลาทำไปใช้ให้ add reference แล้ว browse file dll ก็จะได้ reference ไปยัง class นั้น
สามารถสร้างและเรียกใช้ได้เหมือน class ธรรมดา

Config axis and set classpath

PostPosted: Sun Aug 28, 2005 9:25 am
by Myths
upload วิธี set path ของ axis กับ tomcat ไว้ให้แล้วนะ
มันจะมีวิธี set classpath นี่หละ ที่สำคัญที่สุด
ถ้า set ถูก จะสามารถ complier กะ run ใน editplus ได้เลย <ต้อง set editplus ก่อนนะ>
ทั้งติดต่อทั้งสร้างนะฮับ

http://www.ohm.engr.tu.ac.th/~s5580363/axis/readme.txt

ปล.1 file ที่ให้ไปเรารวบรวมมาแล้วว่า มันเล็กที่สุดแล้ว ทำให้มันทำงานได้
ปล.2 เราต่อทั้งไปและกลับ java .net ได้แล้วใครทำ .net กะ
ลง axis เสร็จแล้วมาคุยกัน
ปล.3 เดียวถ้าว่างจะ upload วิธีทำติดต่อ java .net ให้อีกที

Step by Step WebService Java with Axis on Tomcat

PostPosted: Fri Sep 16, 2005 11:51 pm
by Myths
วิธีสร้าง java webservice with axis on tomcat
ตัวอย่างการทำ service แล้วใช้ file .java เรียกนะ
.net add web reference ให้ถูกก็จะเรียกได้เลยเหมือนกัน

http://www.ohm.engr.tu.ac.th/~s5580363/axis/Hello.zip

โหลดไปลองกันดูนะมี ปัญหาอะไรก็ว่ามาฮับ
โหลด file axis.rar ไปด้วยนะ
อ่าน readme ใน zip ดูละกันนนนน

EJB & Web Service on NetBean 4.1

PostPosted: Wed Sep 21, 2005 10:03 pm
by Myths
ข่าวล่าสุดตอนนี้ ถ้าใช้ netbean 4.1 กับ j2ee server
จะสามารถ สร้าง ejb และ เวบ service ได้จากการ click ๆ
ลองถาม oat ดูนะฮับ

PostPosted: Fri Sep 23, 2005 4:08 pm
by oygnon
ตัวอย่าง session bean HelloWorld
ใช้ eclipse3.0.2 เปิด project
deploy บน jboss4.0.2
copy jar ของ axis ไปวางใน C:\(ชื่อdirของ jboss4.0.2)\server\default\lib

http://www.geocities.com/iwantfreeaccount/HelloJ2EE.zip

PostPosted: Fri Sep 23, 2005 4:10 pm
by oygnon
source code
Project Name : HelloDotNet
file name : HelloDotNet.asmx
Code: Select all

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace HelloDotNet
{
   /// <summary>
   /// Summary description for HelloDotNet.
   /// </summary>
   public class HelloDotNet : System.Web.Services.WebService
   {
      public HelloDotNet()
      {
         //CODEGEN: This call is required by the ASP.NET Web Services Designer
         InitializeComponent();
      }

      #region Component Designer generated code
      
      //Required by the Web Services Designer
      private IContainer components = null;
            
      /// <summary>
      /// Required method for Designer support - do not modify
      /// the contents of this method with the code editor.
      /// </summary>
      private void InitializeComponent()
      {
      }

      /// <summary>
      /// Clean up any resources being used.
      /// </summary>
      protected override void Dispose( bool disposing )
      {
         if(disposing && components != null)
         {
            components.Dispose();
         }
         base.Dispose(disposing);      
      }
      
      #endregion

      // WEB SERVICE EXAMPLE
      // The HelloWorld() example service returns the string Hello World
      // To build, uncomment the following lines then save and build the project
      // To test this web service, press F5

      [WebMethod][SoapRpcMethod]
      public string HelloWorld()
      {
         return "Hello,World I'm .NET";
      }

      [WebMethod][SoapRpcMethod]
      public string Hello(string s)
      {
         return "Hello " + s;
      }


   }
}


Java call .Net

PostPosted: Thu Oct 20, 2005 8:53 pm
by Myths
http://board.com-sci.net/viewtopic.php?t=573
หมิงก็ทำไว้ให้ดูล้วนี่น่า

เอาของเราไปดูอีกคนละกัน
Code: Select all
import org.apache.axis.client.Call;            //axis   
import org.apache.axis.client.Service;         //axis   
import javax.xml.namespace.QName;         //jaxrpc
import org.apache.axis.encoding.XMLType; //axis   
import javax.xml.rpc.ParameterMode;         //jaxrpc

/* Client use for run
*
* axis.jar
* jaxrpc.jar
* commons-logging.jar
* commons-discovery.jar
* saaj.jar
*
*/

public class RealCall {
   public static void main(String[] args)
   {
      try {
         
         String endpoint = "http://localhost/SigmaService/SigmaService.asmx?wsdl";      //wsdl
         String namespace = "http://tempuri.org/";   //fix namespace for .net
         String opr = "SigmaRange"; // operator name<method>
         Service service = new Service();
         Call call = (Call) service.createCall();
         call.setTargetEndpointAddress(new java.net.URL(endpoint));
         call.setOperationName( new QName(namespace, opr) );
         call.addParameter( "from",XMLType.XSD_INT,ParameterMode.IN);   // parameter must match with .net
         call.addParameter( "to",XMLType.XSD_INT,ParameterMode.IN);      // type must match too
         call.setReturnType( XMLType.XSD_INT);
         call.setSOAPActionURI("http://tempuri.org/" + opr);
         Object result = call.invoke( new Object[] { new Integer(1), new Integer(5) } ); //send parameter
         System.out.println("Result = " + result );
      }
      catch (Exception e) { System.err.println(e); }
   }
}