QUERY Soap Request Method for Testing SSRS and WCF

I am looking for a good tool for testing Xml query requests and knowing how to use them with soap requests that return xml for SSRS.

I see some threads when testing SOAP requests for WCF services that some products have recommended, and someone mentioned "WebServiceStudio" on codeplex: http://webservicestudio.codeplex.com/ . The problem is that this tool does not seem to work with the direct separation of "xml request". I'm not sure if this syntax is just SSRS or part of the SOAP family, so I'm really looking for suggestions on where to start, and it seems crazy to think that I can only test in Business Intelligence Development Studio, BIDS, by itself.

A little about what has been done so far:

  • I created an entity model in .NET 4.5 using Entity Framework 5 in C # in a library project to isolate it for part of the data model.
  • Then I created the interface and implementation in the WCF project of the website to host using basicHttpBinding as my own project to isolate it from the model.
  • I referenced the Entity Project in the Web Site project and returned the classes created from the t4 template (*. Tt = as a POCO class generator from my understanding)
  • My implementation of test returns is done as follows: two tables are returned with one with a parameter in the signature and a table function with two parameters, which are datetime:

    public List<tblState> GetStatesTable() { using (SSRSReportsEntities re = new SSRSReportsEntities()) { return re.tblStates.ToList(); } } public List<tblState> GetStateLike(string state) { using (SSRSReportsEntities re = new SSRSReportsEntities()) { return re.tblStates.Where(n => n.State.Contains(state)).ToList(); } } public List<fMonthly_Result> GetMonthlyData(DateTime aStart, DateTime aEnd) { using (SSRSReportsEntities re = new SSRSReportsEntities()) { return re.fMonthly(aStart, aEnd, null).ToList(); } } 
  • I publish this on my local site in IIS 7.5 on Windows 7 Enterprise under the default application for my site called Reporting, endpoint:

    http: // (localhost) /Reporting/ReportingService.svc

  • I created another project for my C # solution for a client. I am adding two service links. One to open a service project to test it on the fly. And one more for the service that was once published. I check the endpoint bindings and they work fine.

  • I am testing endpoints on the client, and they all work as expected for all three methods in the project and publish the links. Excellent.

  • I go to BIDS and configure the data source with the endpoint in step 5 to connect the XML type and call it WCF Datasource

  • I want to test three methods. When you add a parameter, I notice that you need to do this first before entering a dataset query, so I do this with the last two. The first two works of the third do not:

     < Query> < Method Name="GetStatesTable" Namespace="http://tempuri.org/"> < /Method> < SoapAction> http://tempuri.org/IReportingService/GetStatesTable </SoapAction> </Query> < Query> < Method Name="GetStateLike" Namespace="http://tempuri.org/"> < Parameters> <Parameter Name="state"> </Parameter> </Parameters> </Method> < SoapAction> http://tempuri.org/IReportingService/GetStateLike </SoapAction> </Query> < Query> < Method Name="GetMonthlyData" Namespace="http://tempuri.org/"> < Parameters> < Parameter Name="aStart"></Parameter> < Parameter Name="aEnd"></Parameter> </Parameters> </Method> < SoapAction> http://tempuri.org/IReportingService/GetMonthlyData </SoapAction> </Query> 

The third gives an error about the data type that it cannot implement "4/1/2013" for the data type System.DataTime. I need to troubleshoot, but I'm not sure where to start testing. Any help is greatly appreciated.

+2
source share
1 answer

Ok, so my answer is a little lame, not what I wanted, but it works. I changed my GetMonthly signature to accept string input. Then I convert them in DateTime to the body of the method. It looks like I can check the legitimacy of DateTime in SSRS as a parameter which, since the WCF service recognizes in XML, is text. Thus, error checking for legal date refers to SSRS, but the string will be converted to .NET System.DateTime. I really don't like this answer, but it works.

 public List<fMonthly_Result> GetMonthlyData2(string aStart, string aEnd) { using (SSRSReportsEntities re = new SSRSReportsEntities()) { DateTime dstart = DateTime.Parse(aStart); DateTime dend = DateTime.Parse(aEnd); return re.fMonthly(dstart, dend, null).ToList(); } } 

Now this will work if I first set the parameters and match them with existing parameters defined in the draft report:

 < Query> < Method Name="GetMonthlyData" Namespace="http://tempuri.org/"> < Parameters> < Parameter Name="aStart"></Parameter> < Parameter Name="aEnd"></Parameter> </Parameters> </Method> < SoapAction> http://tempuri.org/IReportingService/GetMonthlyData </SoapAction> </Query> 
+1
source

Source: https://habr.com/ru/post/1483406/


All Articles