手动组装 WebLogic Web 服务

Assembling a WebLogic Web Service Manually

我通过简单地创建具有以下内容的 "web-services.xml" 来实现此 guide 中描述的 Web 服务(当然我创建 'com.example.WorkFlowEntry' 处理程序 class ):

<web-services>
<handler-chains>
   <handler-chain name="enterWorkflowChain">
       <handler class-name="com.example.WorkFlowEntry">
           <init-params>
               <init-param name="workflow-eng-jndi-name" 
                           value="workflow.entry" />
            </init-params>
       </handler>
   </handler-chain>
</handler-chains>
<web-service targetNamespace="http://example.com" 
              name="myworkflow" uri="myWorkflowService">
    <operations xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
       <operation name="enterWorkflow" 
                  handler-chain="enterWorkflowChain"
                  invocation-style="one-way" />
    </operations>
</web-service>

我的问题是,当我在 weblogic 11g 中部署 EAR 文件时,'' web 服务部署成功,我可以访问该 web 服务的 WSDL。当我在 weblogic 12c 中部署相同的 EAR 时,它已成功部署,但无法访问 WSDL,我收到 404!

Manually assembling weblogic web service is valid if you are using the Webservice 8.1 environment. The last Weblogic version for which this approach can be used is Weblogic 12.1.1, from Weblogic 12.1.2 release, the 8.1 WebLogic Web services run time has been removed.

这意味着使用 'web-services.xml' 构建您的 web 服务在 weblogic 12.1.1 版本之前有效。对于较新的版本,您必须按照 link 中提到的那样升级您的 Web 服务实现,这主要通过(将 10.x WebLogic Web 服务(JAX-WS 或 JAX-RPC)升级到 12.1.x). 但此解决方案可能会影响当前 运行 个客户

就我而言,我不能要求客户更改他们的代码。所以我针对这种情况的解决方法是采用当前的 WSDL 并通过 ant 手动生成 Web 服务,如 link 中所述,它描述了使用 wsdlc Ant 任务生成以下工件:

  • 实现所述 Web 服务的 JWS 服务端点接口 (SEI) 通过 WSDL 文件。

  • JWS 实现文件,其中包含部分(已删除的)实现 生成的 JWS SEI。此文件必须由开发者自定义。

  • JAXB 数据绑定工件。

  • 生成的 JWS SEI 的可选 Javadoc。