cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

2005 Commerce extending ycommercewebservices

Former Member
0 Kudos
2,440

With the latest version of platform, V2005, and using CX recipe I was able to put together a working version of platform with all of the web services require for Spartacus B2B storefront. Everything worked and I was able to place orders. I can see that the web services for B2b were available and worked like a charm. B2b order, B2b Org, etc. all working and available. this was done using the recipe and following for modulegen:

https://help.sap.com/viewer/4c33bf189ab9409e84e589295c36d96e/2005/en-US/8ace75c786691014a5e9dcafa29d...

I have been trying to create a custom version of web services following this mini guide
https://help.sap.com/viewer/9d346683b0084da2938be8a285c0c27a/1905/en-US/8ba212a886691014ba63d7684506...

It does not work at all. Anything going back to the OCC fails. For some reason the services are not extending to the custom extension. What I mean is that my services are on /xyz when I try to access OCC on this link it fails.

This works without custom web service extension
https://localhost:9002/occ/v2/powertools-spa/cms/pages

This with custom extension does not:
https://localhost:9002/xyz/v2/powertools-spa/cms/pages

I am sure something somewhere has changed, and from the looks of it I dont need to extend ycommercewebservices. Looking at the yoccaddon extension I created another extension and breifly tried it. Adding that to the localextension.xml required me to add ycommercewebservices extension which resulted in spring bean conflicts:

BeanNotOfRequiredTypeException: Bean named 'commerceStockFacade' is expected to be of type 'de.hybris.platform.commercewebservices.core.stock.CommerceStockFacade' but was actually of type 'de.hybris.platform.ycommercewebservices.stock.impl.DefaultCommerceStockFacade'

I am at a loss trying to understand how to make it work and create custom OCC web services. Any help would be greatly appriciated.

Ali

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member

OK I think I get it. In the rearchitecture world of OCC there is no need to extend ycommercewebservices. All we need to do is create a new occ extension with a name that ends in occ (xyzocc for example). Any end point defined in this extension is then pulled in by the comemrcewebservices extension using

<import resource="classpath*:/occ/v2/*occ/web/spring/*-web-spring.xml"/>

So this new OCC extension that we need to create, do we use yocc extention as a templte?

sasethia
Explorer
0 Kudos

Yes, you can use "yocc" as the template extension to create your "customocc" extension. The "customocc" extension can have a dependency on the commercewebservices extension.

Former Member
0 Kudos

Thanks for clarifying the naming convention engintr How about ycommerceaccelerator? the mini guide is not much different for 2005 version

https://help.sap.com/viewer/9d346683b0084da2938be8a285c0c27a/2005/en-US/8ba212a886691014ba63d7684506...

This is the part that is not working. When I create a custom extension and add it in the platform as listed in the guide the /myws part does not work and calls going back the server fail.

<extensioninfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="extensioninfo.xsd">

   <extension  name="mycommercewebservices"
               abstractclassprefix="Generated"
               classprefix="Ymycommercewebservices"
               >

		<requires-extension name="commercefacades"/>
		<requires-extension name="commerceservices"/>
		<webmodule jspcompile="false" webroot="/myws"/>

	</extension>
      
</extensioninfo>
engintr
Explorer
0 Kudos

Hi Muhammad,

It seems like you are using the new occ endpoint (/occ) instead of the old one (/rest).
The mini-guide you mentioned is for version 1905.


Please take a look at this one: https://help.sap.com/viewer/9d346683b0084da2938be8a285c0c27a/2005/en-US/d46d19516961438f8939718e87ed...
There, it states that the OCC Extension name must end with occ, like xyzocc.

Also I believe you have to choose yocc as template when doing extgen.

https://help.sap.com/viewer/9d346683b0084da2938be8a285c0c27a/2005/en-US/9136088a207c4fc1bb5ec2b53c46...