2015-02-06 10 views
4

XSD가 여러 개있는 WSDL을 받았는데이를 사용하여 WCF 서비스를 만듭니다. 나는 서비스 클래스를 생성하기 위해 svcutil.exe를 사용하고 있으며 모든 것은 기본적으로 잘 작동한다 - 서비스가 어떤 메소드도 노출시키지 않는다는 것만 제외하면.WCF 계약 첫 번째 : 노출되는 메서드가 없습니다.

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 
[System.ServiceModel.ServiceContractAttribute(Namespace="http://serviceplatformen.dk/xml/wsdl/soap11/DistributionService/1/port", ConfigurationName="DistributionReceiverWebServicePort")] 
public interface DistributionReceiverWebServicePort 
{ 

    [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] 
    [System.ServiceModel.FaultContractAttribute(typeof(serviceplatformen.dk.xml.wsdl.soap11.DistributionService._1.types.TransportkvitteringType), Action="", Name="TransportKvittering", Namespace="http://serviceplatformen.dk/xml/wsdl/soap11/DistributionService/1/types")] 
    [System.ServiceModel.XmlSerializerFormatAttribute()] 
    FordelingsobjektModtagResponse FordelingsobjektModtag(FordelingsobjektModtagRequest request); 
} 

그리고 문제의 유형을 다음과 같이 :

는 svcutil에서 생성 된 .cs 파일은 다음과 같은 인터페이스를 포함

[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.33440")] 
[System.SerializableAttribute()] 
[System.Diagnostics.DebuggerStepThroughAttribute()] 
[System.ComponentModel.DesignerCategoryAttribute("code")] 
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://serviceplatformen.dk/xml/wsdl/soap11/DistributionService/1/types")] 
public partial class ForretningskvitteringType 
{ 

    private ForretningsValideringsKodeType forretningsValideringsKodeField; 

    private string begrundelseField; 

    private FejlType[] fejlListeField; 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=1)] 
    public string Begrundelse 
    { 
     get 
     { 
      return this.begrundelseField; 
     } 
     set 
     { 
      this.begrundelseField = value; 
     } 
    } 

    ... 
} 

나는 유형 중 어느 것도 장식되지 않은 것으로 나타났습니다 DataContract/DataMember 특성을 사용하여. 필요한 것입니까, 아니면 유형의 다른 속성으로 덮여 있습니까? 나는 매우 명백한,하지만 뭔가를 놓치고 생각

<?xml version="1.0" encoding="utf-8"?> 
<wsdl:definitions name="FKService" targetNamespace="http://serviceplatformen.dk/xml/wsdl/soap11/DistributionService/1/port" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://serviceplatformen.dk/xml/wsdl/soap11/DistributionService/1/port" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"> 
    <wsp:Policy wsu:Id="MetadataExchangeHttpBinding_DistributionReceiverWebServicePort_policy"> 
    <wsp:ExactlyOne> 
     <wsp:All> 
     <wsaw:UsingAddressing/> 
     </wsp:All> 
    </wsp:ExactlyOne> 
    </wsp:Policy> 
    <wsdl:types/> 
    <wsdl:portType name="DistributionReceiverWebServicePort"/> 
    <wsdl:binding name="BasicHttpBinding_DistributionReceiverWebServicePort" type="tns:DistributionReceiverWebServicePort"> 
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> 
    </wsdl:binding> 
    <wsdl:binding name="MetadataExchangeHttpBinding_DistributionReceiverWebServicePort" type="tns:DistributionReceiverWebServicePort"> 
    <wsp:PolicyReference URI="#MetadataExchangeHttpBinding_DistributionReceiverWebServicePort_policy"/> 
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/> 
    </wsdl:binding> 
    <wsdl:service name="FKService"> 
    <wsdl:port name="BasicHttpBinding_DistributionReceiverWebServicePort" binding="tns:BasicHttpBinding_DistributionReceiverWebServicePort"> 
     <soap:address location="http://localhost:8082/FKService/"/> 
    </wsdl:port> 
    <wsdl:port name="MetadataExchangeHttpBinding_DistributionReceiverWebServicePort" binding="tns:MetadataExchangeHttpBinding_DistributionReceiverWebServicePort"> 
     <soap12:address location="http://localhost:8082/FKService/mex"/> 
     <wsa10:EndpointReference> 
     <wsa10:Address>http://localhost:8082/FKService/mex</wsa10:Address> 
     </wsa10:EndpointReference> 
    </wsdl:port> 
    </wsdl:service> 
</wsdl:definitions> 

:

내 서비스에 의해 노출 된 WSDL (모든 작업없이)이 무엇입니까?

+0

보기 어렵다. http://wscfblue.codeplex.com/을 살펴보십시오. 특히 유형으로 시작하여 WSDL을 생성하십시오. –

답변

3

분명히 svcutil이 작동 계약서에 ReplyAction = "*"을 추가하면 이상한 행동이 발생합니다.

OperationContractAttribute의이 사양을 제거한 후에 문제가 없어졌습니다.

[System.ServiceModel.ServiceContractAttribute(Namespace="http://tempuri.org/xml/wsdl/soap11/DistributionService/1/port", ConfigurationName="DistributionReceiverWebServicePort")] 
public interface DistributionReceiverWebServicePort 
{ 
    [System.ServiceModel.OperationContractAttribute(Action="")] 
    [System.ServiceModel.FaultContractAttribute(typeof(TransportkvitteringType), Action="", Name="TransportKvittering", Namespace="http://tempuri.org/xml/wsdl/soap11/DistributionService/1/types")] 
    [System.ServiceModel.XmlSerializerFormatAttribute()] 
    FordelingsobjektModtagResponse FordelingsobjektModtag(FordelingsobjektModtagRequest request); 
} 

는 WSDL을 준수하는 서비스를 만들기도

https://shishkin.wordpress.com/2007/03/21/wcf-actions-asterisk-and-metadata/

https://social.msdn.microsoft.com/Forums/vstudio/en-US/41f5fe72-3ab3-4741-867e-a93119fe62aa/svcutil-generates-replyaction