Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Soap WSO2集成_Soap_Wsdl - Fatal编程技术网

Soap WSO2集成

Soap WSO2集成,soap,wsdl,Soap,Wsdl,我正在尝试将WSO2与Mule集成。我从org\apache\cxf\ws\discovery\WSDL文件夹下的cxf-services-ws-discovery-api.jar中获取了WSDL,并将其放入SOAP UI中,然后点击本地主机端口9443上的URL,它工作正常。然而,当我将WSDL添加到我的Mule项目中,并使用cxf codegen插件生成客户端存根并运行它时,我得到以下错误: ERROR 2014-10-08 16:25:31,545 [main] com.deic.Regi

我正在尝试将WSO2与Mule集成。我从org\apache\cxf\ws\discovery\WSDL文件夹下的cxf-services-ws-discovery-api.jar中获取了WSDL,并将其放入SOAP UI中,然后点击本地主机端口9443上的URL,它工作正常。然而,当我将WSDL添加到我的Mule项目中,并使用cxf codegen插件生成客户端存根并运行它时,我得到以下错误:

ERROR 2014-10-08 16:25:31,545 [main] com.deic.RegistryLifecycle: Trace: 
javax.xml.ws.WebServiceException: @Action and @WebMethod(action="" does not match on operation    probeOp
at com.sun.xml.ws.model.JavaMethodImpl.setWsaActions(JavaMethodImpl.java:124)
at com.sun.xml.ws.model.JavaMethodImpl.<init>(JavaMethodImpl.java:102)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:664)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:506)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:337)
at com.sun.xml.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:102)
at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:75)
at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)
at com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:128)
at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:803)
at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:810)
at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:786)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:407)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:384)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:366)
at javax.xml.ws.Service.getPort(Unknown Source)
at org.oasis_open.docs.ws_dd.ns.discovery._2009._01.Discovery.getDiscoveryProxy(Discovery.java:79)
at com.deic.RegistryManager.getDiscoveryProxyPort(RegistryManager.java:29)
at com.deic.RegistryManager.getEndoint(RegistryManager.java:35)
at com.deic.RegistryLifecycle.start(RegistryLifecycle.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237)
at org.mule.lifecycle.RegistryLifecycleManager$RegistryLifecycleCallback.onTransition(RegistryLifecycleManager.java:273)
at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:152)
at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:123)
at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:76)
at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:136)
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:91)
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:87)
at org.mule.lifecycle.MuleContextLifecycleManager.invokePhase(MuleContextLifecycleManager.java:69)
at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:61)
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:278)
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:123)
at org.mule.module.launcher.artifact.ArtifactWrapper$4.execute(ArtifactWrapper.java:98)
at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:129)
at org.mule.module.launcher.artifact.ArtifactWrapper.start(ArtifactWrapper.java:93)
at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:26)
at org.mule.module.launcher.DefaultArchiveDeployer.guardedDeploy(DefaultArchiveDeployer.java:310)
at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:330)
at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedApp(DefaultArchiveDeployer.java:297)
at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedArtifact(DefaultArchiveDeployer.java:108)
at org.mule.module.launcher.DeploymentDirectoryWatcher.deployExplodedApps(DeploymentDirectoryWatcher.java:290)
at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:151)
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:150)
}

我不知道为什么soapui与WSDL没有问题,但是客户机存根有问题。我尝试使用wireshark,但不确定如何配置HTTPS。我搜索了又搜索,但无法找出类的生成出了什么问题,显然这与生成的@Action和@WebMethod有关,但我不确定我必须做什么来修复WSDL以使其正常工作

这里是WSDL

<?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions
    targetNamespace="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01"
    xmlns:tns="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01"
    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/">
  <wsdl:types>
    <xs:schema>
      <xs:import
          namespace="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01"
          schemaLocation="wsdd-discovery-1.1-schema-os.xsd" />
    </xs:schema>
  </wsdl:types>

  <wsdl:message name="HelloMessage" >
    <wsdl:part name="parameters" element="tns:Hello" />
  </wsdl:message>

  <wsdl:message name="ByeMessage" >
    <wsdl:part name="parameters" element="tns:Bye" />
  </wsdl:message>

  <wsdl:message name="ProbeMessage" >
    <wsdl:part name="parameters" element="tns:Probe" />
  </wsdl:message>

  <wsdl:message name="ProbeMatchMessage" >
    <wsdl:part name="parameters" element="tns:ProbeMatches" />
  </wsdl:message>

  <wsdl:message name="ResolveMessage" >
    <wsdl:part name="parameters" element="tns:Resolve" />
  </wsdl:message>

  <wsdl:message name="ResolveMatchMessage" >
    <wsdl:part name="parameters" element="tns:ResolveMatches" />
  </wsdl:message>

  <wsdl:portType name="DiscoveryProxy">
    <wsdl:operation name="HelloOp" >
      <wsdl:input message="tns:HelloMessage"
      wsaw:Action
      ="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Hello"
      />
    </wsdl:operation>
    <wsdl:operation name="ByeOp" >
      <wsdl:input message="tns:ByeMessage"
      wsaw:Action
      ="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Bye"
      />
    </wsdl:operation>
    <wsdl:operation name="ProbeOp" >
      <wsdl:input message="tns:ProbeMessage"
      wsaw:Action
      ="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe"
      />
      <wsdl:output message="tns:ProbeMatchMessage"
      wsaw:Action
      ="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeMatches"
      />
    </wsdl:operation>
    <wsdl:operation name="ResolveOp" >
      <wsdl:input message="tns:ResolveMessage"
      wsaw:Action
      ="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Resolve"
      />
      <wsdl:output message="tns:ResolveMatchMessage"
      wsaw:Action
      ="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ResolveMatches"
      />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="DiscoveryProxy" type="tns:DiscoveryProxy">
    <soap:binding style="document" 
        transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="HelloOp">
        <soap:operation
            soapAction="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/HelloOp" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
    </wsdl:operation>
    <wsdl:operation name="ByeOp">
        <soap:operation
            soapAction="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ByeOp" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
    </wsdl:operation>
    <wsdl:operation name="ProbeOp">
        <soap:operation
            soapAction="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeOp" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ResolveOp">
        <soap:operation
            soapAction="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ResolveOp" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

    <wsdl:service name="Discovery">
        <wsdl:port name="DiscoveryUDP" binding="tns:DiscoveryProxy">
            <soap:address location="soap.udp://:9443"/>
        </wsdl:port>
        <wsdl:port name="DiscoveryProxy" binding="tns:DiscoveryProxy">
            <soap:address location="${discovery_proxy_url}"/>
        </wsdl:port>
    </wsdl:service> 
</wsdl:definitions>

我很感激你能给我的任何帮助或建议。谢谢

我发现了这个问题,@Action(input=“url”)需要与@WebMethod(Action=“url”)匹配,似乎apache libs中的wsdl将它们作为不同的url值来使用。

我之所以来到这里,是因为我遇到了一个类似的问题,即从wsdl创建一个存根来描述我正在集成到Java应用程序中的Web服务,你的自动回答帮助我指出了问题所在

要解决此问题,您必须手动编辑WSDL,然后重新创建客户机存根

对于每个操作,使wsamAction属性的URL与soapAction属性的URL相同:

<operation name="operationName">
      <input message="xxx" wsam:Action="http://your.name.space/operationName">
    </input>
.
.
.
    </operation>

.
.
.

<operation name="operationName">
      <soap:operation soapAction="http://your.name.space/operationName" />
 .
 .
 .
</operation>

.
.
.
然后重新创建客户端存根。它现在应该可以无缝工作了

希望这有帮助

Discovery service = new Discovery();
DiscoveryProxy port = service.getDiscoveryProxy();
<operation name="operationName">
      <input message="xxx" wsam:Action="http://your.name.space/operationName">
    </input>
.
.
.
    </operation>
<operation name="operationName">
      <soap:operation soapAction="http://your.name.space/operationName" />
 .
 .
 .
</operation>