title: Consuming Java service from C#/WCF - Array only valid for encoded SOAP
body: <p>I am trying to consume a web service published by Enterprise One (JD Edwards) using .NET 4.0 and svcutil.exe. I cannot at this time change the WSDL.</p>
  
  <p>In Visual Studio 2012 when I add a 'Service Reference' and point to the online WSDL, no errors are shown to me but the generated .cs file contains only a namespace, no classes. I have downloaded the WSDL and tried using svcutil.exe to generate client classes like so:</p>
  
  <pre><code>svcutil ServiceWSDL.wsdl
  </code></pre>
  
  <p>When I do this I receive the following error:</p>
  
  <blockquote>
    <p>Error: Cannot import wsdl:portType Detail: An exception was thrown
    while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter Error:
    Referenced type '<a href="http://schemas.xmlsoap.org/soap/encoding/:Array" rel="nofollow">http://schemas.xmlsoap.org/soap/encoding/:Array</a>' is
    only  valid for encoded SOAP. XPath to Error Source:
    //wsdl:definitions[@targetNamespace='http://oracle.e1.bssv.JP550016]/wsdl:portType[@name='Oracle_E1_SBF_JWS_PkgBldFile_AccountMasterQueryPublished']</p>
  </blockquote>
  
  <p>What I would like to know is if there is some way to use svcutil to generate a proxy that will function, or do I need to forego the use of a proxy and use HttpWebRequest to get the request sent?</p>
  
  <p>Portion of WSDL causing error:</p>
  
  <pre><code>&lt;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"&gt;
    &lt;xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
    &lt;xs:complexType name="ArrayList"&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:restriction base="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>Entire WSDL:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;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"&gt;
    &lt;WL5G3N0:Policy WL5G3N1:Id="Wssp1.2-2007-Https-UsernameToken-Plain.xml"&gt;
      &lt;sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"&gt;
        &lt;wsp:Policy&gt;
          &lt;sp:TransportToken&gt;
            &lt;wsp:Policy&gt;
              &lt;sp:HttpsToken/&gt;
            &lt;/wsp:Policy&gt;
          &lt;/sp:TransportToken&gt;
          &lt;sp:AlgorithmSuite&gt;
            &lt;wsp:Policy&gt;
              &lt;sp:Basic256/&gt;
            &lt;/wsp:Policy&gt;
          &lt;/sp:AlgorithmSuite&gt;
          &lt;sp:Layout&gt;
            &lt;wsp:Policy&gt;
              &lt;sp:Lax/&gt;
            &lt;/wsp:Policy&gt;
          &lt;/sp:Layout&gt;
          &lt;sp:IncludeTimestamp/&gt;
        &lt;/wsp:Policy&gt;
      &lt;/sp:TransportBinding&gt;
      &lt;sp:SupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"&gt;
        &lt;wsp:Policy&gt;
          &lt;sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient"&gt;
            &lt;wsp:Policy&gt;
              &lt;sp:WssUsernameToken10/&gt;
            &lt;/wsp:Policy&gt;
          &lt;/sp:UsernameToken&gt;
        &lt;/wsp:Policy&gt;
      &lt;/sp:SupportingTokens&gt;
    &lt;/WL5G3N0:Policy&gt;
    &lt;wsp:UsingPolicy WL5G3N2:Required="true"/&gt;
    &lt;WL5G3N2:types&gt;
      &lt;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"&gt;
        &lt;xs:complexType name="ValueObject"/&gt;
      &lt;/xs:schema&gt;
      &lt;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"&gt;
        &lt;xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
        &lt;xs:complexType name="ArrayList"&gt;
          &lt;xs:complexContent&gt;
            &lt;xs:restriction base="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
          &lt;/xs:complexContent&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:schema&gt;
      &lt;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"&gt;
        &lt;xs:import namespace="java:oracle.e1.bssv.JP550016.valueobject"/&gt;
        &lt;xs:element name="accountMasterQueryElement" type="java:V0901G_pInbound" xmlns:java="java:oracle.e1.bssv.JP550016.valueobject"/&gt;
        &lt;xs:element name="accountMasterQueryResponseElement" type="java:V0901G_pOutbound" xmlns:java="java:oracle.e1.bssv.JP550016.valueobject"/&gt;
      &lt;/xs:schema&gt;
      &lt;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"&gt;
        &lt;xs:complexType name="E1MessageList"&gt;
          &lt;xs:sequence&gt;
            &lt;xs:element maxOccurs="unbounded" minOccurs="0" name="E1Messages" nillable="true" type="java:E1Message" xmlns:java="java:oracle.e1.bssvfoundation.util"/&gt;
          &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
        &lt;xs:complexType name="E1Message"&gt;
          &lt;xs:sequence&gt;
            &lt;xs:element minOccurs="1" name="MessagePrefix" nillable="true" type="xs:string"/&gt;
            &lt;xs:element minOccurs="1" name="Message" nillable="true" type="xs:string"/&gt;
          &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:schema&gt;
      &lt;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"&gt;
        &lt;xs:complexType name="BusinessServiceException"&gt;
          &lt;xs:annotation&gt;
            &lt;xs:documentation&gt;The base Exception class for Published Business Services. 
    All Published Business Service exceptions must extend from this class.&lt;/xs:documentation&gt;
          &lt;/xs:annotation&gt;
          &lt;xs:sequence&gt;
            &lt;xs:element minOccurs="1" name="RequestID" nillable="true" type="xs:string"&gt;
              &lt;xs:annotation&gt;
                &lt;xs:documentation&gt;Public accessor methods are necessary for Web Services calls, but this method should not be 
   used by application development.&lt;/xs:documentation&gt;
              &lt;/xs:annotation&gt;
            &lt;/xs:element&gt;
            &lt;xs:element minOccurs="1" name="Message" nillable="true" type="xs:string"&gt;
              &lt;xs:annotation&gt;
                &lt;xs:documentation&gt;Overrides getMessage from super class. Returns the exception message.&lt;/xs:documentation&gt;
              &lt;/xs:annotation&gt;
            &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
        &lt;xs:element name="BusinessServiceException" type="java:BusinessServiceException" xmlns:java="java:oracle.e1.bssvfoundation.exception"/&gt;
      &lt;/xs:schema&gt;
      &lt;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"&gt;
        &lt;xs:import namespace="java:oracle.e1.bssvfoundation.base"/&gt;
        &lt;xs:import namespace="java:java.util"/&gt;
        &lt;xs:import namespace="java:oracle.e1.bssvfoundation.util"/&gt;
        &lt;xs:complexType name="V0901G_pOutbound"&gt;
          &lt;xs:annotation&gt;
            &lt;xs:documentation&gt;The outbound value object returns a list of accounts from the F0901&lt;/xs:documentation&gt;
          &lt;/xs:annotation&gt;
          &lt;xs:complexContent&gt;
            &lt;xs:extension base="java:ValueObject" xmlns:java="java:oracle.e1.bssvfoundation.base"&gt;
              &lt;xs:sequence&gt;
                &lt;xs:element minOccurs="1" name="CostCenter" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="AccountId" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="Company" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="ObjectAccount" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="Subsidiary" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="AccountDescription" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="LevelOfDetailAcctCde" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="PostingEdit" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="BusinessUnitName" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="CurrencyCodeFrom" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="E1MessageList" nillable="true" type="java1:E1MessageList" xmlns:java1="java:oracle.e1.bssvfoundation.util"/&gt;
                &lt;xs:element minOccurs="1" name="QueryResults" nillable="true" type="java1:ArrayList" xmlns:java1="java:java.util"/&gt;
              &lt;/xs:sequence&gt;
            &lt;/xs:extension&gt;
          &lt;/xs:complexContent&gt;
        &lt;/xs:complexType&gt;
        &lt;xs:complexType name="V0901G_pInbound"&gt;
          &lt;xs:annotation&gt;
            &lt;xs:documentation&gt;The inbound parameters to select a list of accounts.&lt;/xs:documentation&gt;
          &lt;/xs:annotation&gt;
          &lt;xs:complexContent&gt;
            &lt;xs:extension base="java:ValueObject" xmlns:java="java:oracle.e1.bssvfoundation.base"&gt;
              &lt;xs:sequence&gt;
                &lt;xs:element minOccurs="1" name="CostCenter" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="ObjectAccount" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="Subsidiary" nillable="true" type="xs:string"/&gt;
                &lt;xs:element minOccurs="1" name="HelmSwitch" nillable="true" type="xs:string"/&gt;
              &lt;/xs:sequence&gt;
            &lt;/xs:extension&gt;
          &lt;/xs:complexContent&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:schema&gt;
    &lt;/WL5G3N2:types&gt;
    &lt;WL5G3N2:message name="accountMasterQuery"&gt;
      &lt;WL5G3N2:part element="WL5G3N3:accountMasterQueryElement" name="inputV0"/&gt;
    &lt;/WL5G3N2:message&gt;
    &lt;WL5G3N2:message name="accountMasterQueryResponse"&gt;
      &lt;WL5G3N2:part element="WL5G3N3:accountMasterQueryResponseElement" name="accountMasterQueryResponseElement"/&gt;
    &lt;/WL5G3N2:message&gt;
    &lt;WL5G3N2:message name="BusinessServiceException"&gt;
      &lt;WL5G3N2:part element="WL5G3N4:BusinessServiceException" name="BusinessServiceException"/&gt;
    &lt;/WL5G3N2:message&gt;
    &lt;WL5G3N2:portType name="Oracle_E1_SBF_JWS_PkgBldFile_AccountMasterQueryPublished" wsp:PolicyURIs="#Wssp1.2-2007-Https-UsernameToken-Plain.xml"&gt;
      &lt;WL5G3N2:operation name="accountMasterQuery" parameterOrder="inputV0"&gt;
        &lt;WL5G3N2:input message="WL5G3N3:accountMasterQuery"/&gt;
        &lt;WL5G3N2:output message="WL5G3N3:accountMasterQueryResponse"/&gt;
        &lt;WL5G3N2:fault message="WL5G3N3:BusinessServiceException" name="BusinessServiceException"/&gt;
      &lt;/WL5G3N2:operation&gt;
    &lt;/WL5G3N2:portType&gt;
    &lt;WL5G3N2:binding name="AccountMasterQueryPublishedSoapBinding" type="WL5G3N3:Oracle_E1_SBF_JWS_PkgBldFile_AccountMasterQueryPublished"&gt;
      &lt;WL5G3N5:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
      &lt;WL5G3N2:operation name="accountMasterQuery"&gt;
        &lt;WL5G3N5:operation soapAction="http://oracle.e1.bssv.JP550016//accountMasterQuery" style="document"/&gt;
        &lt;WL5G3N2:input&gt;
          &lt;WL5G3N5:body parts="inputV0" use="literal"/&gt;
        &lt;/WL5G3N2:input&gt;
        &lt;WL5G3N2:output&gt;
          &lt;WL5G3N5:body parts="accountMasterQueryResponseElement" use="literal"/&gt;
        &lt;/WL5G3N2:output&gt;
        &lt;WL5G3N2:fault name="BusinessServiceException"&gt;
          &lt;WL5G3N5:fault name="BusinessServiceException" use="literal"/&gt;
        &lt;/WL5G3N2:fault&gt;
      &lt;/WL5G3N2:operation&gt;
    &lt;/WL5G3N2:binding&gt;
    &lt;WL5G3N2:service name="AccountMasterQueryPublished"&gt;
      &lt;WL5G3N2:port binding="WL5G3N3:AccountMasterQueryPublishedSoapBinding" name="AccountMasterQueryPublishedHttpPort"&gt;
        &lt;WL5G3N5:address location="https://server/path/AccountMasterQueryPublished"/&gt;
      &lt;/WL5G3N2:port&gt;
    &lt;/WL5G3N2:service&gt;
  &lt;/WL5G3N2:definitions&gt;
  </code></pre>