Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Web Service Web Part Parameters View modes: 
User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 12/20/2010 1:25:18 PM
   
Web Service Web Part Parameters
I'm working with v5.5 and have a web service (Microsoft CRM) I'd like to access. I have the .asmx address but unsure of how to use the parameters in the WebService DataSource. Is the string specific to the web service or is there a format Kentico uses? I know the parameter names will be specific to the web service but really looking for an example of how the web part is used.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 12/21/2010 3:47:06 AM
   
RE:Web Service Web Part Parameters
Hi,

It is completely up to you what you would insert into “Web service parameters” textarea in your web service web part. What you can see in this textarea will be converted into one string called parameter which is the only parameter in GetDataSetmethod of your web service method. Example (~\App_Code\CMSPages\WebService.cs):


public DataSet GetDataSet(string parameter)
{

// INSERT YOUR WEB SERVICE CODE AND RETURN THE RESULTING DATASET

return null;
}


Best regards,
Ivana Tomanickova

User avatar
Member
Member
rodrigo.perez-acumenholding - 3/29/2011 6:41:10 AM
   
RE:Web Service Web Part Parameters
I am having the same issue.
Im calling an external web service that has a method Get_News_E
I am tryig to either use a ws repeater or a ws datasource (secon option preferred) but cant make it work:
The request has to look like that:
http://xxxx/news/service1.asmx/Get_News_E?recovery=1&UserId=xxx&Password=xxx

So what Im using is:
Web service: http://xxxx/news/service1.asmx
Parameters: /Get_News_E?recovery=1&UserId=xxxx&Password=xxxx

But it is not working, I have tried many combinations but I guess Im doing something wrong.

Any help will be highly appreciated.
Thanx

User avatar
Member
Member
kentico_michal - 3/31/2011 3:23:11 AM
   
RE:Web Service Web Part Parameters
Hi,

You need to specify the property Web service URL (.asmx file) in the Repeater for web service web part:.

Web service URL: http://xxxx/news/service1.asmx

In this case it will be a location to the web service file.

However, the web service functionality, which Kentico CMS provides, requires the web service method called GetDataSet.

So, this web service file needs to have GetDataSet method with following definition

public DataSet GetDataSet(string parameter)

instead of Get_News_E, so that the repeater could display data.

The string variable parameter is the value you have entered into Web service parameters property of the Repeater for web service web part.

However, since Kentico CMS is standard .NET application, you can use the web service the same way you would use it in standard .NET application.


Best regards,
Michal Legen

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 4/4/2011 1:18:58 PM
   
RE:Web Service Web Part Parameters
Still confused on this topic. Am I only able to access webservices within Kentico? I want to access a webservice on my local network but within a different application (Dynamics CRM). Many people are familiar with Microsoft Dynamics CRM and the webservice hasn't changed since since 2007/08. Its http://xxxxx.xxx/MSCRMServices/2007/CrmService.asmx. This webservice gives you access to several methods and I'm sure none of them are GetDataSet.


User avatar
Member
Member
kentico_michal - 4/7/2011 4:13:36 AM
   
RE:Web Service Web Part Parameters
Hello,

Well, you can access any web service as long as the method you want to invoke is called GetDataSet.

In other cases you will need to implement this functionality. I am really sorry for this inconvenience.

Anyway, I have set this as a future requirement. So it will be considered for future versions of Kentico CMS.


Best regards,
Michal Legen

User avatar
Member
Member
James.Tyree-aflglobal - 12/1/2011 10:19:03 AM
   
RE:Web Service Web Part Parameters
I realize this thread is a few months old but future visitors may benefit from it.

FroggEye, when you have the KenticoCMS site opened in Visual Studio, you can simply add a Service Reference (2010) or Web Reference (2008) and then reference it in your code behind. The Web Service functionality built into the KCMS site can be bypassed/ignored.

Then whatever data the service returns, handle it accordingly. Of course, this would require you create your own Web Part with whatever Grid/Data Repeater control you want to use.

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 12/1/2011 10:25:38 AM
   
RE:Web Service Web Part Parameters
Thanks for the reply James.

Yes, that is what I ended up doing but still doesn't explain how to use the webpart. Ideally, I didn't want to add any more code to the project than I had to and figured if I could use the already built in functionality then why not. But I guess this isn't the case for this.

User avatar
Member
Member
kentico_michal - 12/6/2011 1:27:26 AM
   
RE:Web Service Web Part Parameters
Hello,

If you want to use the standard Repeater for web service web part, you need to ensure that the web service method is called GetDataSet. In any other case, you will need to get the data from the web service using custom code and as James has mentioned display it with Grid/Repeater control you want to use. More information about creating a custom web part can be found here: Developing web parts.

Best regards,
Michal Legen