1.- Referencing the WCF service from within the application.
Note:
The following information has been tested within a VS2017 console application application.
a) Once the application is build and to reference the WCF service within the "SolutionExplorer" right click over "Service Reference" as shown in Fig1.

Fig1
c) The "Add Service Reference" window get shown(see Fig2).
1.- Within the
"Address:" box type “
https://mbwebservices.naylor.com/associationsManager.svc” without the quotation marks.
2.- Click the “Go” button. It will search for the service.
3.- Once the services is found assign a namespace name to it. Within the
“Namespace:” text box type the namespace you will assign to the service (
the sample project use
“associationManagerService” namespace).
4.- Click OK.

Fig2
2.- Update the web.config file to start receiving big chunk of data.
Once the service is added to the application references a
“system.serviceModel” configuration section containing all the
Windows Communication Foundation (WCF) ServiceModel configuration elements is added to the web.config file.
Open the web.config file and look for the
<system.serviceModel> configuration section and add to the
<binding> element the
maxBufferSize and
maxReceivedMessageSize properties.
After the web.config file has been updated the
<binding> element will get changed to.
<binding name="BasicHttpBinding_IAssociations" maxBufferSize="20000000" maxReceivedMessageSize="20000000" >
<security mode="Transport" >
</binding >
Once the web.config file is updated save and close it.
Note:
If the web.config file <binding> element does not get updated then you will get the following exception error message.
“The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.”
a) To use the web service a client (an instance of “AssociationsClient” class) must be created.
b) Then the application needs to authenticate.The authentication process will return a
serviceLoginResultType object containing a boolean variable (“
loginSuccess”), the transaction result message(“
ResultMessage”) and the
SessionID.
If the loginSuccess is true the “Operations defined within the Contract" can get called.
c)Once the service calls are finished please
clear the SessionID by calling the
“clearSessionID” contract operation.
Here below is an example of how the WCf service should be use.
//define an instance of the WCf service client
associationManagerService.
AssociationsClient aClient = new associationManagerService.
AssociationsClient();
//authenticate to the service
associationManagerService.
serviceLoginResultType resultA = aClient.loginIntoService(
"webServiceUserName",
"webServiceUserPassword");
//check if the authentication process was successfull
if (resultA.loginSuccess)
{
//successful authentication
//call any contract operation. Passing the SessionID
//get json data
String jsonResult=aClient.countriesListJson(resultA.SessionID);
//get Xml data
String xmlResult=aClient.countriesListXML(resultA.SessionID);
//Once the process is finished clear the SessionID
NaylorWebServiceClient.clearSessionID(resultA.sessionID);
}
else
{
//unsuccessful authentication process
}
Note: Important!!
If the application consumer is behind a proxy server then change the “whether 100-Continue behavior”.
Place this call before star calling the Naylor WCF service.
System.Net.ServicePointManager.Expect100Continue = false;
The “WCF NaylorWeb Service” shows the following contract operations.
serviceLoginResultType loginIntoService(String loginName, String loginPassword);//authenticate to the service
String getCountriesListXml(String SessionID);//return a String containing an Xml Document with the countries data
String getCountriesListJson(String SessionID);//return a String containing the countries data in Json format.
String getSearchResultsMPXMl(String SessionID, int Associd, String AssocPre, String Type, String SearchTerm, String ShortProjectID = null, String SearchFilters = null); //return a String containing an Xml Document with the search result data.
String getSearchResultsMPJson(String SessionID, int Associd, String AssocPre, String Type, String SearchTerm, String ShortProjectID = null, String SearchFilters = null); //return a String containing the search result data in Json format.
String getSearchResultsDIRXMl(String SessionID, int Associd, String AssocPre, String Type, String SearchTerm, String ShortProjectID = null, String SearchFilters = null); //return a String containing an Xml Document with the search result data.
String getSearchResultsDIRJson(String SessionID, int Associd, String AssocPre, String Type, String SearchTerm, String ShortProjectID = null, String SearchFilters = null); //return a String containing the search result data in Json format.
String getListingDetailsMPXMl(String SessionID, String MDSID, String Adlistingid, int Associd, String AssocPre, String ShortProjectID = null);//return a String containing an Xml Document with the listing details data.
String getListingDetailsMPJson(String SessionID, String MDSID, String Adlistingid, int Associd, String AssocPre, String ShortProjectID = null);//return a String containing the listing data in Json format.
String getListingDetailsDIRXMl(String SessionID, String MDSID, String Adlistingid, int Associd, String AssocPre, String ShortProjectID = null);//return a String containing an Xml Document with the listing details data.
String getListingDetailsDIRJson(String SessionID, String MDSID, String Adlistingid, int Associd, String AssocPre, String ShortProjectID = null);//return a String containing the listing data in Json format.
String getCategoriesMPXML(String SessionID, int AssocID, String AssocPre, String ShortProjectID);//return a String containing an Xml Document with the categories.
String getCategoriesMPJson(String SessionID, int AssocID, String AssocPre, String ShortProjectID);//return a String containing the categories in Json format.
String getCategoriesDIRXML(String SessionID, int AssocID, String AssocPre, String ShortProjectID);//return a String containing an Xml Document with the directory categories.
String getCategoriesDIRJson(String SessionID, int AssocID, String AssocPre, String ShortProjectID);//return a String containing the directory categories in Json format.
String getFeaturedListingMPXML(String SessionID, int AssocID, String AssocPre, String ShortProjectID);//return a String containing an Xml Document with the Listing.
String getFeaturedListingMPJson(String SessionID, int AssocID, String AssocPre, String ShortProjectID);//return a String containing the Listing Json format.
String getMemberTypesXml(String SessionID, int Associd, String AssocPre, String ShortProjectID);//return a String containing an Xml Document with the Members Types
String getMemberTypesJson(String SessionID, int Associd, String AssocPre, String ShortProjectID);//return a String containing the Members Type Json format.
String getAutoSuggestResultsXml(String SessionID, int AssocID, String AssocPre, String ShortProjectID, String searchTerm, String typeName);//return a String containing an Xml Document with the Sugest Results
String getAutoSuggestResultsJson(String SessionID, int AssocID, String AssocPre, String ShortProjectID, String searchTerm, String typeName);//return a String containing the Sugest Results Json format.
String getCustomFieldsDirJson(String SessionID, int AssocID, String AssocPre, String ShortProjectID, String mdsID, String adOrderID);//return a String containing the Custom Fields Json format.
String getCustomFieldsDirXml(String SessionID, int AssocID, String AssocPre, String ShortProjectID, String mdsID, String adOrderID);//return a String containing an Xml Document with the Custom Fields.
String getVerifyDirUserXml(String SessionID, int AssocID, String AssocPre, String ShortProjectID, String LoginName, String LoginPassword);//return a String containing an Xml Document with the login result
String getVerifyDirUserXml(String SessionID, int AssocID, String AssocPre, String ShortProjectID, String LoginName, String LoginPassword);//return a String containing the login result Json format.
String getSearchFiltersXml(String SessionID, int AssocID, String AssocPre, String ShortProjectID);//return a String containing an Xml Document with the search filters
String getSearchFiltersJson(String SessionID, int AssocID, String AssocPre, String ShortProjectID);//return a String containing the search filters in Json format.
String getAdvancedSearchConfigurationXml(String SessionID, int AssocID, String ShortProjectID, String AdlistingID=null);//return a String containing an Xml Document with the AdvancedSearchConfiguration result
String getAdvancedSearchConfigurationJson(String SessionID, int AssocID, String ShortProjectID, String AdlistingID=null);//return a String containing the AdvancedSearchConfiguration result in Json format.
void clearSessionID(String SessionID);//clear the SessionID