Web services
I am trying to consume a web service within a sitefinity installation.
This seems much harder than it needs to be.
I added the reference to the service no problem, named the service reference the same as I did in a project outside of sitefinity.
It puts all the files for the reference in the Service_References folder however in a custom control trying to declare the using bondDataReference (the name of the reference) It has no idea what this is.
I have searched and searched and have gotten nothing on this.
Hi Rick,
Do you want to post some of your example code so I can take a look? Also have a peek at the documentation here about RESTful WCF services in SF and this blog post which also outlines getting started with web services in SF. The latter comes with some example code. For the sake of all options being covered here is a forum post that discusses consuming web services in Sitefinity.
I hope this helps and I look forward to hearing back from you!
The service reference is called bondData
using it outside of sitefinity I would simply do the following in the codebehind of the user control
using
bondData;
private
void
GetBondPrice()
// store the string returns of the service into a local instance of bondData
bondData thisData =
new
bondData();
string
[] newData = thisData.getBondData(1,
""
,
""
,
""
);
// Now worth with the string array
double
price =
double
.Parse(newData[1]);
double
closePrice =
double
.Parse(newData[9]);
etc........
Hi Rick,
Was the set of documentation I sent you not of any help? It does discuss how to consume web services in Sitefinity. Please make sure you're setting up your services as they do in this blog post. Additionally check out this post which discusses using claims based authentication (what Sitefinity uses) in calling your web services.
Kind regards,I am trying to add a service reference to my project and after configuring the settings for which service I would like to add Visual Studio hangs for about 30+ minutes before adding the
service reference. After the service has been added I then inspected the
service reference in the object browser and I notice every time that there is
no namespace available to the service reference it just says SitefinityWebApp
as its namespace. I am confused why this is happening, is there something going
on with Sitefinity were the namespaces are routed thus losing the namespace for
the service reference?
How do I properly add a service
reference to Sitefinity? I have done this in the past with local services or
services belonging to a different project with in the same solution. And I
would like to add I am not new to adding services either.
Hello all,
@Brian,
The proper way to add a service in Sitefinity is described here. Please go through the instructions and match them depending on your scenario.
Regards,
Ivan D. Dimitrov
Telerik
Ivan,
I have followed the link you have referenced. My results are different.
1. No files were added to the app_code folder (in fact my whole project doesn't contain one)
2. This is what i have inside my svc file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace SitefinityWebApp.Sitefinity.Services
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "PaWebSerives" in code, svc and config file together.
// NOTE: In order to launch WCF Test Client for testing this service, please select PaWebSerives.svc or PaWebSerives.svc.cs at the Solution Explorer and start debugging.
public class PaWebSerives : IPaWebSerives
public void DoWork()
Further what do i need to do from here?