Visual Studio中的不透明WSDL架构错误

时间:2012-08-28 21:15:01

标签: visual-studio-2010 soap wsdl visual-studio-2012 peoplesoft

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

我右键点击服务参考,选择添加服务参考,将网址粘贴到地址下,点击开始,然后点击确定

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

Opaque error message from Visual Studio

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

我也在soapUI和Visual Studio在同一台PC上测试过,一切正常。我可以访问SOAP服务并获得预期的响应。

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

这是WSDL(为了掩盖网址和服务细节而进行了清理):

<?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>

1 个答案:

答案 0 :(得分:0)

通过更深入的分析,我发现了它。其中一个导入的XSD在根元素中有maxOccurs="unbounded"。这没有任何意义,因为根元素只能在XML文档中出现一次。

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

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