locked
How do I make the DocumentContent element NotNullable RRS feed

  • Question

  • User1359467950 posted

    How do I make the DocumentContent element NotNullable please ?  minOccurs="1" maxOccurs="1" ?

     



    Friday, November 17, 2017 4:47 PM

All replies

  • User1168443798 posted

    Hi btsAdministr,<o:p></o:p>

    >> How do I make the DocumentContent element NotNullable?<o:p></o:p>

    What do you mean by this? Do you want to receive any exception if client did not provide any value for DocumentContent?<o:p></o:p>

    How will you request SendFAX, by SOAP Client or HTTP Request? <o:p></o:p>

    In my option, you need to check DocumentContent value at service side.<o:p></o:p>

            [WebMethod]
            public string Test(string UserName, byte[] DocumentContent)
            {
                try
                {
                    if ( DocumentContent == null)
                    {
                        return "DocumentContent could not be null";
                    }
                }
                catch (Exception)
                {
    
                    throw;
                }
                return "Hello World";
            }
    

    Best Regards,<o:p></o:p>

    Tao Zhou<o:p></o:p>

    Monday, November 20, 2017 3:18 AM