none
MTOM MessageHeader Class RRS feed

  • Question

  • I have a webservice that is expecting a file . I am using MTOM to receive  it 

       [OperationContract]     
       [WebInvoke(Method = WebRequestMethods.Http.Post,  UriTemplate = "UploadDoc")]        
    void UploadDocNextGen(RemoteFileInfo remoteFileInfo);

    Following is the  class details for RemoteFileInfo

        [MessageContract]
        public class RemoteFileInfo : IDisposable
        {
    
            [MessageHeader(MustUnderstand = true)]
            public DocumentExchangeRequests dcExhange;
    
    
            [MessageBodyMember]
            public Stream FileByteStream;
            public void Dispose()
            {
                if (FileByteStream != null)
                {
                    FileByteStream.Close();
                    FileByteStream = null;
                }
            }
        }
        [Serializable]
        //  [MessageContract]
    
        public class DocumentExchangeRequests
        {
            private DescriptionSet _documentDescription = null;
            private LoanFileIdentifier _loanIdentifier = null;
            [DataMember(IsRequired = true)]
            public DescriptionSet DocumentDescriptionset
            {
                get { return _documentDescription = this.DocumentDescriptionset; }
                set { this.DocumentDescriptionset = value; }
            }
    
    
            [DataMember(IsRequired = true)]
            public LoanFileIdentifier LoanIdentifier
            {
                get { return _loanIdentifier = this.LoanIdentifier; }
                set { this.LoanIdentifier = value; }
            }
        }
    
        [Serializable]
    
        //  [MessageContract]
        public class DescriptionSet
        {
    
            private string _documentType = "";
            [DataMember(IsRequired = true)]
            public string DocumentTypes
            {
                get { return _documentType = this.DocumentTypes; }
                set { this.DocumentTypes = value; }
            }
            [DataMember(IsRequired = true)]
            public string DocumentID { get; set; }
    
            [DataMember(IsRequired = true)]
            public string ByteCount { get; set; }
    
    
            [DataMember(IsRequired = true)]
            public string DocumentCreated { get; set; }
            [DataMember(IsRequired = true)]
            public string PageCount { get; set; }
    
            [DataMember(IsRequired = true)]
            public string DocumentDescrption { get; set; }
        }
    
    
        [Serializable]
    
        // [MessageContract]
        public class LoanFileIdentifier
        {
            [DataMember(IsRequired = true, Order = 0, Name = "DocHeaderID")]
            public string DocumentID { get; set; }        [DataMember(IsRequired = true, Order = 1, Name = "BrokerID")]
            public string BrokerID { get; set; }
    
            [DataMember(IsRequired = true, Order = 2, Name = "ApplyOnlineID")]
            public string ApplyOnlineID { get; set; }
        }

    I tried  to add the WSDL in  SoapUI and got following error 

    What am i doing wrong 

      
        WSDLException (at 
        /wsdl:definitions/wsdl:binding/wsdl:operation/wsdl:input/soap12:header): 
        faultCode=NO_PREFIX_SPECIFIED: Unable to determine namespace of 
        'RemoteFileInfo_Headers'
    

    Sunday, November 3, 2019 10:45 PM

All replies

  • Hi,
    I am a little confused on the business logic, I don’t totally understand the question.
    But when we consume the service in SOAPUI, we should use the SingleWSDL URL instead of WSDL URL.
    http://10.157.13.69:1100/Service1.svc?singleWsdl

    https://i.stack.imgur.com/tKLYW.png
    Feel free to let me know If there is anything I can help with.
    Best Regards
    Abraham Qian
    Monday, November 4, 2019 8:01 AM
    Moderator
  • I did use  singleWSDL

    

    Monday, November 4, 2019 9:53 PM