Java 在 wsdl 文件中找不到 wsdl 绑定

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23490941/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 23:22:44  来源:igfitidea点击:

wsdl binding not found in wsdl file

javasoapwsdl

提问by GregD

I've got the following wsdl file:

我有以下 wsdl 文件:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.minfin.fgov.be/bbf/extern/myMinfin/"   xmlns="http://www.minfin.fgov.be/bbf/extern/myMinfin" xmlns:pols="http://www.minfin.fgov.be/bbf/extern/myMinfin/policies"

xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<wsdl:types>
<xsd:schema targetNamespace="http://www.minfin.fgov.be/bbf/extern/myMinfin/">
  <xsd:import namespace="http://www.minfin.fgov.be/bbf/extern/myMinfin/policies" schemaLocation="getPolicies.xsd" />
</xsd:schema>
</wsdl:types>

<wsdl:message name="policiesForPersonRequest">
  <wsdl:part name="policiesForPerson" element="pols:policiesForPersonRequest" />
</wsdl:message>

<wsdl:message name="policiesOutput">
  <wsdl:part name="policies" element="pols:policiesResponse" />
</wsdl:message>

<wsdl:portType name="MyMinfinService">
  <wsdl:operation name="getPoliciesForPerson">
    <wsdl:input message="policiesForPersonRequest" />
    <wsdl:output message="policiesOutput" />
  </wsdl:operation>
</wsdl:portType>

<wsdl:binding name="MyMinfinServiceHTTPBinding" type="MyMinfinService">
  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
  <wsdl:operation name="getPoliciesForPerson">
    <wsdlsoap:operation soapAction="" />
    <wsdl:input>
      <wsdlsoap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
      <wsdlsoap:body use="literal" />
    </wsdl:output>
  </wsdl:operation>
</wsdl:binding>

<wsdl:service name="MyMinfinServicePorts">
  <wsdl:port binding="MyMinfinServiceHTTPBinding" name="MyMinfinService">
    <wsdlsoap:address location="http://localhost:7001/bbf/MyMinfinService" />
  </wsdl:port>
</wsdl:service>

</wsdl:definitions>

The xsd behind it:

它背后的xsd:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns="http://www.minfin.fgov.be/bbf/extern/myMinfin/policies" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.minfin.fgov.be/bbf/extern/myMinfin/policies"
elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:element name="policiesForPersonRequest">
<xs:annotation>
  <xs:documentation>The request from where all available policies must be returned.</xs:documentation>
</xs:annotation>
<xs:complexType>
  <xs:sequence>
    <xs:element name="FI_enterpriseNumber">
      <xs:annotation>
        <xs:documentation>The KBO / enterprise number of the financial institution.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:length value="10" />
          <xs:pattern value="[0-9]{10}" />
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="RRNOrBIS">
      <xs:annotation>
        <xs:documentation>The national number or bis number.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:length value="11" />
          <xs:pattern value="[0-9]{11}" />
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
  </xs:sequence>
</xs:complexType>
</xs:element>



<xs:element name="policiesResponse">
<xs:annotation>
  <xs:documentation>Available policies.</xs:documentation>
</xs:annotation>
<xs:complexType>
  <xs:sequence>
    <xs:element name="policy" maxOccurs="999">
      <xs:annotation>
        <xs:documentation>A policy.</xs:documentation>
      </xs:annotation>
      <xs:complexType>
        <xs:sequence>
          <xs:element name="policyNumber" >
            <xs:annotation>
              <xs:documentation>Insurance policy number.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:length value="255" />
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="policyName" type="xs:string">
            <xs:annotation>
              <xs:documentation>The name of the policy.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  </xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

I'm getting the following error:

我收到以下错误:

wsdl:binding "{http://www.minfin.fgov.be/bbf/extern/myMinfin}MyMinfinServiceHTTPBinding" not found in the wsdl: file:/C:/BBF2/FUP_04_Implementation/FUP_00_Source/Project_Folder/BBF_EXTERNAL_CONTRACTS/src/main/resources/myMinfin/myMinfin.wsdl

what could be wrong?

有什么问题?

采纳答案by GregD

Love the error.. Problem is fixed. replaced

喜欢错误.. 问题已解决。取代

xmlns="http://www.minfin.fgov.be/bbf/extern/myMinfin" 

with

xmlns="http://www.minfin.fgov.be/bbf/extern/myMinfin/" 

took me 3hours to find!

我花了3个小时才找到!

回答by Atul

javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method XXXX.
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:125)
    at com.sun.proxy.$Proxy82.XXXXX(Unknown Source)

If this error occurred then add annotation Webservice to your client side interface which is already developed on service side. I faced this issue; I have configured Spring with CXF. I have already developed the service and calling it from client.

如果发生此错误,请将注释 Webservice 添加到已在服务端开发的客户端界面中。我遇到了这个问题;我已经用 CXF 配置了 Spring。我已经开发了服务并从客户端调用它。

Hope this will help.

希望这会有所帮助。