新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论Java, J2SE, J2ME, J2EE, 以及Eclipse, NetBeans, JBuilder等Java开发环境,还有JSP, JavaServlet, JavaBean, EJB以及struts, hibernate, spring, webwork2, Java 3D, JOGL等相关技术。
    [返回] 中文XML论坛 - 专业的XML技术讨论区计算机技术与应用『 Java/Eclipse 』 → 用JAX-RPC开发Web Services    配置文件 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 5667 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 用JAX-RPC开发Web Services    配置文件 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     wshuyuan 美女呀,离线,快来找我吧!
      
      
      等级:大一新生
      文章:6
      积分:89
      门派:XML.ORG.CN
      注册:2008/5/19

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给wshuyuan发送一个短消息 把wshuyuan加入好友 查看wshuyuan的个人资料 搜索wshuyuan在『 Java/Eclipse 』的所有贴子 引用回复这个贴子 回复这个贴子 查看wshuyuan的博客楼主
    发贴心情 用JAX-RPC开发Web Services    配置文件

    Configuration File
    The xrpcc tool reads an XML configuration file that specifies the files to be generated. The configuration file has two different formats, depending on whether you are starting with RMI interfaces or a WSDL document. The file can have one format or the other, but not both. The file's <configuration> element must have either one <service> element or one <wsdl> element.
    Xrpcc工具读XML配置文件,XML配置文件指出产生的文件。配置文件有两种格式,这两种格式取决你用RMI接口还是WSDL文件开始。文件可以有一个或另一个格式,但不能两个都有。文件的<configuration>元素必须有<service>元素或<wsdl>元素。

    Starting With RMI Interfaces
    运行RMI接口
    If you are starting with RMI interfaces, the tool can generate stubs, ties, a server configuration file, and a WSDL document. With RMI interfaces, the tool's configuration file must have the following form:
    如果你运行RMI接口,工具会产生stubs,ties,服务配置文件和WSDL文件。用RMI接口,工具产生的配置文件必须有下列形式:
    <?xml version="1.0" encoding="UTF-8"?>  
        <configuration
         xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">   
            <service name="[1]"                 服务名
                     packageName="[2]">        包名
                     targetNamespace="[3]"     目标命名空间
                     typeNamespace="[4]">         类型命名空间
                <interface name="[5]"             接口名
                           servantName="[6]"      服务名
                           soapAction="[7]"    
                           soapActionBase="[8]">      
                    <handlerChains>
                      [9]
                    </handlerChains>
                </interface>         
                <typeMappingRegistry>        
                  [10]       
                </typeMappingRegistry>       
                <handlerChains>
                  [9]
                </handlerChains>
                <namespaceMappingRegistry>
                  [11]
                </namespaceMappingRegistry>
            </service>         
        </configuration>

    The integers in the preceding syntax indicate the following:
    前面的语法指示为:
    1. Service name     服务名
    2. Package name for the generated classes (for example, the service interface that extends javax.xml.rpc.Service)
          被创建的类的包名(如:扩展javax.xml.rpc.Service的服务接口。)
    3. Target namespace for the generated WSDL document
          产生的WSDL文件的目标命名空间。
    4. Target namespace for the schema portion of the generated WSDL document
          产生的WSDL文件的schema部分的目标命名空间。
    5. Fully qualified name of an interface
          接口全名。
    6. Fully qualified name of a servant class that implements the interface
         执行接口的服务类全名。
    7. Optional: string to be used as the SOAPAction for all operations in the corresponding port
    可选项:相应端口的SOAP行为所有操作的字符串。
    8. Optional: string to be used as a prefix for the SOAPAction strings for the operations in the corresponding port
          可选项:相应端口SOAP行为操作的字符串前缀。
    9. Optional: handler chain information*
          可选项:处理程序链接信息。
    10. Optional: type mapping information*
          可选项:类型映射信息。
    11. Optional: namespace mapping information*
          可选项:名字空间映射信息。
    *This feature is for advanced users. Please refer to the XML schema in the jax-rpc-ri-config.xsd file, which resides in the directory <JWSDP_HOME>/docs/tutorial/examples/jaxrpc/common.
    此功能给高级功能用户用。请看jax-rpc-ri-config.xsd文件里的XML schema。XML schema在目录<JWSDP_HOME>/docs/tutorial/examples/jaxrpc/common里。
    In this type of configuration file, the <configuration> element must have just one <service> element, which may contain multiple <interface> elements.
    在这种配置文件里,<configuration>元素必须有一个<service>元素,一个<service>元素里有多个<interface>元素。
    The JAX-RPC Specification discusses the classes of the javax.xml.rpc.holders package. These classes can be used in a WSDL document, but not in an RMI interface.
    JAX-RPC规定讨论javax.xml.rpc.holders包里的类。这些类被用在WSDL文件里,但不在RMI接口里。
    SOAPAction Elements
    SOAPAction 元素
    If you are an advanced user you might be interested in the following information about SOAPAction elements: If the soapAction attribute is specified, all the operations in the generated port will use that string as the SOAPAction.
    如果你是高级用户,你可能对下面SOAPAction 元素信息感兴趣:如果SOAPAction属性被规定,各端口的操作将用属性字符串作为SOAPAction。
    If the soapActionBase attribute is specified, its value will be used as a prefix for the generated SOAPAction strings. The suffix will be a unique string; in the current implementation it is the operation name.
    如果soapActionBase属性被指定,它们的值被作为产生soapAction字符串的前缀。前缀是独一无二的字符串,在当前执行前缀是操作名。
    For example, if soapActionBase is set to http://hello/ and the port has two operations, opA and opB, their SOAPAction strings will be http://hello/opA and http://hello/opB respectively. If neither soapAction nor soapActionBase are specified, the SOAPAction for all operations will be the empty string. Notice that in this release, JAX-RPC does not rely on the SOAPAction HTTP header for dispatching.
    例如,如果soapActionBase设置为:http://hello/,端口有两个操作:opA和opB。他们的SOAPAction字符串将各自为:http://hello/opA和http://hello/opB。如果soapAction或soapActionBase都没被指定,SOAPAction所有操作将是空字符串。注意:这个版本JAX-RPC发送不依赖SOAPAction HTTP头。
    Starting With a WSDL Document
    用WSDL文件
    If you are starting with a WSDL document, the tool can generate stubs, ties, a server configuration file, and RMI interfaces. The tool's configuration file must have the following form:
    如果你用WSDL文件,工具会产生stubs,ties,一个服务器配置文件,
    <?xml version="1.0" encoding="UTF-8"?>  
        <configuration
         xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">   
            <wsdl location="[1]"        
                  packageName="[2]">        
                <typeMappingRegistry>        类型映射注册表
                  [3]       
                </typeMappingRegistry>       
                <handlerChains>          处理链
                  [4]
                </handlerChains>
                <namespaceMappingRegistry>       命名空间映射注册表
                  [5]
                </namespaceMappingRegistry>
            </wsdl>         
        </configuration>

    The integers in the preceding syntax indicate the following:
    前面的语法指示为:
    1. URL pointing to a WSDL document
    URL指向一个WSDL文档。
    2. Fully qualified name of the package for the generated classes and interfaces
          所产生类和接口的包的全名。
    3. Optional: type mapping information*
          可选项:类型映射信息
    4. Optional: handler chain information*
          可选项:处理程序链信息。
    5. Optional: namespace mapping information*
          可选项:命名空间映射信息。
    *This feature is for advanced users.这个功能是给高级用户的。
    In a tool configuration file of this type, the <configuration> element must have just one <wsdl> element.
    在这种类型的工具配置文件,<configuration>元素必须有一个<wsdl>元素。
    Server Configuration File
    服务器配置文件
    The xrpcc tool also generates a server configuration file for Tomcat. The name of the file is specified by the <init-param> element of the web.xml file, which is the deployment descriptor for a Web application that's packaged in a WAR file.
    Xrpcc工具为Tomcat产生一个服务器配置文件。文件名被web.xml文件的<init-param>元素指定。这个服务器配置文件是Web应用程序的部署描述文件,放在WAR文件包里。
    For example, the web.xml file might contain the following <init-param> element:
    <init-param>
        <param-name>configuration.file</param-name>
        <param-value>/WEB-INF/config.properties</param-value>
    </init-param>

    Here's an example of a server configuration file that is generated by the xrpcc tool:
    有一个服务器配置文件的例子,由xrpcc工具产生。
    port0.tie=hello.HelloIF_Tie
    port0.servant=hello.HelloImpl
    port0.name=HelloIF
    port0.wsdl.targetNamespace=http://hello.org/wsdl
    port0.wsdl.serviceName=HelloWorld
    port0.wsdl.portName=HelloIFPort
    portcount=1

    This server configuration file should be copied to the WEB-INF/config.properties file in the Tomcat installation.
    在安装Tomcat时服务器配置文件将被复制到WEB-INF/config.properties文件里。


    [此贴子已经被作者于2008-5-20 15:56:51编辑过]

       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/5/19 22:39:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 Java/Eclipse 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/3 2:51:37

    本主题贴数1,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    4,166.016ms