Posted By: jcnovoa | Nov 11th, 2005 @ 10:04 AM
page 1 of 1
Comments: 1 | Views: 14419
jcnovoa
jcnovoa
http://www.e​nGaugedTraining.c​om
Does anyone know how to ensure a WebService/WebMethod needs to be serialized to ensure is compatible with Reporting Services' new XML Data Source when passing parameters to the report. I have had success on using the Report Server WebService
http://localhost/reportserver/reportservice2005.asmx
and using the Query designer to pass the SoapAction call
<Query><SoapAction>http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListChildren</SoapAction></Query>
and associating the data set parameters to the Designer GUI parameters (which I may say is not documented well on BoL)


But when using ANY OTHER WEB SERVICE that needs parameters, the parameteres are not passed correctly to the WebMehtod. Try this code and you will see:
http://www.enGaugedTraining.com/Downloads/Public/Code/ReportWebService.zip 
I am thiking they are comming in the header or as an array instead of an actual item within the SOAP message.... Too bad we can't  do this in the Query Designer... it is actually SAD this was not thought out as to be compatible with regular SOAP calls... too bad. Ideally we would use a query like the one below, and replace the fixed values with a parameter as defined in the designer (i.e. /Reports = @ItemParam & False as @RecursiveParam )... maybe in Orca this can be done right! either through SOAP

<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ListChildren xmlns="http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices">
<Item>/</Item>
<Recursive>false</Recursive>
</ListChildren>
</soap:Body>
</soap:Envelope>

Or through whatever "standard' the <Query/> definition is made of!

<Query>
<SoapAction>http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListChildren
</SoapAction>
<Parameter>
<Name>Item</Name>
<Value>/Reports</Value>
</Parameter>
<Parameter>
<Name>Recursive</Name>
<Value>False</Value>
</Parameter>
</Query>

When ILDASming the Microsoft.ReportingServices.DataExtensions.dll (which I was surprised is not ofuscated) you get the info below which contains a SOAPMethodInfo, and inside a SoapMethodParamter and also a Microsoft.ReportingServices.DataExtensions.XmlDP.ParameterCollection
you would think there is a way to get the <Query/> written as to be able to pass the parameters there:

  |   |   |   |   |___[CLS] SOAPActionInfo
   |   |   |   |   |   |     .class nested assembly auto ansi sealed beforefieldinit
   |   |   |   |   |   |___[FLD] MethodName : assembly initonly string
   |   |   |   |   |   |___[STF] MethodParamName : private static literal string
   |   |   |   |   |   |___[FLD] MethodUri : assembly initonly string
   |   |   |   |   |   |___[STF] SOAPActionRegex : private static initonly class [System]System.Text.RegularExpressions.Regex
   |   |   |   |   |   |___[STF] UriParamName : private static literal string
   |   |   |   |   |   |___[FLD] m_soapAction : private initonly string
   |   |   |   |   |   |___[STM] .cctor : void()
   |   |   |   |   |   |___[MET] .ctor : void(class Microsoft.ReportingServices.DataExtensions.XmlDP.XmlDPQuery/SOAPMethodInfo)
   |   |   |   |   |   |___[MET] .ctor : void(string)
   |   |   |   |   |   |___[MET] ToString : string()
   |   |   |   |   |
   |   |   |   |   |___[CLS] SOAPMethodInfo
   |   |   |   |   |   |     .class nested assembly auto ansi sealed beforefieldinit
   |   |   |   |   |   |___[CLS] SoapMethodParameter
   |   |   |   |   |   |   |     .class nested assembly auto ansi sealed beforefieldinit
   |   |   |   |   |   |   |___[FLD] DefaultValueText : assembly initonly string
   |   |   |   |   |   |   |___[FLD] Name : assembly initonly string
   |   |   |   |   |   |   |___[FLD] TypeCode : assembly initonly valuetype Microsoft.ReportingServices.DataExtensions.XmlDP.Xml2TableConverter/SchemaNode/ValueTypeCode
   |   |   |   |   |   |   |___[MET] .ctor : void(string,valuetype Microsoft.ReportingServices.DataExtensions.XmlDP.Xml2TableConverter/SchemaNode/ValueTypeCode,string)
   |   |   |   |   |   |

Using the parameters from the DataSource does not work with a REGULAR web service... Try it... create a HelloWorld Web Method, that takes a string myName as a parameter, go in and create a Report with an XML DataSource that points to this webservice... try passing the parameter, and step through the WebService... you will get NULLs in your parameters....

Steps to reproduce
1) Crete Web Service
2) Create hello world web method that takes 1 string parameter
3) create a report, and add an XML Data Source
4) create a <Query/> similar to the one in my code
http://www.enGaugedTraining.com/Downloads/Public/Code/ReportWebService.zip
5) Create a DataSet, add a parameter to it (i.e. myName) execute the query
6) Switch to the designer and add a parameter to the report (i.e. myName)
7) Switch back to the data set and modify the paramteres as to asscoiate them to the report parameter you just created similar to this http://www.enGaugedTraining.com/Parameters.gif
8) Publish the report
9) Debug the Web Service and put a break point in the WebMethod
10) Access the report via the portal,and run it, as you step through the WebService, notice the parameter is the WebService is being passed a NULL  value.
11) How are we to construct the or develop the WebMethod as to ensure the paramters are being passed??? [C]
page 1 of 1
Comments: 1 | Views: 14419
Microsoft Communities