不知道大家有没有看过这么一本书《BEA WebLogic Workshop--构建下一代Web services》,
本人初步浏览一下,里面讲的开发webservices的方式似乎都是用jws的,不知道一般比较标准和通用的方式是什么?

解决方案 »

  1.   

    jws可能是两种文件之一:
    java web service(通过更改源文件后缀名部署)
    java web start(通过http下载执行的java应用程序)具体是哪一种,可以查看weblogic的配置文件,看看jws后缀名被映射给了谁
      

  2.   

    是我自己表达不清楚还是楼上理解错误
    我并不是问什么是JWS文件,拜托请看看清楚再回答好不好
      

  3.   

    没用过workshop
    webservice生成的*.jws文件跟一般的*.java webservice有什么异同?
    感觉没有什么差别如果用weblogic做应用服务器,用什么方式开发web service比较好?
    workshop
      

  4.   

    JWS (Java Web Service) Files - Instant Deployment
    OK, here's step 1 : copy the above .java file into your webapp directory, and rename it "Calculator.jws". So you might do something like this: 
    % copy Calculator.java <your-webapp-root>/axis/Calculator.jws
    Now for step 2... hm, wait a minute. You're done! You should now be able to access the service at the following URL (assuming your Axis web application is on port 8080): 
    http://localhost:8080/axis/Calculator.jws Axis automatically locates the file, compiles the class, and converts SOAP calls correctly into Java invocations of your service class. Try it out - there's a calculator client in samples/userguide/example2/CalcClient.java, which you can use like this: % java samples.userguide.example2.CalcClient -p8080 add 2 5
    Got result : 7
    % java samples.userguide.example2.CalcClient -p8080 subtract 10 9
    Got result : 1
    %
    (note that you may need to replace the "-p8080" with whatever port your J2EE server is running on) 
    Custom Deployment - Introducing WSDD
    JWS files are great quick ways to get your classes out there as Web Services, but they're not always the best choice. For one thing, you need the source code - there might be times when you want to expose a pre-existing class on your system without source. Also, the amount of configuration you can do as to how the service gets accessed is pretty limited - you can't specify custom type mappings, or control which Handlers get invoked when people are using your service. (note for the future : the Axis team, and the Java SOAP community at large, are thinking about ways to be able to embed this sort of metadata into your source files if desired - stay tuned!) 
    Deploying via descriptors
    To really use the flexibility available to you in Axis, you should get familiar with the Axis Web Service Deployment Descriptor (WSDD) format. A deployment descriptor contains a bunch of things you want to "deploy" into Axis - i.e. make available to the Axis engine. The most common thing to deploy is a Web Service, so let's start by taking a look at a deployment descriptor for a basic service (this file is samples/userguide/example3/deploy.wsdd):<deployment xmlns="http://xml.apache.org/axis/wsdd/"
                xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
     <service name="MyService" provider="java:RPC">
      <parameter name="className" value="samples.userguide.example3.MyService"/>
      <parameter name="allowedMethods" value="*"/>
     </service>
    </deployment>
      

  5.   

    多谢楼上各位的答复!!
    我现在所要做的任务是:调用第3方提供的services,可是因为提供方还没完成server端的services,所以只给我接口说明,那么我是不是要先根据这个接口说明先自己建立services的模型,然后调用它呢?
    有没有什么方便的做法?能不能给几个client调用webservice的例子,
    着急着用啊,合适者马上放分,分不够可再加