2011-08-04 125 views
1

我有两个不同的web服务(每个从不同的wsdl生成)具有相同的名称“getConfiguration”,我试图放在同一个.aar文件中。axis2:两个不同的web服务共享相同的名称

在中声明。我已经改变了第二的名称为“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> 

的服务/ 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://主机/路径/服务/ getConfiguration WSDL)轴呈现给我从getConfiguration服务,这看起来很不错的WSDL。 但是,如果我访问getConfiguration2 WSDL URL(HTTP://主机/路径/服务/ 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

感谢

回答

1

这是不够的,重命名WSDL文件,你还需要编辑WSDL和改变这样的服务名称:

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