Sitecore web service extension - web-services

my requirement is to sync third party e-commerce systems(IFS) products into sitecore. Is there a way that i can extend sitecore web service with new method where i can get the products and create them in sitecore? or is there a better way to do this.
I want to create that as sitecore module, so that we can install it on any sitecore website we have to integrate with that e-commerce systems(IFS).
http://yourhost/sitecore/shell/webservice/service.asmx
Any suggestions will be appreciated.

You could potentially use the Item Web API (PDF link) that Sitecore comes with, or even roll your own web service that you write and call the native Sitecore API. If you roll your own, you could expose it as a WCF service, or a Web API or any other approach. The service you found and referenced is quite old and not really designed to be extended.
Another approach to what you are trying to do (merge/integration another system into Sitecore) would be to write your own item data provider. Here are some links on that topic:
Integrating External Data Sources
An introduction to Sitecore data providers
The Black Art of Sitecore Custom Data Providers

Please take a look on the Sitecore Commerce Connect product. It has been designed for such kind of tasks, see chapter 2.1.7 Product Synchronization:
Product Synchronization
Connect has its own product data model and a
Product Synchronization service layer for exchanging product data with
one or more external systems. The responsibility of the Product
Synchronization service layer is to manage two-way synchronization of
essential product data. The goal is to synchronize only the data that
is needed to satisfy the most common e-commerce scenarios. In
particular cases, the model can be extended. For more information on
the default scenarios that are supported, see the developer guide.

You should consider using a Custom Data Provider, it's for fit for the task at hand and will allow you to also manage the external data in a similar way to native Sitecore Items, inc caching and publishing.
There is more information in the Integrating External Data
with Sitecore document on SDN and and Nick Wesselmans article on The Black Art of Sitecore Custom Data Providers is a go to reference.
Also these blog posts provide more details on read-only data providers, which is most likely what you will want to use for external data:
A simple read-only Sitecore data provider
Custom data providers in Sitecore

Related

Extracting Sitecore Analytic Data

I'm new to Sitecore concepts, and I'm searching almost five days for an answer. I couldn't find what I'm looking for.
I'm trying to access Sitecore analytic data from a web service. I found a web service of Sitecore with using this document. I want to extract data that are about this. I believe this is a public demo site.
I want to access Web Api, then extract data and use it at my own project. Any idea?
When working with Sitecore 9, the API you want to use to connect to analytics data is known as xConnect. A secure connection is required using trusted certificates, so you cannot connect to an existing instance that somebody else setup like the Habitat demo you linked to.
xConnect is an abstraction API that allows you to collect and search all data in the xDB. The architecture fully supports both vertical and horizontal scaling of xConnect services separate from your Sitecore installations.
Resources
You can read more about xConnect here in the official developer documentation: https://doc.sitecore.net/developers/xp/xconnect/
There is an xConnect tutorial available here: https://doc.sitecore.net/developers/xp/getting-started/#tutorials-xconnect
I also have a small tutorial you can use on GitHub to start learning the concepts: https://github.com/jst-cyr/XConnectTutorial

Firebase-powered app with web service code

I am planning to use Firebase database and want to know how it fits in to the following scenario.
lets say I have a browser app, android app / iOS which uses Web Services to get / insert data, web services talks to the Data Base and returns data to the client.
This way I have to write code once in my web services and all the clients use that to retrieve and insert data to the database.
If I want to use Firebase, will I be following the same approach of having webservices between the client's and the Firebase DB.
I have done some sample Firebase examples where it it gets data from database directly without web services and in this approach we have to write our logic on each client (Web browser/ android app/ iOs app).
I have looked into this article
https://firebase.googleblog.com/2013/03/where-does-firebase-fit-in-your-app.html?showComment=1480073224245#c464815735109872173
The Pattern 2 has the server concept but that does not look appropriate in my scenario.
Can I have my web service and Firebase database and get data Synchronization capabilities.
Correct me if I am wrong and please suggest the approach I need to take.
Thank you for your valuable suggestions in advance.
Thanks & regards,
Rao Burugula
The article you link gives you the most common options for integrating Firebase into your app. Pattern 2 is the easiest way to use the Firebase Database and run your own server-side code:
In this model the Firebase Database sits between the app on the user's device and your back-end code. By using this model, you can still get all the benefits of the realtime synchronization, security rules and scalability, but also have back-end code that runs in a trusted environment.
Of course you can also go for a more traditional three-tier model, where your app server sites between the devices and the database. But in that case the Firebase database won't have direct interaction with your app anymore, so you'll have to take care of the realtime aspects of the synchronization (if you want those) in your own code.
I also recommend reading the Google Cloud documentation on using the Firebase Database and App Engine's Flexible Environments. The architecture described there is the same, but a bit more up-to-date:

How can I wrap the Sitecore 8 itemWebApi to apply custom business logic to API responses?

I have a requirement to build a service endpoint to provide specific Sitecore 8.0 items (containing a given field value in a given branch of the content tree) to requesting mobile app clients. Encapsulating this logic (and perhaps some other calculations, etc) means the out-of-the-box API is not suitable.
I'd like to mimic an existing SOAP service exposed by another CMS, however I'm not above using a modified version of the RESTful itemWebApi if it confers greater code reusability or upgrade-safety.
Based on my research thusfar, it would appear my options are to build a custom handler, a completely separate asmx service (ala this approach), or to build a custom controller (similar to this custom Web API controller method).
Overriding or replacing the default pipeline processors for the itemWebApi does not seem viable, as I don't want to replace/modify the OOB API if I can avoid it.
Has anyone with the same type of requirement for Sitecore 8 found a better approach?
The approach I chose was to create a separate service "router" developed using the adapter pattern to be consumed by our mobile app clients. The router in turn calls the Sitecore ItemWebApi.
This fit my needs the best as it is completely decoupled from the Sitecore application and the client can be modified if necessary without impacting the endpoint.
It would also be worth looking to EntityService within Sitecore.Services.Client in Sitecore 8. Its a Web API based service but has more flexibility over the standard Sitecore Item Web API because you can define your model and the business logic yourself.
I can see you have mention my other blog post on adding a custom Web API controller. Enitity Service is different, it's a framework by Sitecore to achieve a standard way of creating custom web service for Sitecore.
I have written a blog post on EntityService. It has both a Javascript and standard rest based API to communicate with the service too.
http://mikerobbins.co.uk/2015/01/06/entityservice-sitecore-service-client/
Example Application here: https://github.com/sobek1985/EntityServiceDemo
And a few more posts on advanced features in Entity Service: http://mikerobbins.co.uk/category/sitecore/sitecore-service-client/

Difference between portlet and a webservice

I am not sure if I am comparing onion with a cabbage. But I am really confused with the portlet and a web service. I know that web service is making your software components in your application as a service to other applications but to me it is similar to a portlet responding to requests. I know that my understanding is making you(Portlet & SAAS developers) really upset. But I need some clarity on this.
Why cannot I use the request-response to portlet work similar to a web service?
If yes, what is the benefit I get in using a web service than a portlet?
If not, then what are portlets lacking to act as a web service?
I am a newbie in portlet development. Please dont curse me for this question.
Please suggest.
EDIT:
Most of the answer say that the portlet is a UI component. My customer has requested me to create a webservice in liferay. So is it to make a portlet as a web service? If yes, can you please provide a pointer or some code snippet?
Addressing your 'edit' specifically with regards to Liferay...
Liferay plugin projects can expose web services without too much work.
The Liferay Service Builder actually has facilities so you can create SOAP web services or JSON web services backed by tables in the Liferay database (and that make queries on existing database tables). In the case of JSON web services, the URL scheme generated is not RESTful (unfortunately), but it is well defined. With a bit of work on your part you can impose Liferay's permission system on web service calls as well.
Here's a reasonable starting point in the Liferay Developer's Guide:
See the links on that page to SOAP and JSON services.
Note that a 'portlet' is only one type of Liferay plugin. The web service facility is part of the service layer - which can be used by many plugin types. So there isn't necessarily a portlet involved in creating a web service in Liferay, you can make a web service that has no visual component associated with it.
Portlets are areas you create to add and display content. Portlets can be added to the left and right of the center body area and can contain myriad content ranging from news, events, calendars, RSS feeds, collections, plain text, and more. Also, you can set properties and policies for showing the portlets.
you want to use portlet when
You have content you want to have special focus, like news.
You need to specify the configuration data for an item. - i.e. number of entries to show.
You want to give the content editors a choice about when and where to display content.
You'd like to show it only to some groups or users.
On the other hand, web services:
Enables applications to expose their services
“progammatically”, i.e. the services can be invoked by programs
Enables software running on other computers (could be a desktop, mobile phone, PDA, etc.) to invoke operations exposed by Web applications
if you are trying to identify the main difference portal historically, the portlets have three layers architechture (client, middle tier, backend) this cause two weakness:
Different portal groups have no well established way of sharing services
Different technologies(Java, Perl, CORBA, EJB) in middle tier.
Different protocols(GRAM, IIOP,...)
Consequently, lots of redundancy, reinvention
Example: batch script generation
so Web services address the service sharing problem and reduces the redundancy.
source1 source2 source3
Portlets are meant to be a user interface component in a portal solution.
Web Services provide functionality to remotely interact with a system commonly using SOAP, REST, JMS or other related
They provide completely separate functions. The closest you get is the serveResource method in portlets. This functionality is used to serve various types of content from a portlet (such as a PDF document or an AJAX response) without the need to perform a full page request.

Microsoft Dynamics CRM -- Do people build websites with it?

Forgive my ignorance, but do people build websites with Microsoft Dynamics CRM?
I have a potential client who says that is the technology they will use for a new web project, for which I would be doing the HTML templating. I want to learn all I can as I am new to this particular system, but I can't seem to find anything related to web building and CRM. Is it more likely the client is using another piece of technology that they are neglecting to tell us about?
Any experience or insight about this process is greatly appreciated!
You can't build website using MSCRM, but you can build ASP.Net website using CRM content easily. The API provided by MSCRM is a set of web services, that can be queried in a website to populate pages content.
Also, you can directly query the Database if you want ReadOnly content, and only for read-only content, because it is not supported to update/create data using SQL connections.
Note that it's required to have the external connector license to use any data in the CRM, thru the API and even thru direct SQL queries.
I have built a website using .NET, utilising the CRM4 API and database. All the website did was to submit queries to CRM using the CRM web services and metadata web services, and get data back. This company was already using CRM for their back end, so it's much easier for the front end to use the same database as well since it's a simple one.
The alternative would be to create an intermediate connector between the 2 systems -- backend and front end, which is not as efficient (for our case anyway).