Search code examples
springrestweb-servicessap-commerce-cloudwebservices-client

Create a web service client in Hybris


Im new in Hybris and I need to build a web service client that consumes a web service rest.

Someone have an example? or something that give me an idea, I dont know if is the same like build a web service client in spring.

Thank you.


Solution

  • For REST you can use the default Spring framework for rest client. See this tutorial. here You can create a new extension or use one of yours. See below for more info.

    I used Apache Axis2 for consuming the WSDL (the web service). There are a lot of examples and tutorials on the internet for this. It can easily be integrated in Hybris.

    • The clearest solution is to create another extension using extgen . Some tips here . You have to modify other the extensioninfo.xml file of the other extension, where you want to use the client. (more info in the link above).
    • The easiest solution is to just add the axis2 lib to the extension you want to handle the client and use it there. If you want to play around and test it as a prove of concept, you can do that. Later you can move it to a separate extension.