Include WebService

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi Team,

I am new to nopCommerce and I am trying to get an understanding of the code.

I have a scenario where I want to refer to a web service and display some data.

In such scenario, I would like to know, which project I should use as per the structured  nopCommerce source code architecture?

Should I use the Presentation and add a web reference in Nop.Web and Nop.Admin or should I use some core classes?

Please suggest.

Thank You.
11 years ago
archie1585 wrote:
Hi Team,

I am new to nopCommerce and I am trying to get an understanding of the code.

I have a scenario where I want to refer to a web service and display some data.

In such scenario, I would like to know, which project I should use as per the structured  nopCommerce source code architecture?

Should I use the Presentation and add a web reference in Nop.Web and Nop.Admin or should I use some core classes?

Please suggest.

Thank You.


Which version are you using? You might find a project named 'Nop.Plugin.Misc.WebServices', which does something similar as requested. Extend the plugin, and you are good to go! :D
11 years ago
Thanks for u r reply.

I am using 2.65 version.

I need to add a new webservice. And I would like to call the webmethod of this service in Nop.Web.

So Adding a web service can be done in Nop.Plugin.Misc.WebServices.

Then, I should add a web reference in Nop.Web and call the method from my controller.

Is my understanding correct?

I want to know the process in which I can add and consume web service in NopCommerce code because the code is so well-organised and i dont want to disturb the flow or the framework and architecture.

Please suggest.

Thank You.
11 years ago
archie1585 wrote:
Thanks for u r reply.

I am using 2.65 version.

I need to add a new webservice. And I would like to call the webmethod of this service in Nop.Web.

So Adding a web service can be done in Nop.Plugin.Misc.WebServices.

Then, I should add a web reference in Nop.Web and call the method from my controller.

Is my understanding correct?

I want to know the process in which I can add and consume web service in NopCommerce code because the code is so well-organised and i dont want to disturb the flow or the framework and architecture.

Please suggest.

Thank You.


You can create a plugin that exposes services, and a separate plugin that consume it, then you don't need to (or have very little intervention) mess up the original source code. :D
11 years ago
I suggest adding a new class in project Nop.Services (and call your webservice from there) and then from your controller in Nop.Web call your new service class, then create a viewmodel and return a view
11 years ago
keesjan wrote:
I suggest adding a new class in project Nop.Services (and call your webservice from there) and then from your controller in Nop.Web call your new service class, then create a viewmodel and return a view

Hello,

I'm interested in consuming a web service also and eventually displaying the results in a view.

When you say to create a new class, should it be at the root of Nop.Services or in one of the folders?

Any help would be gratefully appreciated.

Thanks,
Tony
11 years ago
Hi,

This is what I have done.

I have a web service and its URL. I have created a plugin and added web reference in that plugin.

To create a Plugin, Refer: https://www.nopcommerce.com/docs/77/how-to-write-a-nopcommerce-plugin.aspx

In the same plugin, in my view.. I am displaying the data from web service.

This plugin will be called from Nop.Web.




Thanks.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.