WCF support in nop 2.1

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hey, I'm using nopcommerce 2.1. I need develop a .Net application in order to update products in Nop from data stored in my asctual ERP. There is a WCF service in Nop i can use for this?
12 years ago
jmbusquets wrote:
Hey, I'm using nopcommerce 2.1. I need develop a .Net application in order to update products in Nop from data stored in my asctual ERP. There is a WCF service in Nop i can use for this?


I don't believe web services have been created for nopCommerce yet. You could create your own web services that takes advantage of the nop commerce tasks, services, and repositories. If you're familiar with WCF and the 2.x nopCommerce code base you should be able to get a service up and running in a week or two (conservative estimate).

I hope this helps.
12 years ago
I'm already using wcf service in nop, but I had no time to share it.
Perhaps I can help you to start?

Here are actual specifictions :
- nop 2.1 plugin
- uses https
- uses gzip compression
- uses nop authentification and roles
- expose some standard methods like AddOrderNote, DeleteOrders, SetOrderPaymentPaid etc
- expose specials methods like ExecuteNonQuery, ExecuteDataSet etc


Here are limitation
- need to create one .svc file (not a bit problem but should be in the plugin - I will find a solution...)
- need to add sections in web.config (should be done by code IN the plugin...)
- some developments have been made with my feets...


The plugin is called Vishnu, because it has many arms!

Someone interested to use AND share improvements?
12 years ago
nicolas.muniere wrote:
I'm already using wcf service in nop, but I had no time to share it.
Perhaps I can help you to start?

Here are actual specifictions :
- nop 2.1 plugin
- uses https
- uses gzip compression
- uses nop authentification and roles
- expose some standard methods like AddOrderNote, DeleteOrders, SetOrderPaymentPaid etc
- expose specials methods like ExecuteNonQuery, ExecuteDataSet etc


Here are limitation
- need to create one .svc file (not a bit problem but should be in the plugin - I will find a solution...)
- need to add sections in web.config (should be done by code IN the plugin...)
- some developments have been made with my feets...


The plugin is called Vishnu, because it has many arms!

Someone interested to use AND share improvements?


Nicolas great post! One thing to note that the .svc file is not actually a limitation. There is a way to register a route and hand it off to the web service module. I've done it before in my previous mvc3 application. Once I find a link I'll post it here. All it should take is some changes to the route provider.
12 years ago
Thanks, it would be perfect!
12 years ago
nicolas.muniere wrote:
Someone interested to use AND share improvements?

Hi Nicolas,

I would be great if you can share it. It can be used as a start point for us.
12 years ago
OK, the download page is here :

http://www.muniere.fr/espace-perso/partage-de-fichiers.aspx


step 1 - incule the plugin in your project
step 2 - extract remote folder in nop.web application
step 3 - check that GZipEncoder reference is ok, if not you con find it on my download page. Need local copy for tis reference
step 4 - incude this in your nop.web  web.config file


  <system.serviceModel>
    <extensions>
      <bindingElementExtensions>
        <add name="gzipMessageEncoding" type="Microsoft.Samples.GZipEncoder.GZipMessageEncodingElement, GZipEncoder, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" />
      </bindingElementExtensions>
    </extensions>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <behaviors>
      <serviceBehaviors>
        <behavior name="LotOfObjectsBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <bindings>
      <wsHttpBinding>
        <binding name="HttpsBigMessage" receiveTimeout="20:10:00" sendTimeout="20:10:00" maxReceivedMessageSize="2147483647">
          <security mode="Transport">
            <transport clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
      <customBinding>
        <binding name="HttpsGZipBigMessage" receiveTimeout="20:10:00" sendTimeout="20:10:00">
          <gzipMessageEncoding innerMessageEncoding="textMessageEncoding" />
          <transactionFlow />
          <httpsTransport maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
        </binding>
      </customBinding>

    </bindings>

    <services>

      <service name="Nop.Plugin.Remote.Vishnu.VishnuService" behaviorConfiguration="LotOfObjectsBehavior">
        <!-- This endpoint is exposed at the base address provided by host http://ebene.amazonie.priv/Remote/VishnuService.svc  -->
        <endpoint address=""
                  binding="customBinding" bindingConfiguration="HttpsGZipBigMessage"
                  contract="Nop.Plugin.Remote.Vishnu.IVishnuService" />
        <!-- The mex endpoint is explosed at http://ebene.amazonie.priv/Remote/VishnuService.svc/mex -->
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>


      <service name="System.Web.ApplicationServices.AuthenticationService" behaviorConfiguration="LotOfObjectsBehavior" >
        <!-- This endpoint is exposed at the base address provided by host http://ebene.amazonie.priv/Remote/NopAuthenticationService.svc  -->
        <endpoint
                binding="wsHttpBinding" bindingConfiguration="HttpsBigMessage"
                contract="System.Web.ApplicationServices.AuthenticationService" />
      </service>

    </services>
  </system.serviceModel>
  <system.web.extensions>
    <scripting>
      <webServices>
        <!--Activation obligatoire du service d'authentifaction, même si on a mappé un service personnalisé-->
        <authenticationService enabled="true" requireSSL="true" />
      </webServices>
    </scripting>
  </system.web.extensions>

12 years ago
Nicolas,

Great! Thanks a lot! BTW, it would be great if you upload it to Extensions section with some description. Here are some instructions if you're interested
12 years ago
In the plugin, you will find OrderFlag record, map, context etc.
Theses flags are used to complete order processing workflow, for a specific application also called Vishnu, you can find screenshot on the same download page.

Two goals for OrderFlag:
- First goal is to help persons in charge of expedition, they need to mark some orders because they seems to be fraud, or they are out of stok, or they started to process them, this is flagid, flagedby and flagedon properties

- Second goal is to mark orders who have been exported to sage, ebp or any other software, this is exportedon and exportedby properties

I think theses concepts could be developped in next release of nop commerce, while processing an order can be complex and composed of many sub tasks.
12 years ago
a.m. wrote:
Nicolas,

Great! Thanks a lot! BTW, it would be great if you upload it to Extensions section with some description. Here are some instructions if you're interested


Thanks, I think it's to early for this, it's a base but it needs to be finished.
what we need to do:
- removes all 'out of plugin' operation (svc files, web.config sections) so it could be used by non-developpers guys
- replace web.config sections by admin area
- replace svc files by servicehost usage (I tried with IAutoStart but start is never lauched :( )
- removes or integrate in nop my specific code to manage order flags...

I have never participate in a real open source project, what would be the best way to share it for further developpement? Codeplex? Is it complicated
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.