×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

正确的方法就是, 当你做build 和 deploy时, 要抛弃使用IDE的想法.

ant 很强大长(加上unix shell就更不得了: auto build + auto deployment + clustered servers). 她可以generate code (including webservice), package code, stop server, deploycode, copy config file, then start the server. 举例来说, 如果你用JAXB + XSD 来generate code:

<target name="generateMyXMLObj">
<java jar="${JAXB_HOME}/lib/jaxb-xjc.jar" fork="true" failonerror="true" maxmemory="128m">
<arg value="-p"/>
.........
<arg value="${project.dir}/content/contents.xsd"/>
................
<classpath refid="jaxb.class.path"/>
</java>
</target>

至于package war, ear 等, 就不举例了. 好好看看ant, 你会豁然开朗.
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / 这里牛人多.请教一个问题,在IBM WSAD 5.1.2 中开发的Web Service,如何才能deploy到WebLogic server ? Is it possible to develop a web service without server engine dependency ?谁有BEA WebLogic IDE 可以借我测一下. 多谢.
    • 开发跟deploy本来就应分开. ant 加shell script, 什么都可以搞定. (window 就更简单了, ant 就搞定了).
      • 理论上应该是这样的.我的问题是plain java code 用WSAD带的Web Serive Tool生成的Web Service, so the generated war file has the dependency of ibm's webservice.jar.
        What's the right way to develop the web service ? I am new to this. Thanks.
        • 正确的方法就是, 当你做build 和 deploy时, 要抛弃使用IDE的想法.
          ant 很强大长(加上unix shell就更不得了: auto build + auto deployment + clustered servers). 她可以generate code (including webservice), package code, stop server, deploycode, copy config file, then start the server. 举例来说, 如果你用JAXB + XSD 来generate code:

          <target name="generateMyXMLObj">
          <java jar="${JAXB_HOME}/lib/jaxb-xjc.jar" fork="true" failonerror="true" maxmemory="128m">
          <arg value="-p"/>
          .........
          <arg value="${project.dir}/content/contents.xsd"/>
          ................
          <classpath refid="jaxb.class.path"/>
          </java>
          </target>

          至于package war, ear 等, 就不举例了. 好好看看ant, 你会豁然开朗.
        • WebLogic IDE makes developing web service simple
          The work to write a web service is just like writing a java class.

          For a HelloWorld.java, you just need to add "@WebService" at the class level, and "@WebMethod" on the sayHello() method, the HelloWorld.java will be deployed as a webservice on the server.

          If you want to deploy your web service on a Tomcat, you could use Apache Beehive Project which is similar.
          • 谢谢.但是这样生成的Web Serivce 可能无法在其它的server上运行.聆风说的对
            ,依赖IDE, make easy development but less portability. I am thinking to use Apache Axis, more stuff to learn, sigh. I will test it out on Workshop for WebLogic 9.2 you recommended, thanks a lot !!!
    • You could download a FREE WebLogic IDE
      WebLogic Workshop is the WebLogic IDE supporting web service, including a weblogic server.

      http://www.bea.com/framework.jsp?CNT=index.htm&FP=/content/products/workshop/workshop/
      • Installed. Thanks. Feels the same as WSAD 6, but can not find the server view. I guess I have to using the Admin Console to deploy my web service code.
        • If you right click the web service->run on server
          It will start WebLogic Server, deploy the app onto the server.

          What do you mean by server view? What do you want to see?
          • Thanks, Jim. I finally got it working on the free WebLogic IDE you recommended. Now I got two web services, one works on IBM Websphere, another works on BEA WebLogic. I have to spend some time to do what 聆风suggested.
            When I tried in BEA WebLogic, since my request java object has String[ ], it turned out to be ArrayOf_xsd_string in the generated WSDL, it looks weird but works find while testing under Web Service Explorer. But when I wrote a java test client, it throws org.xml.sax.SAXException: WSWS3047E: Error: Cannot deserialize element xxxx of bean com.xxx.ArrayOf_xsd_string. Looks like it can not deserialize the object which has another object. Any suggestion ?
            • Trying to understan what you want to accomplish
              In Java world, there are three stack of web service implementation:
              1. Annotated java--> beehive code gen-->Apache Beehive Runtime-->Tomcat server;
              2. Annotated java--> wsad code gen-->Websphere runtime-->Websphere App Server;
              3. Annotated java--> wlw code gen--> Weblogic runtime--> Weblogic App Server.

              Because the web containers are different, each stack generates runtime code differently.
              The generated code of each stack is designed to run on the specific web container.

              I know "beehive code gen" could be deployed on WebLogic server.

              Not sure why you want to have wsad code gen running on WebLogic, or vice versa.