Discussion:
SSRS Web Service as a Data Source
(too old to reply)
Rob
2007-09-05 18:50:04 UTC
Permalink
I have been trying for quite awhile to get a web service to return data for a
report and I just cannot get it to work.

I have been able to get Microsoft's example (ListChildren) to work and I am
able to access data in an XML file; but I cannot get a custom web service to
work.

In my data source the Type: = XML and my Connection string is:

http://myservername/ADN/Services.asmx

When I access the Services.asmx file I get a list of several web services.

In my dataset, I am trying something of the following:
<Query>
<Method Name="Get_UsersList" Namespace="http://tempuri.org">
<Parameters>
<Parameter Name="username">
<DefaultValue>user</DefaultValue>
</Parameter>
<Parameter Name="password">
<DefaultValue>password</DefaultValue>
</Parameter>
<Parameter Name="account">
<DefaultValue>flashdev</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>

The password, username and account are all correct. I am not sure on the
NAMESPACE (I am just taking a wild guess here).

The data set only returns a STATUS and an XMLNS fields where I expected to
see some user data (from Get_UsersList).

I do get an error message in SSRS:
"System.NullReferenceException: Object reference not set to an instance of
an object. at Service.getLoginInfo(LoginInfo loginInfo, String account)"

it seems to me that the username or password is wrong. Any help is much
appreciated.

Rob
pcrtrg
2007-09-06 14:52:02 UTC
Permalink
I had the same issue many months ago and did get it sorted.

With the command type set to text I have this:

<Query>
<Method Namespace="http://tempuri.org/" Name="ssrsXmlXtract"/>
<SoapAction>http://tempuri.org/ssrsXmlXtract</SoapAction>
<ElementPath IgnoreNamespaces="false"></ElementPath>
</Query>

If you take a look at the method and the only thing that points to what I am
calling is the name.

the connection string is then the url to the webservice ending in .asmx,
with the type set to xml.

I also set up the Web Service parameters in the parameters tab and this
worked for me.

Try it and see if you can get this working for you
Post by Rob
I have been trying for quite awhile to get a web service to return data for a
report and I just cannot get it to work.
I have been able to get Microsoft's example (ListChildren) to work and I am
able to access data in an XML file; but I cannot get a custom web service to
work.
http://myservername/ADN/Services.asmx
When I access the Services.asmx file I get a list of several web services.
<Query>
<Method Name="Get_UsersList" Namespace="http://tempuri.org">
<Parameters>
<Parameter Name="username">
<DefaultValue>user</DefaultValue>
</Parameter>
<Parameter Name="password">
<DefaultValue>password</DefaultValue>
</Parameter>
<Parameter Name="account">
<DefaultValue>flashdev</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>
The password, username and account are all correct. I am not sure on the
NAMESPACE (I am just taking a wild guess here).
The data set only returns a STATUS and an XMLNS fields where I expected to
see some user data (from Get_UsersList).
"System.NullReferenceException: Object reference not set to an instance of
an object. at Service.getLoginInfo(LoginInfo loginInfo, String account)"
it seems to me that the username or password is wrong. Any help is much
appreciated.
Rob
Rob
2007-09-06 15:52:02 UTC
Permalink
Thanks so much for the post. I was able to get my web service to work after
several hours of shooting in the dark. I eventually got the following to
work.

The datasource was set up as listed below. Type of XML and the connection
string of http://<myservername>/adn/services.asmx

In my dataset I used the following:

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

In the dataset I selected the ... button and set my parameters there.

It worked and it returned data to my dataset. It is kind of funny that
there are not a lot of examples posted on the web regarding SSRS and web
services (other than the ListChildren example offered by Microsoft.)

Once again, thanks for the reply.
Rob
Post by pcrtrg
I had the same issue many months ago and did get it sorted.
<Query>
<Method Namespace="http://tempuri.org/" Name="ssrsXmlXtract"/>
<SoapAction>http://tempuri.org/ssrsXmlXtract</SoapAction>
<ElementPath IgnoreNamespaces="false"></ElementPath>
</Query>
If you take a look at the method and the only thing that points to what I am
calling is the name.
the connection string is then the url to the webservice ending in .asmx,
with the type set to xml.
I also set up the Web Service parameters in the parameters tab and this
worked for me.
Try it and see if you can get this working for you
Post by Rob
I have been trying for quite awhile to get a web service to return data for a
report and I just cannot get it to work.
I have been able to get Microsoft's example (ListChildren) to work and I am
able to access data in an XML file; but I cannot get a custom web service to
work.
http://myservername/ADN/Services.asmx
When I access the Services.asmx file I get a list of several web services.
<Query>
<Method Name="Get_UsersList" Namespace="http://tempuri.org">
<Parameters>
<Parameter Name="username">
<DefaultValue>user</DefaultValue>
</Parameter>
<Parameter Name="password">
<DefaultValue>password</DefaultValue>
</Parameter>
<Parameter Name="account">
<DefaultValue>flashdev</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>
The password, username and account are all correct. I am not sure on the
NAMESPACE (I am just taking a wild guess here).
The data set only returns a STATUS and an XMLNS fields where I expected to
see some user data (from Get_UsersList).
"System.NullReferenceException: Object reference not set to an instance of
an object. at Service.getLoginInfo(LoginInfo loginInfo, String account)"
it seems to me that the username or password is wrong. Any help is much
appreciated.
Rob
Loading...