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.
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.
Related
Could anyone please explain the difference between application and integration service in IIB. I have referred through documentation but it was not clear. For example, if I have to create a service based on wsdl which has some 3 operations.Should I create it as integration service or application.Please suggest
So with an Application it's roll your own in that you have to build everything.
With an Integration Service you can import a WSDL and the framework of your flow will be generated for you.
So if you are being given WSDL's for the services you want to build then using an IS may be the way to go.
Personally I don't like some of the aspects of the generated code but that's me. I'm currently working on a project that uses REST API's and am using the REST API project option for my projects and it generates code.
I'm developing a set of MULE 3.7.0 app projects under a MULE domain project which contains a set of shared parameters for all these apps and I need to consume an external webservice before any of the apps is loaded in order to get an additional parameter which is needed for all the apps and also for the domain itself.
As there are no flows in the domain project, I don't know how to achieve this.
Can this be done? If so, how? Maybe a bean-oriented approach?
Any help will be much appreciated.
As per problem description provide here, you can go for Spring bean approach to achieve this. Check out similar post below.
mule - how to run code on starting mule (server listener)
Let me know if still facing any issues.
I have been searching for an example Spring Webservice which is being protected using oauth 2.0..
Looking around I found https://github.com/spring-projects/spring-security-oauth/tree/master/samples/oauth2 but there some files seems to be missing from the project.
Two things that I am looking for is :
When user authenticates, user name and password goes to /login.do , now I can not understand how this Servlet is being configured, if its not controller. web.xml is missing.
When I try to see how beans configured then applicationContext.xml is also missing. I am not able to find those files in order to see how things are configured.
Help Required :
Should I use annotation in order to configure my web service or xml configuration. I am willing to use the latest version, and leverage advanced configurations, for better security.
I have another Single page application ( HTML5 ) , which accesses data from this spring web service, which is being hosted on Google App Engine. My ultimate objective is to create a chrome plugin of (html5) pages and use my service from there..
Please suggest a better path so that I can achieve my objectives.
Best regards,
Shashank Pratap
Apologize for late reply.
1) Regarding Oauth2.0 implementation : Since GAE does not support Servlet 3.0 therefore, developer is restricted to servlet 2.5. Therefore I found that we are restricted to 1.0.5.RELEASE. I was able to configure it successfully.
Best Practice on GAE : Rather than following this approach, I would suggest others to use Google Endpoints. As it supports oauth2.0 as well as we can develop REST API relatively quickly.
Scale ability and Response time : Since I was using Spring dependency injection along with spring security, application responded slower than the combination of Google Endpoints and Google Juice, as juice does injection just in time, where as spring prepares everything as soon as new instance starts, which created problem for me.
2) Chrome Plugin is completely different story. :-)
Please correct if I am wrong.
Thanks,
Shashank Pratap
I've developed a pretty extensive rest API using restlet, but now I need to serve web pages. I've looking into the play framework and it seems like a pretty good solution to my problem. There's a lot of code to share so I'd like to have both running from the same server/jvm (for eventual deployment on Heroku.
Is it possible to configure the application server, like jetty, to split the calls up based on URL path to go to either restlet or play? If so how? Do I start with a play project or a restlet project, and how do I modify it?
thanks!
There are several options here
You could use a fronted Apache layer, so that you can completely separate the Restlet part from your Play part. As you are deploying to Heroku though, I am not sure if you will be able to do this as Heroku doesn't give you a fronted http layer
Modify the HTTP handler. This would involve creating your own module or modifying the core source of Play. This certainly would solve your use case, but I don't think modifying core is a great answer, and the module approach is quite overkill.
Using Play 1.x you could have a single controller action for all your Restlet API that simply calls your Restlet services. In Play 2.x you can use the Global object onRouteRequest method.
If you are thinking of deploying to a PaaS like Heroku, I think I would go with option 3.
I've got a Spring MVC application and I've decided that I'd like to try using GWT for the front end. I'd like to continue using MVC as I'll also be using Spring Security and some other springy stuff.
I'm aware of the GWT-SL project, and I guess I'll use it. The documentation is light on examples unfortunately.
What I'm wondering now is.... how do I reconfigure my project so that I can use GWT? I'm assuming that I'll lose the ability to run in hosted mode, and I suppose that's ok. Do I just add the GWT and GWT-SL jars, reconfigure my web.xml, and add a package to my project for the GWT code?
I'm using Eclipse 3.4. My existing project is standard web project.
With the new version of the GWT plugin, you'd have all the benefits of the hosted mode browser without having to modify any options. The GWTHandler from the GWT-SL will take care of your rpc call mapping. However, you will have a problem with your existing domain objects structure. You will either have to put them in GWT's 'client' package, or mirror your existing domain objects to enable them to be compiled to javascript. I have been looking for a stable non-invasive framework for doing this, but have yet to find one. Gilead looks promising, but you will have to extend its classes on your domain.
I have posted a view month ago my simple project (3 classes) how to integrate GWT with existing Spring MVC application. Simple sample also provided.
Try it, it is clear and simple: http://code.google.com/p/gspring.
You won't lose hosted mode. I don't know if you're using the internal server for that - I use -noserver so I can't help you there.
Other than that, I guess the documentation is quite clear. Have you hit any specific problems?