0

当我尝试将 PeopleSoft WSDL 作为服务参考导入时,Visual Studio 2010 和 2012 都会出现不透明错误。

我右键单击Service References,选择Add Service Reference,将 URL 粘贴到Address下,点击Go,然后点击OK

我得到这个不透明的错误:

来自 Visual Studio 的不透明错误消息

http://xmlns.oracle.com/Enterprise/Tools/schemas似乎没有解决任何问题,但我几乎可以肯定这没关系。

我还在与 Visual Studio 相同的 PC 上的soapUI中对此进行了测试,并且一切正常。我可以访问 SOAP 服务并获得预期的响应。

错误消息的不透明性令人困惑,这在soapUI中有效,所以WSDL假定是好的?我已经搜索了这个错误,到目前为止还没有找到任何东西。

这是 WSDL(经过清理以隐藏 URL 和服务详细信息):

<?xml version="1.0"?>
<wsdl:definitions name="A_PROGRAM_SERVICE.1" targetNamespace="http://xmlns.oracle.com/Enterprise/HCM/schemas/A_PROGRAM_SERVICE.1" xmlns:A_PROGRAM_REQUEST_MSG.VERSION_1="http://xmlns.oracle.com/Enterprise/Tools/schemas" xmlns:A_PROGRAM_RESPONSE_MSG.VERSION_1="http://xmlns.oracle.com/Enterprise/Tools/schemas" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://xmlns.oracle.com/Enterprise/HCM/schemas/A_PROGRAM_SERVICE.1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
  <wsp:UsagePolicy wsdl:Required="true"/>
  <plnk:partnerLinkType name="A_PROGRAM_SERVICE_PartnerLinkType">
    <plnk:role name="A_PROGRAM_SERVICE_Provider">
      <plnk:portType name="tns:A_PROGRAM_SERVICE_PortType"/>
    </plnk:role>
  </plnk:partnerLinkType>
  <wsdl:types>
    <xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:import namespace="http://xmlns.oracle.com/Enterprise/Tools/schemas" schemaLocation="A_PROGRAM_REQUEST_MSG.VERSION_1.xsd"/>
      <xsd:import namespace="http://xmlns.oracle.com/Enterprise/Tools/schemas" schemaLocation="A_PROGRAM_RESPONSE_MSG.VERSION_1.xsd"/>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="A_PROGRAM_REQUEST_MSG.VERSION_1">
    <wsdl:documentation>A Data Repository</wsdl:documentation>
    <wsdl:part element="A_PROGRAM_REQUEST_MSG.VERSION_1:InputParameters" name="parameter"/>
  </wsdl:message>
  <wsdl:message name="A_PROGRAM_RESPONSE_MSG.VERSION_1">
    <wsdl:documentation>A Data Repository</wsdl:documentation>
    <wsdl:part element="A_PROGRAM_RESPONSE_MSG.VERSION_1:root" name="parameter"/>
  </wsdl:message>
  <wsdl:portType name="A_PROGRAM_SERVICE_PortType">
    <wsdl:operation name="A_PROGRAM_OP">
      <wsdl:documentation>A Data Repository</wsdl:documentation>
      <wsdl:input message="tns:A_PROGRAM_REQUEST_MSG.VERSION_1" name="A_PROGRAM_REQUEST_MSG.VERSION_1"/>
      <wsdl:output message="tns:A_PROGRAM_RESPONSE_MSG.VERSION_1" name="A_PROGRAM_RESPONSE_MSG.VERSION_1"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="A_PROGRAM_SERVICE_Binding" type="tns:A_PROGRAM_SERVICE_PortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="A_PROGRAM_OP">
      <soap:operation soapAction="A_PROGRAM_OP.v1" style="document"/>
      <wsp:Policy wsu:Id="UsernameTokenSecurityPolicyPasswordOptional" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:ExactlyOne>
          <wsp:All>
            <wsse:SecurityToken wsp:Usage="wsp:Required" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
              <wsse:TokenType>wsse:UserNameToken</wsse:TokenType>
              <Claims>
                <SubjectName MatchType="wsse:Exact"/>
                <UsePassword wsp:Usage="wsp:Optional"/>
              </Claims>
            </wsse:SecurityToken>
          </wsp:All>
        </wsp:ExactlyOne>
      </wsp:Policy>
      <wsdl:input name="A_PROGRAM_REQUEST_MSG.VERSION_1">
        <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="literal"/>
      </wsdl:input>
      <wsdl:output name="A_PROGRAM_RESPONSE_MSG.VERSION_1">
        <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="A_PROGRAM_SERVICE">
    <wsdl:documentation>A Data Repository</wsdl:documentation>
    <wsdl:port binding="tns:A_PROGRAM_SERVICE_Binding" name="A_PROGRAM_SERVICE_Port">
      <soap:address location="http://some_url_here/PSIGW/PeopleSoftServiceListeningConnector/SYSTEMNAME"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
4

1 回答 1

0

通过更深入的分析,我想通了。导入的 XSDmaxOccurs="unbounded" 之一在根元素中。这是没有意义的,因为根元素在 XML 文档中只能出现一次。

Visual Studio 肯定可以使用更清晰的错误消息!

感谢@JohnSaunders 帮助我考虑检查进口。

于 2012-08-29T20:12:27.190 回答