2009-05-25 26 views
8

Trong ứng dụng của chúng tôi, chúng tôi buộc phải tiêu thụ một số dịch vụ web. Ban đầu, chúng tôi chỉ sử dụng tùy chọn menu "Thêm dịch vụ tham khảo" để tạo một proxy WCF.Sự cố khi tạo proxy WebService bằng svcutil

Trình hướng dẫn không tạo ra một DataContract, mà là một lớp XML-Serializable. Cho đến nay, thật tệ, nhưng đây không phải là kẻ giết người. Tuy nhiên, sau đó chúng tôi nhận thấy rằng chúng tôi đã mất dữ liệu vì proxy được tạo đã thêm thuộc tính Đơn hàng khi phân bổ và điều này gây ra sự cố.

Bây giờ chúng tôi đang cố gắng để tạo ra các lớp proxy từ WSDL bằng cách sử dụng SVCUTIL.EXE, nhưng chúng tôi là tất cả các thời gian nhận được thông báo lỗi sau:

C:\temp\WSDL>svcutil /serializer:DataContractSerializer ReadSddsAddressOut.wsdl 
Microsoft (R) Service Model Metadata Tool 
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] 
Copyright (c) Microsoft Corporation. All rights reserved. 

Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchKanton']/wsdl:input 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchKanton']/wsdl:output 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchPlz']/wsdl:input 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchPlz']/wsdl:output 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchNation']/wsdl:input 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchNation']/wsdl:output 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchAdr']/wsdl:input 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchAdr']/wsdl:output 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchPkt']/wsdl:input 


Warning: Das optionale WSDL-Erweiterungselement "body" aus Namespace "http://schemas.xmlsoap.org/wsdl/soap/" wurde nicht behandelt. 
XPath: //wsdl:definitions[@targetNamespace='http://post.ch/sdds/address']/wsdl:binding[@name='ReadSddsAddressOutBinding']/wsdl:operation[@name='GeoSuchPkt']/wsdl:output 


Generating files... 
C:\temp\WSDL\ReadSddsAddressOut.cs 
C:\temp\WSDL\output.config 

Các thông báo lỗi bằng tiếng Anh trông giống như

này

"Phần tử mở rộng WSDL tùy chọn 'nội dung' từ không gian tên 'http://schemas.xmlsoap.org/wsdl/soap/' không được xử lý."

WSDL gốc trông như thế này:

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions name="ReadSddsAddressOut" targetNamespace="http://post.ch/sdds/address" xmlns:p2="http://post.ch/sdds" xmlns:p1="http://post.ch/sdds/address" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 
    <wsdl:documentation/> 
    <wsdl:types> 
     <xsd:schema targetNamespace="http://post.ch/sdds" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://post.ch/sdds"> 
      <xsd:element name="ZuboGeoKantonReq"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="GEOKTNID" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOKTNBEZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="maxRows" type="xsd:integer" minOccurs="0"/> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoPktReq"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="GEOPKTID" type="xsd:integer" minOccurs="0"/> 
         <xsd:element name="GEOADRID" type="xsd:integer" minOccurs="0"/> 
         <xsd:element name="GEOKTNID" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOKTNBEZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPLZPLZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPLZPLZ4" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPLZORT39" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOSTRBEZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOADRSTRNRT" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOADRCMT" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPKTKORX" type="xsd:decimal" minOccurs="0"/> 
         <xsd:element name="GEOPKTKORY" type="xsd:decimal" minOccurs="0"/> 
         <xsd:element name="GEOPKTKORZ" type="xsd:decimal" minOccurs="0"/> 
         <xsd:element name="GEOPKTTYP" type="xsd:integer" minOccurs="0"/> 
         <xsd:element name="GEOPKTMAIN" type="xsd:boolean" minOccurs="0"/> 
         <xsd:element name="withDeletedPkt" type="xsd:boolean" minOccurs="0"/> 
         <xsd:element name="maxRows" type="xsd:integer" minOccurs="0"/> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoNationResp"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="ErrorCode" type="xsd:integer"/> 
         <xsd:element name="ErrorText" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="DataSet"> 
          <xsd:complexType> 
           <xsd:sequence maxOccurs="unbounded"> 
            <xsd:element name="row" minOccurs="0"> 
             <xsd:complexType> 
              <xsd:sequence> 
               <xsd:element name="GEONATID" type="xsd:string"/> 
               <xsd:element name="GEONATBEZ" type="xsd:string"/> 
              </xsd:sequence> 
             </xsd:complexType> 
            </xsd:element> 
           </xsd:sequence> 
          </xsd:complexType> 
         </xsd:element> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoKantonResp"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="ErrorCode" type="xsd:integer"/> 
         <xsd:element name="ErrorText" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="DataSet"> 
          <xsd:complexType> 
           <xsd:sequence maxOccurs="unbounded"> 
            <xsd:element name="row" minOccurs="0"> 
             <xsd:complexType> 
              <xsd:sequence> 
               <xsd:element name="GEOKTNID" type="xsd:string"/> 
               <xsd:element name="GEOKTNBEZ" type="xsd:string"/> 
               <xsd:element name="GEONATID" type="xsd:string"/> 
               <xsd:element name="GEONATBEZ" type="xsd:string"/> 
              </xsd:sequence> 
             </xsd:complexType> 
            </xsd:element> 
           </xsd:sequence> 
          </xsd:complexType> 
         </xsd:element> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoPlzResp"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="ErrorCode" type="xsd:integer"/> 
         <xsd:element name="ErrorText" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="DataSet"> 
          <xsd:complexType> 
           <xsd:sequence maxOccurs="unbounded"> 
            <xsd:element name="row" minOccurs="0"> 
             <xsd:complexType> 
              <xsd:sequence> 
               <xsd:element name="GEOPLZPLZ" type="xsd:string"/> 
               <xsd:element name="GEOPLZPLZ4" type="xsd:string"/> 
               <xsd:element name="GEOPLZONRP" type="xsd:integer"/> 
               <xsd:element name="GEOPLZSPRCOD1" type="xsd:integer"/> 
               <xsd:element name="GEOPLZSPRCOD2" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZORT18" type="xsd:string"/> 
               <xsd:element name="GEOPLZORT27" type="xsd:string"/> 
               <xsd:element name="GEOPLZORT39" type="xsd:string"/> 
               <xsd:element name="GEOPLZPLZTYP" type="xsd:integer"/> 
               <xsd:element name="GEOKTNID" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOKTNBEZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEONATID" type="xsd:string"/> 
               <xsd:element name="GEONATBEZ" type="xsd:string"/> 
               <xsd:element name="GEOPLZSTATUS" type="xsd:integer"/> 
              </xsd:sequence> 
             </xsd:complexType> 
            </xsd:element> 
           </xsd:sequence> 
          </xsd:complexType> 
         </xsd:element> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoPktResp"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="ErrorCode" type="xsd:integer"/> 
         <xsd:element name="ErrorText" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="DataSet"> 
          <xsd:complexType> 
           <xsd:sequence maxOccurs="unbounded"> 
            <xsd:element name="row" minOccurs="0"> 
             <xsd:complexType> 
              <xsd:sequence> 
               <xsd:element name="GEOPKTID" type="xsd:integer"/> 
               <xsd:element name="GEOPKTBEZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPKTKORX" type="xsd:decimal"/> 
               <xsd:element name="GEOPKTKORY" type="xsd:decimal"/> 
               <xsd:element name="GEOPKTKORZ" type="xsd:decimal" minOccurs="0"/> 
               <xsd:element name="GEOPKTSTK" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPKTWOH" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPKTTYP" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPKTMAIN" type="xsd:boolean"/> 
               <xsd:element name="GEOADRID" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOSTRBEZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOSTRTYP" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOADRSTRNR" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOADRSTRNRZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRSTRNRT" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRHAUSN" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRGEBFLG" type="xsd:boolean" minOccurs="0"/> 
               <xsd:element name="GEOADRLAGFLG" type="xsd:boolean" minOccurs="0"/> 
               <xsd:element name="GEOADRCMT" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRHAUSKEY" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOADRGPOID" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZPLZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZPLZ4" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZONRP" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZSPRCOD1" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZSPRCOD2" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZORT18" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZORT27" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZORT39" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZPLZTYP" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOKTNID" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOKTNBEZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEONATID" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEONATBEZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPKTSTATUS" type="xsd:integer"/> 
              </xsd:sequence> 
             </xsd:complexType> 
            </xsd:element> 
           </xsd:sequence> 
          </xsd:complexType> 
         </xsd:element> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoPlzReq"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="GEOPLZPLZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPLZPLZ4" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPLZORT39" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="maxRows" type="xsd:integer" minOccurs="0"/> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoNationReq"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="GEONATID" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEONATBEZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="maxRows" type="xsd:integer" minOccurs="0"/> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoAdrResp"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="ErrorCode" type="xsd:integer"/> 
         <xsd:element name="ErrorText" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="DataSet"> 
          <xsd:complexType> 
           <xsd:sequence maxOccurs="unbounded"> 
            <xsd:element name="row" minOccurs="0"> 
             <xsd:complexType> 
              <xsd:sequence> 
               <xsd:element name="GEOADRID" type="xsd:integer"/> 
               <xsd:element name="GEOSTRBEZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOSTRTYP" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOADRSTRNR" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOADRSTRNRZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRSTRNRT" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRSTRHAUSN" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRGEBFLG" type="xsd:boolean" minOccurs="0"/> 
               <xsd:element name="GEOADRLAGFLG" type="xsd:boolean" minOccurs="0"/> 
               <xsd:element name="GEOADRCMT" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRHAUSKEY" type="xsd:integer"/> 
               <xsd:element name="GEOADRGPOID" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZPLZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZPLZ4" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZONRP" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZSPRCOD1" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZSPRCOD2" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOPLZORT18" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZORT27" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZORT39" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOPLZPLZTYP" type="xsd:integer" minOccurs="0"/> 
               <xsd:element name="GEOKTNID" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOKTNBEZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEONATID" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEONATBEZ" type="xsd:string" minOccurs="0"/> 
               <xsd:element name="GEOADRSTATUS" type="xsd:integer"/> 
              </xsd:sequence> 
             </xsd:complexType> 
            </xsd:element> 
           </xsd:sequence> 
          </xsd:complexType> 
         </xsd:element> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
      <xsd:element name="ZuboGeoAdrReq"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element name="GEOADRID" type="xsd:integer" minOccurs="0"/> 
         <xsd:element name="GEOKTNID" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOKTNBEZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPLZPLZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPLZPLZ4" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOPLZORT39" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOSTRBEZ" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOADRSTRNRT" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="GEOADRCMT" type="xsd:string" minOccurs="0"/> 
         <xsd:element name="withDeletedAdr" type="xsd:boolean" minOccurs="0"/> 
         <xsd:element name="maxRows" type="xsd:integer" minOccurs="0"/> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
     </xsd:schema> 
    </wsdl:types> 
    <wsdl:message name="p2.ZuboGeoKantonReq"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoKantonReq" element="p2:ZuboGeoKantonReq"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoKantonResp"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoKantonResp" element="p2:ZuboGeoKantonResp"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoPlzReq"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoPlzReq" element="p2:ZuboGeoPlzReq"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoPlzResp"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoPlzResp" element="p2:ZuboGeoPlzResp"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoNationReq"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoNationReq" element="p2:ZuboGeoNationReq"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoNationResp"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoNationResp" element="p2:ZuboGeoNationResp"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoAdrReq"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoAdrReq" element="p2:ZuboGeoAdrReq"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoAdrResp"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoAdrResp" element="p2:ZuboGeoAdrResp"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoPktReq"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoPktReq" element="p2:ZuboGeoPktReq"/> 
    </wsdl:message> 
    <wsdl:message name="p2.ZuboGeoPktResp"> 
     <wsdl:documentation/> 
     <wsdl:part name="ZuboGeoPktResp" element="p2:ZuboGeoPktResp"/> 
    </wsdl:message> 
    <wsdl:portType name="ReadSddsAddressOut"> 
     <wsdl:documentation/> 
     <wsdl:operation name="GeoSuchKanton"> 
      <wsdl:documentation/> 
      <wsdl:input message="p1:p2.ZuboGeoKantonReq"/> 
      <wsdl:output message="p1:p2.ZuboGeoKantonResp"/> 
     </wsdl:operation> 
     <wsdl:operation name="GeoSuchPlz"> 
      <wsdl:documentation/> 
      <wsdl:input message="p1:p2.ZuboGeoPlzReq"/> 
      <wsdl:output message="p1:p2.ZuboGeoPlzResp"/> 
     </wsdl:operation> 
     <wsdl:operation name="GeoSuchNation"> 
      <wsdl:documentation/> 
      <wsdl:input message="p1:p2.ZuboGeoNationReq"/> 
      <wsdl:output message="p1:p2.ZuboGeoNationResp"/> 
     </wsdl:operation> 
     <wsdl:operation name="GeoSuchAdr"> 
      <wsdl:documentation/> 
      <wsdl:input message="p1:p2.ZuboGeoAdrReq"/> 
      <wsdl:output message="p1:p2.ZuboGeoAdrResp"/> 
     </wsdl:operation> 
     <wsdl:operation name="GeoSuchPkt"> 
      <wsdl:documentation/> 
      <wsdl:input message="p1:p2.ZuboGeoPktReq"/> 
      <wsdl:output message="p1:p2.ZuboGeoPktResp"/> 
     </wsdl:operation> 
    </wsdl:portType> 
    <wsdl:binding name="ReadSddsAddressOutBinding" type="p1:ReadSddsAddressOut"> 
     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
     <wsdl:operation name="GeoSuchKanton"> 
      <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      <wsdl:input> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:input> 
      <wsdl:output> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:output> 
     </wsdl:operation> 
     <wsdl:operation name="GeoSuchPlz"> 
      <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      <wsdl:input> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:input> 
      <wsdl:output> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:output> 
     </wsdl:operation> 
     <wsdl:operation name="GeoSuchNation"> 
      <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      <wsdl:input> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:input> 
      <wsdl:output> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:output> 
     </wsdl:operation> 
     <wsdl:operation name="GeoSuchAdr"> 
      <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      <wsdl:input> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:input> 
      <wsdl:output> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:output> 
     </wsdl:operation> 
     <wsdl:operation name="GeoSuchPkt"> 
      <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      <wsdl:input> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:input> 
      <wsdl:output> 
       <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
      </wsdl:output> 
     </wsdl:operation> 
    </wsdl:binding> 
    <wsdl:service name="ReadSddsAddressOutService"> 
     <wsdl:port name="ReadSddsAddressOutPort" binding="p1:ReadSddsAddressOutBinding"> 
      <soap:address location="http://h03kyq:51000/XISOAPAdapter/MessageServlet?channel=:SDDS_DEV:ssReadSddsAddress" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> 
     </wsdl:port> 
    </wsdl:service> 
</wsdl:definitions> 

Và (screwed) lớp proxy trông như thế này:

//------------------------------------------------------------------------------ 
// <auto-generated> 
//  Dieser Code wurde von einem Tool generiert. 
//  Laufzeitversion:2.0.50727.3074 
// 
//  Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn 
//  der Code erneut generiert wird. 
// </auto-generated> 
//------------------------------------------------------------------------------ 



[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] 
[System.ServiceModel.ServiceContractAttribute(Namespace="http://post.ch/sdds/address", ConfigurationName="ReadSddsAddressOut")] 
public interface ReadSddsAddressOut 
{ 

    [System.ServiceModel.OperationContractAttribute()] 
    void GeoSuchKanton(); 

    [System.ServiceModel.OperationContractAttribute()] 
    void GeoSuchPlz(); 

    [System.ServiceModel.OperationContractAttribute()] 
    void GeoSuchNation(); 

    [System.ServiceModel.OperationContractAttribute()] 
    void GeoSuchAdr(); 

    [System.ServiceModel.OperationContractAttribute()] 
    void GeoSuchPkt(); 
} 

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] 
public interface ReadSddsAddressOutChannel : ReadSddsAddressOut, System.ServiceModel.IClientChannel 
{ 
} 

[System.Diagnostics.DebuggerStepThroughAttribute()] 
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] 
public partial class ReadSddsAddressOutClient : System.ServiceModel.ClientBase<ReadSddsAddressOut>, ReadSddsAddressOut 
{ 

    public ReadSddsAddressOutClient() 
    { 
    } 

    public ReadSddsAddressOutClient(string endpointConfigurationName) : 
      base(endpointConfigurationName) 
    { 
    } 

    public ReadSddsAddressOutClient(string endpointConfigurationName, string remoteAddress) : 
      base(endpointConfigurationName, remoteAddress) 
    { 
    } 

    public ReadSddsAddressOutClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
      base(endpointConfigurationName, remoteAddress) 
    { 
    } 

    public ReadSddsAddressOutClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
      base(binding, remoteAddress) 
    { 
    } 

    public void GeoSuchKanton() 
    { 
     base.Channel.GeoSuchKanton(); 
    } 

    public void GeoSuchPlz() 
    { 
     base.Channel.GeoSuchPlz(); 
    } 

    public void GeoSuchNation() 
    { 
     base.Channel.GeoSuchNation(); 
    } 

    public void GeoSuchAdr() 
    { 
     base.Channel.GeoSuchAdr(); 
    } 

    public void GeoSuchPkt() 
    { 
     base.Channel.GeoSuchPkt(); 
    } 
} 

Bất kỳ trợ giúp sẽ là tuyệt vời.

+0

Vấn đề thực sự là gì? Tất cả những gì tôi thấy là cảnh báo, thay vì lỗi (và bạn có thể muốn dịch chúng cho chúng tôi * grin *) Ngay cả việc thêm thuộc tính thứ tự cũng không được làm mất dữ liệu trừ khi dịch vụ ở phía bên kia đang đưa ra giả định xấu. – blowdart

+0

Bằng cách thêm mệnh đề Đặt hàng, WCF tự động giả định rằng mọi thuộc tính sẽ S shown được hiển thị. Điều này không nhất thiết phải là trường hợp, đặc biệt khi minoccur là 0. Vấn đề là, các cảnh báo đó có nghĩa là máy phát bỏ qua các loại hoàn toàn, tạo ra các phương thức void ... (void), mà không nên, tất cả đều có đầu vào và loại đầu ra. –

Trả lời

23

Giản đồ được sử dụng bởi wsdl không tuân theo Schema Reference của Bộ nối tiếp hợp lệ dữ liệu.

vấn đề:

  1. "Tất cả các yếu tố phải được đủ điều kiện cho một schema được hỗ trợ bởi DataContractSerializer".

    Giản đồ của bạn bỏ qua thuộc tính elementFormDefault trên thẻ để mặc định, "không đủ tiêu chuẩn" có hiệu lực. Bạn cần phải thêm cặp tên/giá trị thuộc tính sau vào phần tử < schema> để Bộ nối tiếp hợp lệ dữ liệu (DCS) có thể giải quyết các phần tử/kiểu cục bộ.

    elementFormDefault = "đủ điều kiện"

  2. maxOccurs và minOccurs thuộc tính trên < sequence> thẻ phải là 1 hoặc bỏ qua (mặc định là 1).

    Vì vậy, hãy xóa maxOccurs = "không bị chặn" trên chuỗi <>.

  3. Thêm maxOccurs = "unbounded" trên thẻ < row> để nhận hợp đồng dữ liệu thu thập lồng nhau được tạo cho trường Số liệu.

    Ví dụ,

    <xsd:element name="DataSet"> <xsd:complexType> <xsd:sequence> <xsd:element name="row" minOccurs="0" maxOccurs="unbounded"/>

+6

+1 để đọc qua toàn bộ WSDL đó. –

+2

Giống như ông Svcutil Exe tự trả lời câu hỏi. Tại sao anh ấy không thể nói như thế này khi tôi sử dụng anh ấy? – x0n

0

tôi phải thoát khỏi việc sử dụng các "nguyên tố" và nhiều hơn thay vì chỉ sử dụng các "complexType" s.

Vì vậy, tôi đã xóa các phần tử kèm theo trên DataContracts và trong Messages, tôi đặt thuộc tính type thay vì thuộc tính element.Bây giờ nó hoạt động, cảm ơn bạn rất nhiều. :)

0

Hey tôi không chắc chắn cách bạn tạo ra wsdl và các công cụ của bạn, nhưng bộ dữ liệu có một vài điều kỳ quặc.

Khi tạo proxy của tôi với một ds Tôi cần phải tham khảo lắp ráp này:

C: \ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Data.dll

Chúc mừng, Stian

Các vấn đề liên quan