Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » WebService/XML/JSON/SOAP/SOA  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:Weblogic Web Service学习笔记(XDoclet, Ant) [Re:charleszq]
charleszq





发贴: 36
积分: 0
于 2003-12-01 23:58 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
copy 'helloworld.jar' into the folder 'staging', where we should use the 2nd build.xml to automatically generate the type, and publish the webservices.

We should modify the build.xml file as this. ( This is the 2nd build.xml mentioned in the doucment)
-------------------------------------------------
<path id="class.path">
    <pathelement path="${java.class.path}"/>
    <pathelement path="."/>
    <fileset dir=".">
      <include name="**/*.jar"/>
    </fileset>
  </path>

<target name="ear">
   <autotype javatypes="xdoclet.Address"
      targetNamespace="http://www.foobar.com/autotypeer"
      packageName="xdoclet"
      destdir="."
      classpathref="class.path"/>
      
<servicegen destEar="ws_basic_statelessSession.ear"
contextURI="WebServices">
  <classpath refid="class.path"/>
<service ejbJar="HelloWorld.jar"
targetNamespace="http://www.bea.com/webservices/basic/statelesSession"
serviceName="HelloWorldEJB"
serviceURI="/HelloWorldEJB"
generateTypes="True"
expandMethods="True"
typeMappingFile="types.xml"
style="rpc" >
</service>
....
-------------------------------------------------
We should add the current folder into the CLASSPATH, because the 'autotypes' task will look for the xdoclet.Address class, which is in helloworld.jar; and the 'servicegen' task will look up the Serialization class which will be generated automatically into the current folder ( it's specified in the build xml file )

we add another task 'autotype' to the target 'ear', and add a new attribute to task 'servicegen', which is typeMappingFile.

the attribute 'javatypes' of 'autotype' tells ant which class is the non-built-in type, we should specify the 'classpathref' attribute to let this task know where to find the class 'xdoclet.Address'.

the task 'autotype' will generate a types.xml, together with the Serialization class 'AddressCodec.class' in the current folder, which is specified by the attribute 'destdir'.

the attribuet 'typeMappingFile' of 'servicegen' will merge 'types.xml' into 'web-services.xml' to show how to handle the non-built-in type, which is Address.

After the task 'servicegen', you will see that in the war file generated, Address.class and AddressCodec.class is in the WEB-INF/classes folder, and the content of types.xml is there in the 'web-service.xml'

Now we can deploy the generated 'ear' file into weblogic




学java的朋友,请一起来投票让sun推出中文jdk文档!!!

话题树型展开
人气 标题 作者 字数 发贴时间
16462 Weblogic Web Service学习笔记(XDoclet, Ant) charleszq 155 2003-11-30 18:37
9361 Re:Weblogic Web Service学习笔记(XDoclet, Ant) charleszq 112 2003-11-30 18:40
9291 Continue, Implement non-built-in types charleszq 1157 2003-12-01 23:44
9401 Re:Weblogic Web Service学习笔记(XDoclet, Ant) charleszq 2760 2003-12-01 23:58
9390 Re:Weblogic Web Service学习笔记(XDoclet, Ant) charleszq 1197 2003-12-02 00:04
9124 Re:Weblogic Web Service学习笔记(XDoclet, Ant) toString 24 2003-12-02 04:27
9258 Creating SOAP Message Handlers to Intercept the SOAP Message charleszq 3952 2003-12-02 23:27
9060 Have to do some other things these days, update this later. charleszq 2 2003-12-03 22:16
9565 Re:Weblogic Web Service学习笔记(XDoclet, Ant) find11 6 2003-12-06 11:01

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923