代码之家  ›  专栏  ›  技术社区  ›  Brandon Linton

在使用Biztalk使用WCF终结点时,什么会导致对象引用错误?

  •  0
  • Brandon Linton  · 技术社区  · 14 年前

    [ServiceContract(Name = "ReceiverService", Namespace = "http://services.company.org/")]
    public interface IReceiverService : ILoadBalanced
    {
     [OperationContract]
     void FinishedRouting(long applicationId);
    
     [OperationContract]
     void ResponsePending(long applicationId, string stringId, short count);
    
     [OperationContract]
     void ReportException(long applicationId, string errorMessage, string stringId);
    
     [OperationContract]
     void SaveResponse(WebResponseDto decision);
    }
    

    [5096] System.NullReferenceException: Object reference not set to an instance of an object. 
    [5096]    at Microsoft.BizTalk.Adapter.Wcf.Consuming.Exporters.BindingInfoExporter.CreatePrimaryTransport(ServiceEndpoint serviceEndpoint, Boolean custom) 
    [5096]    at Microsoft.BizTalk.Adapter.Wcf.Consuming.Exporters.BindingInfoExporter.CreateSendPort(ServiceEndpoint endpoint, Port port, Boolean custom) 
    [5096]    at Microsoft.BizTalk.Adapter.Wcf.Consuming.Exporters.BindingInfoExporter.Export(ServiceEndpointCollection endpoints, ServiceDescriptionCollection wsdlDocuments, Boolean custom) 
    [5096]    at Microsoft.BizTalk.Adapter.Wcf.Consuming.Consumer.CreateBindingFiles(MetadataSet metadataSet, String serviceName) 
    

    [5096] System.NullReferenceException: Object reference not set to an instance of an object. 
    [5096]    at Microsoft.BizTalk.Adapter.Wcf.Consuming.Implementation.ClientImplementation.AddFilesToProject(String schemaNamespace) 
    [5096] System.NullReferenceException: Object reference not set to an instance of an object. 
    [5096]    at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous) 
    [5096]    at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args) 
    [5096]    at Microsoft.BizTalk.Adapter.Wcf.Consuming.Consumer.Consume(ISynchronizeInvoke synchronizeInvoke, DTE dte, MetadataSet metadataSet, Project project, String importNamespace) 
    

    2 回复  |  直到 14 年前
        1
  •  1
  •   StuartLC    14 年前

    here here

      <xs:element name="GetDataResponse">
        <xs:complexType>
          <xs:sequence />
        </xs:complexType>
      </xs:element>
    

    namespace WcfService1
    {
        [ServiceContract(Namespace = "http://someorl.org/ns1")]
        public interface IBase
        {
            [OperationContract]
            void SomeBaseMethod(int value);
        }
    
        [ServiceContract(Namespace = "http://someorl.org/ns2")]
        public interface IService1 : IBase
        {
    
            [OperationContract]
            void GetData(int value);
    
            [OperationContract]
            CompositeType GetDataUsingDataContract(CompositeType composite);
    
            // TODO: Add your service operations here
        }
    
    
        // Use a data contract as illustrated in the sample below to add composite types to service operations.
        [DataContract]
        public class CompositeType
        {
            bool boolValue = true;
            string stringValue = "Hello ";
    
            [DataMember]
            public bool BoolValue
            {
                get { return boolValue; }
                set { boolValue = value; }
            }
    
            [DataMember]
            public string StringValue
            {
                get { return stringValue; }
                set { stringValue = value; }
            }
    
            //[DataMember]
            //public XmlDocument NonSerializable
            //{
            //    get;
            //    set;
            //}
        }
    }
    
        2
  •  0
  •   Howard Edidin    14 年前

    推荐文章