1

WSO2 WS-发现集成

我们正在尝试将 WS-Discovery 与 Carbon 产品 WSO2 Governance Registry 和 WSO2 ESB 集成,通过 Spring 在 Tomcat 上运行配置 Apache CXF Web 服务堆栈,向 WSO2 上的 Discovery Proxy (localhost:9443/services/DiscoveryProxy) 发送问候消息格雷格。

因此,我们将 cxf-services-ws-discovery-service.jar 和 cxf-services-ws-discovery-api.jar 添加到 Tomcat 的类路径中。此外,我们将 spring bus 属性 org.apache.cxf.service.ws-discovery.address 设置为 WSO2 Greg 上的 WS-Discovery 代理的 URL 地址,以在托管模式下运行 WS-Discovery。通过运行 Tomcat 和 WSO2 Greg,wso2Carbon.log (WSO2 Greg) 中记录了以下错误消息...

TID: [0] [Greg] [2013-07-15 11:45:03,411]  INFO {org.wso2.carbon.discovery.proxy.DiscoveryProxy} -  Service Discovery Failed. Retrying after 10s. {org.wso2.carbon.discovery.proxy.DiscoveryProxy}
TID: [0] [Greg] [2013-07-15 11:45:03,458] ERROR {org.wso2.carbon.governance.api.common.GovernanceArtifactManager} -  Failed to add artifact: artifact id: urn:uuid:003aa9d9-2c9f-4e0b-8415-c99632226ee3, path: /trunk/services/org/oasis_open/docs/ws_dd/ns/discovery/_2009/_01/DiscoveredService_1373881503442. An exception occurred while executing handler chain. String index out of range: -1 {org.wso2.carbon.governance.api.common.GovernanceArtifactManager}
org.wso2.carbon.registry.core.exceptions.RegistryException: An exception occurred while executing handler chain. String index out of range: -1
                at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.put(HandlerManager.java:2525)
                at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.put(HandlerLifecycleManager.java:1005)
                at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.put(EmbeddedRegistry.java:697)
                at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.put(CacheBackedRegistry.java:465)
                at org.wso2.carbon.registry.core.session.UserRegistry.put(UserRegistry.java:658)
                at org.wso2.carbon.governance.api.common.GovernanceArtifactManager.addGovernanceArtifact(GovernanceArtifactManager.java:155)
                at org.wso2.carbon.governance.api.services.ServiceManager.addService(ServiceManager.java:116)
                at org.wso2.carbon.discovery.util.DiscoveryServiceUtils.addService(DiscoveryServiceUtils.java:152)
                at org.wso2.carbon.discovery.proxy.DiscoveryProxy$1.run(DiscoveryProxy.java:89)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
                at java.util.concurrent.FutureTask.run(FutureTask.java:166)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
                at java.lang.String.substring(String.java:1911)
                at org.wso2.carbon.registry.extensions.handlers.utils.EndpointUtils.deriveEndpointFromUrl(EndpointUtils.java:674)
                at org.wso2.carbon.registry.extensions.handlers.utils.EndpointUtils.saveEndpoint(EndpointUtils.java:483)
                at org.wso2.carbon.registry.extensions.handlers.utils.EndpointUtils.saveEndpointsFromServices(EndpointUtils.java:280)
                at org.wso2.carbon.registry.extensions.handlers.ServiceMediaTypeHandler.put(ServiceMediaTypeHandler.java:353)
                at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.put(HandlerManager.java:2503)
                ... 14 more

我们通过阅读 WSO2 产品文档和搜索多个论坛、博客等尝试了几个小时来解决这个问题。不幸的是,我们找不到解决方案。

备注:WS-Discovery 与 WSO2 应用程序服务器而不是 Tomcat 的集成工作得很好。但是,当使用 WSO2 ESB 作为发现客户端从 WSO2 Greg 发现服务时,从 WSO2 ESB 上发现的服务创建代理服务的向导在创建代理后缺少 publishWSDL xml 标记。此标签必须手动添加。有没有办法在不另外编辑的情况下完成这项工作?

我们将不胜感激。

提前致谢

4

1 回答 1

0

感谢您的快速答复

我们截获了通过 Tomcat 和 WSO2 应用服务器发送到 WSO2 GReg 的 hello 请求。为此,我们使用了soapUI 模拟服务。肥皂信封的消息请求如下所示...

雄猫:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:tns="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01">
<soap:Header>
  <wsa:Action>http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Hello</wsa:Action>
  <wsa:MessageID>urn:uuid:e01ce7dc-53c0-4b36-b7d5-0e84e3bd6a5d</wsa:MessageID>
  <wsa:To>https://localhost:9443/services/DiscoveryProxy</wsa:To>
  <wsa:ReplyTo>
    <wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
  </wsa:ReplyTo>
</soap:Header>
<soap:Body>
<ns2:Hello xmlns="http://www.w3.org/2005/08/addressing" xmlns:ns2="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01">
     <EndpointReference>
        <Address>urn:uuid:be46c1fc-1646-4bcc-8715-1aed4040fdd5</Address>
        <ReferenceParameters/>
     </EndpointReference>
     <ns2:Types xmlns:ns3="http://user.service.scheck.server.tia/">ns3:IZ3UserService</ns2:Types>
     <ns2:Scopes/>
     <ns2:XAddrs>/userService</ns2:XAddrs>
     <ns2:MetadataVersion>1</ns2:MetadataVersion>
  </ns2:Hello>
</soap:Body>
</soap:Envelope>

WSO2 应用服务器:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">              
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <mns:serviceName xmlns:mns="http://www.wso2.org/ws/discovery">echo</mns:serviceName>
  <mns:wsdlURI xmlns:mns="http://www.wso2.org/ws/discovery">http://10.200.2.114:9764/services/echo?wsdl</mns:wsdlURI>
  <wsa:To>https://localhost:9443/services/DiscoveryProxy</wsa:To>
  <wsa:ReplyTo>
     <wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
  </wsa:ReplyTo>
  <wsa:MessageID>urn:uuid:d21e108b-34a2-4313-8b12-a22015567a51</wsa:MessageID>
  <wsa:Action>http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Hello</wsa:Action>
</soapenv:Header>
<soapenv:Body>
  <wsd:Hello xmlns:wsd="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01">
     <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <wsa:Address>urn:uuid:439a1cd5-fb36-40e2-a54e-e0cb7f3409e4</wsa:Address>
     </wsa:EndpointReference>
     <wsd:Types xmlns:axis2ns1="http://echo.services.core.carbon.wso2.org">axis2ns1:echoPortType</wsd:Types>
     <wsd:Scopes>http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/DefaultScope</wsd:Scopes>
     <wsd:XAddrs>https://10.200.2.114:9444/services/echo http://10.200.2.114:9764/services/echo</wsd:XAddrs>
     <wsd:MetadataVersion>1</wsd:MetadataVersion>
  </wsd:Hello>
  </soapenv:Body>
  </soapenv:Envelope>

比较两个消息请求,我们注意到缺少一些标签,例如 serviceName、wsdlURI 和我们认为最重要的 XAddrs。通过手动将 XAddrs 添加到soapUI 请求中,我们能够在 WSO2 GReg 上注册 cxf 服务。也许您可以给我们一个建议,如何通过 spring 配置 cxf 或通过注释我们的 Web 服务实现来实现这一点。

再次感谢..这对我们很有帮助!!

于 2013-07-18T08:57:16.300 回答