2

.NET 4.0 と svcutil.exe を使用して、Enterprise One (JD Edwards) によって発行された Web サービスを使用しようとしています。現時点では WSDL を変更できません。

Visual Studio 2012 で「サービス参照」を追加してオンライン WSDL を指定すると、エラーは表示されませんが、生成された .cs ファイルには名前空間のみが含まれ、クラスは含まれません。WSDL をダウンロードし、svcutil.exe を使用して次のようなクライアント クラスを生成しようとしました。

svcutil ServiceWSDL.wsdl

これを行うと、次のエラーが表示されます。

エラー: wsdl:portType をインポートできません 詳細: WSDL インポート拡張機能の実行中に例外がスローされました: System.ServiceModel.Description.XmlSerializerMessageContractImporter エラー: 参照された型 ' http://schemas.xmlsoap.org/soap/encoding/:Array ' はエンコードされた SOAP に対してのみ有効です。エラー ソースへの XPath: //wsdl:definitions[@targetNamespace='http://oracle.e1.bssv.JP550016]/wsdl:portType[@name='Oracle_E1_SBF_JWS_PkgBldFile_AccountMasterQueryPublished']

私が知りたいのは、svcutil を使用して機能するプロキシを生成する方法があるかどうか、またはプロキシの使用を控えて HttpWebRequest を使用してリクエストを送信する必要があるかどうかです。

エラーの原因となっている WSDL の部分:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="java:java.util" xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N2="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N3="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
  <xs:complexType name="ArrayList">
    <xs:complexContent>
      <xs:restriction base="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

WSDL 全体:

<?xml version='1.0' encoding='UTF-8'?>
<WL5G3N2:definitions name="AccountMasterQueryPublishedDefinitions" targetNamespace="http://oracle.e1.bssv.JP550016/" xmlns="" xmlns:WL5G3N0="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:WL5G3N1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:WL5G3N2="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N3="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N4="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N5="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
  <WL5G3N0:Policy WL5G3N1:Id="Wssp1.2-2007-Https-UsernameToken-Plain.xml">
    <sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
      <wsp:Policy>
        <sp:TransportToken>
          <wsp:Policy>
            <sp:HttpsToken/>
          </wsp:Policy>
        </sp:TransportToken>
        <sp:AlgorithmSuite>
          <wsp:Policy>
            <sp:Basic256/>
          </wsp:Policy>
        </sp:AlgorithmSuite>
        <sp:Layout>
          <wsp:Policy>
            <sp:Lax/>
          </wsp:Policy>
        </sp:Layout>
        <sp:IncludeTimestamp/>
      </wsp:Policy>
    </sp:TransportBinding>
    <sp:SupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
      <wsp:Policy>
        <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
          <wsp:Policy>
            <sp:WssUsernameToken10/>
          </wsp:Policy>
        </sp:UsernameToken>
      </wsp:Policy>
    </sp:SupportingTokens>
  </WL5G3N0:Policy>
  <wsp:UsingPolicy WL5G3N2:Required="true"/>
  <WL5G3N2:types>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="java:oracle.e1.bssvfoundation.base" xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N2="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N3="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="ValueObject"/>
    </xs:schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="java:java.util" xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N2="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N3="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <xs:complexType name="ArrayList">
        <xs:complexContent>
          <xs:restriction base="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
        </xs:complexContent>
      </xs:complexType>
    </xs:schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N2="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N3="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import namespace="java:oracle.e1.bssv.JP550016.valueobject"/>
      <xs:element name="accountMasterQueryElement" type="java:V0901G_pInbound" xmlns:java="java:oracle.e1.bssv.JP550016.valueobject"/>
      <xs:element name="accountMasterQueryResponseElement" type="java:V0901G_pOutbound" xmlns:java="java:oracle.e1.bssv.JP550016.valueobject"/>
    </xs:schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="java:oracle.e1.bssvfoundation.util" xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N2="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N3="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="E1MessageList">
        <xs:sequence>
          <xs:element maxOccurs="unbounded" minOccurs="0" name="E1Messages" nillable="true" type="java:E1Message" xmlns:java="java:oracle.e1.bssvfoundation.util"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="E1Message">
        <xs:sequence>
          <xs:element minOccurs="1" name="MessagePrefix" nillable="true" type="xs:string"/>
          <xs:element minOccurs="1" name="Message" nillable="true" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N2="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N3="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="BusinessServiceException">
        <xs:annotation>
          <xs:documentation>The base Exception class for Published Business Services. 
  All Published Business Service exceptions must extend from this class.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
          <xs:element minOccurs="1" name="RequestID" nillable="true" type="xs:string">
            <xs:annotation>
              <xs:documentation>Public accessor methods are necessary for Web Services calls, but this method should not be 
 used by application development.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element minOccurs="1" name="Message" nillable="true" type="xs:string">
            <xs:annotation>
              <xs:documentation>Overrides getMessage from super class. Returns the exception message.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="BusinessServiceException" type="java:BusinessServiceException" xmlns:java="java:oracle.e1.bssvfoundation.exception"/>
    </xs:schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="java:oracle.e1.bssv.JP550016.valueobject" xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://oracle.e1.bssv.JP550016/" xmlns:WL5G3N2="java:oracle.e1.bssvfoundation.exception" xmlns:WL5G3N3="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import namespace="java:oracle.e1.bssvfoundation.base"/>
      <xs:import namespace="java:java.util"/>
      <xs:import namespace="java:oracle.e1.bssvfoundation.util"/>
      <xs:complexType name="V0901G_pOutbound">
        <xs:annotation>
          <xs:documentation>The outbound value object returns a list of accounts from the F0901</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
          <xs:extension base="java:ValueObject" xmlns:java="java:oracle.e1.bssvfoundation.base">
            <xs:sequence>
              <xs:element minOccurs="1" name="CostCenter" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="AccountId" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="Company" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="ObjectAccount" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="Subsidiary" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="AccountDescription" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="LevelOfDetailAcctCde" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="PostingEdit" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="BusinessUnitName" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="CurrencyCodeFrom" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="E1MessageList" nillable="true" type="java1:E1MessageList" xmlns:java1="java:oracle.e1.bssvfoundation.util"/>
              <xs:element minOccurs="1" name="QueryResults" nillable="true" type="java1:ArrayList" xmlns:java1="java:java.util"/>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:complexType name="V0901G_pInbound">
        <xs:annotation>
          <xs:documentation>The inbound parameters to select a list of accounts.</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
          <xs:extension base="java:ValueObject" xmlns:java="java:oracle.e1.bssvfoundation.base">
            <xs:sequence>
              <xs:element minOccurs="1" name="CostCenter" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="ObjectAccount" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="Subsidiary" nillable="true" type="xs:string"/>
              <xs:element minOccurs="1" name="HelmSwitch" nillable="true" type="xs:string"/>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
    </xs:schema>
  </WL5G3N2:types>
  <WL5G3N2:message name="accountMasterQuery">
    <WL5G3N2:part element="WL5G3N3:accountMasterQueryElement" name="inputV0"/>
  </WL5G3N2:message>
  <WL5G3N2:message name="accountMasterQueryResponse">
    <WL5G3N2:part element="WL5G3N3:accountMasterQueryResponseElement" name="accountMasterQueryResponseElement"/>
  </WL5G3N2:message>
  <WL5G3N2:message name="BusinessServiceException">
    <WL5G3N2:part element="WL5G3N4:BusinessServiceException" name="BusinessServiceException"/>
  </WL5G3N2:message>
  <WL5G3N2:portType name="Oracle_E1_SBF_JWS_PkgBldFile_AccountMasterQueryPublished" wsp:PolicyURIs="#Wssp1.2-2007-Https-UsernameToken-Plain.xml">
    <WL5G3N2:operation name="accountMasterQuery" parameterOrder="inputV0">
      <WL5G3N2:input message="WL5G3N3:accountMasterQuery"/>
      <WL5G3N2:output message="WL5G3N3:accountMasterQueryResponse"/>
      <WL5G3N2:fault message="WL5G3N3:BusinessServiceException" name="BusinessServiceException"/>
    </WL5G3N2:operation>
  </WL5G3N2:portType>
  <WL5G3N2:binding name="AccountMasterQueryPublishedSoapBinding" type="WL5G3N3:Oracle_E1_SBF_JWS_PkgBldFile_AccountMasterQueryPublished">
    <WL5G3N5:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <WL5G3N2:operation name="accountMasterQuery">
      <WL5G3N5:operation soapAction="http://oracle.e1.bssv.JP550016//accountMasterQuery" style="document"/>
      <WL5G3N2:input>
        <WL5G3N5:body parts="inputV0" use="literal"/>
      </WL5G3N2:input>
      <WL5G3N2:output>
        <WL5G3N5:body parts="accountMasterQueryResponseElement" use="literal"/>
      </WL5G3N2:output>
      <WL5G3N2:fault name="BusinessServiceException">
        <WL5G3N5:fault name="BusinessServiceException" use="literal"/>
      </WL5G3N2:fault>
    </WL5G3N2:operation>
  </WL5G3N2:binding>
  <WL5G3N2:service name="AccountMasterQueryPublished">
    <WL5G3N2:port binding="WL5G3N3:AccountMasterQueryPublishedSoapBinding" name="AccountMasterQueryPublishedHttpPort">
      <WL5G3N5:address location="https://server/path/AccountMasterQueryPublished"/>
    </WL5G3N2:port>
  </WL5G3N2:service>
</WL5G3N2:definitions>
4

1 に答える 1

2

エラーの原因となっている WSDL の部分を変更してみてください。

<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>

何らかの理由で私のために働いた。

于 2014-05-27T20:53:01.103 に答える