Method Name


GenerateDocument


Summary


Web method that generates random text in the form of a document.


See Resources for examples of applications that access this web method.


Parameters


minNumParagraphs

       Type: Integer

       Minimum number of paragraphs to generate.

       Valid Values:

        Integer greater than zero (0).


maxNumParagraphs

       Type: Integer

       Minimum number of paragraphs to generate.

       Valid Values:

        Integer greater than or equal to minNumParagraphs.


minNumSentencesPerParagraph

       Type: Integer

       Minimum number of sentences to generate for each paragraph.

       Valid Values:

        Integer greater than zero (0).


maxNumSentencesPerParagraph

       Type: Integer

       Maximum number of sentences to generate for each paragraph.

       Valid Values:

        Integer greater than or equal to minNumSentencesPerParagraph.

       

documentType

       Type: String

       Specified the type of document to generate.

       Valid Values:

        Specify Title

        Random Title

        Specify Subject

        Random Subject


documentSubject

       Type: String

       Specifies text that will appear as document title at the top of the generated text. Leave blank if RandomTitle or RandomSubject is specified for documentType.

       Valid Values:

        Text values or leave blank.


specifyDateFromTo

       Type: Boolean

       If true, random date, name of sender and name of receipient will be placed at the top of the generated document. If false,  this area of the document will be left blank.

       Valid Values:

        True or False.


insertBlankLineBetweenParagraphs

       Type: Boolean

       If true, a blank line will be inserted after each paragraph. If false, generated paragraphs are not separated by a blank line. Blank line improves readability of output..

       Valid Values:

        True or False.


Return Value


Type: String

String containing the generated document text.


Example


URL


http://pfrandomtextwebservice.azurewebsites.net/TextGenerator.asmx/GenerateDocument?minNumParagraphs=4&maxNumParagraphs=6&minNumSentencesPerParagraph=3&maxNumSentencesPerParagraph=5&documentType=Specify%20Title&documentSubject=A%20Test%20Document&specifyDateFromTo=true&insertBlankLineBetweenParagraphs=true

       

C#


       //Test endpoint address for ServiceReference1:

       //     http://pfrandomtextwebservice.azurewebsites.net/textgenerator.asmx


       TestWebServiceApp.ServiceReference1.TextGeneratorSoapClient serviceClient = new  ServiceReference1.TextGeneratorSoapClient();


public string GenerateDocument(int minNumParagraphs, int maxNumParagraphs,

                                                int minNumSentencesPerParagraph, int maxNumSentencesPerParagraph,

                                                string documentType, string documentSubject,

                                               bool specifyDateFromTo, bool insertBlankLineBetweenParagraphs)

{

string result = string.Empty;


result = txtProc.GenerateDocument(minNumParagraphs, maxNumParagraphs,

                                                    minNumSentencesPerParagraph, maxNumSentencesPerParagraph,

                                                    documentType, documentSubject,

                                                    specifyDateFromTo, insertBlankLineBetweenParagraphs);

return result;

}