1
votes

I'm attempting to call a function of an XML Shared data source and pass in parameters.

I have the following query, cleaned up and simplified for the purpose of the question:

<Query>
    <Method Name="FunctionCall" Namespace="http://tempuri.org/" >

    <Parameters>
        <Parameter Name="BooleanParameter" Type="Boolean">
            <DefaultValue>true</DefaultValue>
        </Parameter> 
    </Parameters>

    </Method>
    <SoapAction>url:my.WebService.FunctionCall</SoapAction>
    <ElementPath IgnoreNamespaces="true"> * </ElementPath>
</Query>

Now, the problem is that the boolean value I'm sending in isn't having any effect. I used Fiddler2 and confirmed that SSRS is sending out a value of either true or false, I've used WCFTestClient to determine what results I should be expecting, and I know for a fact that I am using the same parameter name as the web service. But the web service always defaults to a false parameter. I can never get it to return a result with a BooleanParameter of true.

I've been pulling my hair out here, any information or suspicions are welcome. I can provide more information, too, if necessary. All I need to do is get the webservice to return a value based on a true parameter.

2

2 Answers

0
votes

I am not sure if you are referring to a hosted report, RDL, or a report in a client such as an RDLC report. I believe with an RDL you are trying to do too much in your XML call. You just get the data and then specify the default in the report markup, not in the call. So if I have an XML query method that calls a local WCF servcie

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

I don't set the value for a default here whenever I have done it, I merely define that there will be a parameter called 'state' here then I must have a parameter in the 'Report Data' that has the value 'state'. Then in that parameter I define a default value.

Be careful as I have seen SSRS misconstrue DateTime and other types to be 'text' when they come over. This could be another potential problem as your service is fine but SSRS is assuming a different type of data type than a traditional boolean, even though it is boolean on the service side the receiving xml call takes it as text. You can always play around with your data type on the client (SSRS) side to see if this is the case.

0
votes

This can happen due to two reasons.

1) Parameter names are not exactly matched. Note that parameter names are case sensitive.

2) Namespace is not correctly matched. Note that if you specifiy namespace as "http://tempuri.org/" make sure that the trailing forward slash character is there in your webservice definition. E.g.

[WebService(Namespace = "http://tempuri.org/")]
public class ReportService : System.Web.Services.WebService
{

}