Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/303.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
从C#/WCF使用Java服务-数组仅对编码的SOAP有效_C#_Wcf_Svcutil.exe - Fatal编程技术网

从C#/WCF使用Java服务-数组仅对编码的SOAP有效

从C#/WCF使用Java服务-数组仅对编码的SOAP有效,c#,wcf,svcutil.exe,C#,Wcf,Svcutil.exe,我正在尝试使用Enterprise One(JD Edwards)使用.NET 4.0和svcutil.exe发布的web服务。我现在无法更改WSDL 在Visual Studio 2012中,当我添加“服务引用”并指向在线WSDL时,不会向我显示任何错误,但生成的.cs文件只包含名称空间,没有类。我已经下载了WSDL,并尝试使用svcutil.exe生成如下客户端类: svcutil ServiceWSDL.wsdl 执行此操作时,我收到以下错误: <xs:schema attribu

我正在尝试使用Enterprise One(JD Edwards)使用.NET 4.0和svcutil.exe发布的web服务。我现在无法更改WSDL

在Visual Studio 2012中,当我添加“服务引用”并指向在线WSDL时,不会向我显示任何错误,但生成的.cs文件只包含名称空间,没有类。我已经下载了WSDL,并尝试使用svcutil.exe生成如下客户端类:

svcutil ServiceWSDL.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>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
错误:无法导入wsdl:portType详细信息:引发了异常 运行WSDL导入扩展时:System.ServiceModel.Description.XmlSerializerMessageCompactImporter错误: 引用的类型“”为 仅对编码的SOAP有效。XPath到错误源: //wsdl:definitions[@targetNamespace='1]http://oracle.e1.bssv.JP550016]/wsdl:portType[@name='Oracle\u E1\u SBF\u JWS\u PkgBldFile\u 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>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>

整个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>

已发布业务服务的基本异常类。
所有已发布的业务服务异常都必须从此类扩展。
公共访问器方法对于Web服务调用是必需的,但不应使用此方法
用于应用程序开发。
重写来自超类的getMessage。返回异常消息。
outbound value对象返回来自F0901的帐户列表
用于选择帐户列表的入站参数。

尝试更改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>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>


由于某些原因,我的工作正常。

尝试更改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>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>


出于某种原因,这对我有用。

这对Visual Studio 2010有用吗?不,在VS2010中尝试过,结果相同。现在我使用WebClient发送请求并解析Xml。它不漂亮,但很有效。这在Visual Studio 2010中有效吗?不,在VS2010中尝试过,结果相同。现在我使用WebClient发送请求并解析Xml。它并不漂亮,但很有效。+1但请澄清您的意思是WSDL需要编辑。+1但请澄清您的意思是WSDL需要编辑。