Axis入門學習(轉載)
RSS Feed for beginner
By subscribing to this Really Simple Syndication (RSS) feed, you can preview updates made to this space in any RSS reader or aggregator. RSS allows you to subscribe to feeds from several sources and automatically combines the information into one list. You can quickly browse the list without visiting each site to search for new information of interest to you.
Subscribe to this feed in Live.com
Subscribe to this feed in an aggregator that supports one-click subscription
Using Apache-Axis to develop the WebService (Lesson 4)
?{
????? public String getName( String name )
??????{
??????????? return "hello " + name;
??????}
?}
?{
??????? public static void main(String [] args) throws Exception {
????????????? String endpoint = http://localhost:8080/learnws/services/SayHello;
??????????????Service service = new Service();
??????????????Call call??? = (Call) service.createCall();
????????????? call.setTargetEndpointAddress(new java.net.URL(endpoint));
????????????? call.setOperationName("getName");
????????????? String res = (String) call.invoke(new Object[]{"GuanYabei"});
????????????? System.out.println(res);
???????? }
?set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%
?set Axis_Servlet=http://localhost:8080/learnws/servlet/AxisServlet
?%Java_Cmd% org.apache.axis.client.AdminClient -l%Axis_Servlet% deploy.wsdd
?set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%
?set Output_Path=E:\workspace\learnws\src
?set Package=server
?%Java_Cmd% org.apache.axis.wsdl.WSDL2Java -o%Output_Path% -p%Package% SayHello.wsdl
?import javax.xml.rpc.ServiceException;
?{
??????? * @param args
??????? * @throws RemoteException?
????????*/
???????? public static void main( String[] args )
???????? {
??????????????? SayHelloService service = new SayHelloServiceLocator();
??????????????? SayHello_PortType client = null;
??????????????? try
??????????????? {
????????????????????? client = service.getSayHello();
????????????????}
??????????????? catch (ServiceException e)
??????????????? {
?????????????????????? e.printStackTrace();
??????????????? }
????????????????String retValue = null;
??????????????? try
??????????????? {
?????????????????????? retValue = client.getName("clientname");
????????????????}
??????????????? catch (RemoteException e)
??????????????? {
????????????????????????// TODO Auto-generated catch block
??????????????????????? e.printStackTrace();
??????????????? }
??????????????? System.out.println(retValue);
&referrer=)

Published Date: 四, 09 八月 2007 00:42:19 GMT
Read the full item
Using Apache-Axis to develop the WebService (Lesson 3)
<!DOCTYPE web-app PUBLIC
??? "-//Sun Microsystems, Inc.//DTD Web
??? Application 2.3//EN" "
??? <listener>
??????? <listener-class>org.apache.axis.transport.http.AxisHTTPSessionListener</listener-class>
??? </listener>
???
? <servlet>
??? <servlet-name>AxisServlet</servlet-name>
??? <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
? </servlet>
??? <servlet-name>AdminServlet</servlet-name>
??? <servlet-class> org.apache.axis.transport.http.AdminServlet</servlet-class>
??? <load-on-startup>101</load-on-startup>
? </servlet>
??? <servlet-name>SOAPMonitorService</servlet-name>
??? <display-name>SOAPMonitorService</display-name>
??? <servlet-class>org.apache.axis.monitor.SOAPMonitorService</servlet-class>
??? <init-param>
????? <param-name>SOAPMonitorPort</param-name>
????? <param-value>5001</param-value>
??? </init-param>
??? <load-on-startup>102</load-on-startup>
? </servlet>
??? <servlet-name>AxisServlet</servlet-name>
??? <url-pattern>/servlet/AxisServlet</url-pattern>
? </servlet-mapping>
??? <servlet-name>AxisServlet</servlet-name>
??? <url-pattern>*.jws</url-pattern>
? </servlet-mapping>
??? <servlet-name>AxisServlet</servlet-name>
??? <url-pattern>/services/*</url-pattern>
? </servlet-mapping>
??? <servlet-name>SOAPMonitorService</servlet-name>
??? <url-pattern>/SOAPMonitor</url-pattern>
? </servlet-mapping>
?<!--
? <servlet-mapping>
??? <servlet-name>AdminServlet</servlet-name>
??? <url-pattern>/servlet/AdminServlet</url-pattern>
? </servlet-mapping>
?-->
??????? <!-- Default to 5 minute session timeouts -->
??????? <session-timeout>5</session-timeout>
??? </session-config>
??? http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
??? for now we go with the basic 'it's XML' response -->
? <mime-mapping>
??? <extension>wsdl</extension>
???? <mime-type>text/xml</mime-type>
? </mime-mapping>
? <mime-mapping>
??? <extension>xsd</extension>
??? <mime-type>text/xml</mime-type>
? </mime-mapping>
??? <welcome-file>index.jsp</welcome-file>
??? <welcome-file>index.html</welcome-file>
??? <welcome-file>index.jws</welcome-file>
? </welcome-file-list>
{
??? public String getName( String name )
??? {
???????? return "hello " + name;
??? }
}
??<parameter name="allowedMethods" value="*"/>
?</service>
</deployment>
set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%
set Axis_Servlet=http://localhost:8080/learnws/servlet/AxisServlet
%Java_Cmd% org.apache.axis.client.AdminClient -l%Axis_Servlet% deploy.wsdd
&referrer=)

Published Date: 一, 06 八月 2007 05:39:16 GMT
Read the full item
How to use Hibernate3.2 Lesson 1


Published Date: 二, 31 七月 2007 03:33:30 GMT
Read the full item
How can I do ?


Published Date: 一, 30 七月 2007 15:01:56 GMT
Read the full item
Using Apache-Axis to develop the WebService (Lesson 2)
As you know, this time, we will show how to develop a simple webservice application. We will use the case of HelloWorld.
??
?? public class HelloWorld
?? {
?????? public String getName( String name )
?????? {
?????????? return "hello " + name;
?????? }
?? }
?? You will see a page that display a XML context. The page context is WSDL,it told we what functions were offered by WebService.
?? Don't setup the java file in a package.
?? If we use DII to visit HelloWorld, we should find operation name and parameterOrder from the page.
??
?? import javax.xml.namespace.QName;
?? import org.apache.axis.client.Call;
?? import org.apache.axis.client.Service;
?? {
????? public static void main( String[] args )
????? {
???????? String point = "http://localhost:8080/axis/HelloWorld.jws";
???????? Service service = new Service();
?????????try
???????? {
???????????? Call call = null;
???????????? call = (Call) service.createCall();
???????????? call.setOperationName(new QName(
??????????????????????????????????????????? point, "getName"));//提供方法名
?????????????call.setTargetEndpointAddress(new java.net.URL(point));//提供接口地址
???????????? String ret = (String) call.invoke(new Object[]
??????????????????????????????????????????? { "GuanYabei" });//提供接口參數
???????????? System.out.println("return value is " + ret);
??????????}
????????? catch (Exception e)
?????????{
???????????? e.printStackTrace();
?????????}
????? }
?? }
?? Now you can run this application via your IDE, you can see a word "return value is hello GuanYabei".?
&referrer=)

Published Date: 三, 25 七月 2007 02:13:09 GMT
Read the full item
Using Apache-Axis to develop the WebService (Lesson 1)
But we should understand the axis2 is not update version of axis1.x, so they are different each other.
I will introduce Axis1.4 to my viewers. ^_^
??? axis-bin-1_4.zip http://www.apache.org/dist/ws/axis/1_4/axis-bin-1_4.zip
??? axis-src-1_4.zip http://www.apache.org/dist/ws/axis/1_4/axis-src-1_4.zip
??? javamail-1_4.zip http://java.sun.com/products/javamail/downloads/index.html
??? xml-security-bin-1_3_0.zip? http://xml.apache.org/security/dist/java-library/
??? unzip javamail-1_4.zip and copy mail.jar to tomcat\common\lib\
??? copy JDK_HOME\lib\tool.jar to tomcat\common\lib\
??? you can see the Apache-AXIS page and click validation link.
??? if you can see Axis Happiness Page without "Not Found words", you are successful.
??
5. config envionment variables
???AXIS_HOME=D:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis
?? AXIS_LIB=%AXIS_HOME%\WEB-INF\lib
?? AXISCLASSPATH=.;%AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery-0.2.jar;%AXIS_LIB%\commons-logging-1.0.4.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%axis-ant.jar;%TOMCAT_HOME%\common\lib\activation.jar?
&referrer=)

Published Date: 二, 24 七月 2007 06:24:35 GMT
Read the full item
My new glasses
The glasses' material is steel. In fact, I think titanium is better than steel, but all glasses style that was made in titanium did not apply me! So, at last, I bought the steel one. I think it looks good very well. its style suited my face. But my friend said I looks like PangLong(a singer and I don't like him),it spoils me -_-!
Now I hope I can bought the second glasses that was made in titanium.?


Published Date: 二, 24 七月 2007 01:28:45 GMT
Read the full item
It doesn't matter. I will make persistent effort!


Published Date: 四, 12 七月 2007 06:23:30 GMT
Read the full item
Enjoy my dreams


Published Date: 六, 07 七月 2007 14:18:33 GMT
Read the full item
How can you understand ?
? ?How can you understand that new sky usually is outside house.
?? How can you understand that lover may not apply to gathering.
?? How can you understand that losing love is not the incurable disease?but?only an ache.
?? How can you understand that she needn’t follow you forever , in spite of accompanying you in the past.
?? How can you understand that concern of friends is not all of sweet talk.
?? How can you understand that people who you don’t like to rap to concern you very much.
?? How can you understand that people who you depend on don’t love you sometimes.
?? How can you understand that you don’t catch up with her because she don’t want to be caught by you.
?? How can you understand that you don’t hold her by bearing and connivance.
?? How can you understand that being lonely?doesn't belong to the love.
?? How can you understand that you should not be punished for her fault.
?? How can you understand that one person who love you indeed is waiting you at a distance.
??
?? The meaning of being lonely is that love is closing to you.
?? note:
?? incurable disease : 絕癥
?? sweet talk : 甜言蜜語
?? rap to : 與….說話,搭理....
?? bearing and connivance : 忍受與縱容
?? indeed : 真正地
for?you?,for me?,for everyone.
Published Date: 二, 03 七月 2007 13:43:57 GMT
Read the full item
The Most Valuable Program Language


Published Date: 五, 29 六月 2007 15:45:02 GMT
Read the full item
The Trip Of The Xingcheng-City
??????? Last weekend I enjoyed an exciting trip with my friends. This is twice to visited Xingcheng. Last time we enjoyed the trip in last year of October. We arrived at the railway station of Calabash-island City by train in the early morning. Than We went to the Xingcheng City by car. The car covered distance in 30 minutes from Calabash-island to Xingcheng City.
?????? We arrived at seashore first. I think I like the sea but I can’t swimming. We sat the sand beach and sang. The sky was very dark. I could not see any thing and only hear the sea.
? ???? if you ask me what is interesting for me, I can say “eating shrimps!”. We bought a lot of fresh shrimps from fisherfolks. The shrimp’s price is cheaper than Beijing’s. We ate many shrimp. It’s very delicious!
?????? On Sunday We visited Xingcheng by car. We visited the ancestral wall and nearly every shops. My friend ZhuXixi bought a few of seashell. She like it very much. She had a great many of beautiful seashell. I think her room must be a seashell-museums.
? ???? At last We went home by train. We have a good time!
??? note:
?? Calabash-island 葫蘆島
?? shrimp 蝦


Published Date: 四, 28 六月 2007 05:58:15 GMT
Read the full item