簡體   English   中英

axis2:兩個共享相同名稱的不同Web服務

[英]axis2: two different webservices sharing the same name

我有兩個具有相同名稱“ getConfiguration”的不同Web服務(每個Web服務都是從不同的wsdl生成的),我試圖將它們放置在相同的.aar文件中。

在services.xml中,我已將第二個名稱更改為“ getConfiguration2”,因此我的services.xml文件如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<serviceGroup>
<service name="getConfiguration">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="wi.xpto.webservice.GetConfigurationMessageReceiverInOut"/>
        </messageReceivers>
        <parameter name="ServiceClass">wi.xpto.webservice.GetConfigurationSkeleton</parameter>
        <parameter name="useOriginalwsdl">true</parameter>
        <parameter name="modifyUserWSDLPortAddress">false</parameter>
        <operation name="getConfiguration" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://6.xpto.com/v/i/wsd/getConfiguration">
            <actionMapping>v_i_wsd_getConfiguration_Binder_getConfiguration</actionMapping>
            <outputActionMapping>http://6.xpto.com/v/i/wsd/getConfiguration/getConfiguration_PortType/getConfigurationResponse</outputActionMapping>
        </operation>
    </service>  

    <service name="getConfiguration2">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="wi.xpto.webservice2.GetConfigurationMessageReceiverInOut"/>
        </messageReceivers>
        <parameter name="ServiceClass">wi.xpto.webservice2.GetConfigurationSkeleton</parameter>
        <parameter name="useOriginalwsdl">true</parameter>
        <parameter name="modifyUserWSDLPortAddress">false</parameter>
        <operation name="getConfiguration" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://7.xpto.com/VResouce_I/wsd/getConfiguration">
            <actionMapping>VResouce_I_wsd_getConfiguration_Binder_getConfiguration</actionMapping>
            <outputActionMapping>http://7.xpto.com/VResouce_I/wsd/getConfiguration/getConfiguration_PortType/getConfigurationResponse</outputActionMapping>
        </operation>
    </service>

</serviceGroup>

services / listServices提供了兩個Web服務:

-> getConfiguration
Service EPR : http://host/path/services/getConfiguration
Service Description : getConfiguration
Service Status : Active
Available Operations
getConfiguration

-> getConfiguration2
Service EPR : http://host/path/services/getConfiguration2
Service Description : getConfiguration2
Service Status : Active
Available Operations
getConfiguration

當我訪問getConfiguration wsdl url(http:// host / path / services / getConfiguration?wsdl)時,該軸向我展示了來自getConfiguration服務的wsdl,看起來不錯。 但是,如果我訪問getConfiguration2 wsdl url(http:// host / path / services / getConfiguration2?wsdl),則會出現以下錯誤:

<error>
  <description>Unable to generate WSDL 1.1 for this service</description>
  <reason>If you wish Axis2 to automatically generate the WSDL 1.1, then please +set useOriginalwsdl as false in your services.xml</reason>
</error>

aar文件包含兩個wsdl(第二個也重命名為getConfiguration2):

META-INF/getconfiguration.wsdl
META-INF/getConfiguration2.wsdl

知道為什么以及如何解決嗎? 如果我在services.xml文件中評論其中一個,則另一個工作正常。 我的設置:Linux + Java 1.6 + Tomcat +軸2

謝謝

僅重命名wsdl文件是不夠的,您還需要編輯wsdl並更改服務名稱,如下所示:

<wsdl:service name="getConfiguration2">
      <wsdl:port name="..." binding="tns:...">
         <soap:address location="http://hostname:port/path/..."/>
      </wsdl:port>
</wsdl:service>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM