For creating a dataset using webservice, do the following steps.
- Create a new Datasource
- From solution explorer, right click "Shared Data Sources".
- Click on "Add new Datasource".
- In the new window, provide a name for the new datasource.
- Select type as "Xml".
- In connection string, provide the path of wsdl. Ex: http://localhost/Service1.asmx?wsdl
- Hit Ok.
- Create a new Dataset
- Select the Data tab.
- From the Dataset dropdown, select "New Dataset".
- In the Dataset window, Select the dataset we have created.
- Select Text as command.
- Use the following query
<Method Namespace="http://tempuri.org/" Name="MethodName">
<Parameters>
<Parameter Name="parameter1">
<DefaultValue>1 </DefaultValue>
</Parameter>
</Parameters>
</Method>
<SoapAction>http://tempuri.org/MethodName </SoapAction>
</Query>
MethodName is the method you want to invoke in the webservice.
parameter1 is the name of the parameter the webservice method is expecting. You need to create a Report Parameter. And in the "Create New Datset" window, open the Parameter tab and add that parameter.
Now in the query window, execute the query by clicking the "Red Exclamation Icon".
Done!!!
For queries and suggestions, please feel free to ping me.
No comments:
Post a Comment