How to call and use Rest full services in codegnighter - codeigniter

Actually I am working on codegnighter and I want to use Restful xml service at place of database in my project but I don't know is there any default methods or functions of codegnighter to get the xml or restful service response.
Please help me
thanks.

Phil Sturgeon's REST_Controller is a good place to start.

Related

SpringBoot SOAP without XSD file

First time to code a SOAP (and as a producer) in the same SpringBoot REST codebase.
With a simple Google search am able to do a quick refresher about SOAP:
https://www.baeldung.com/spring-boot-soap-web-service
https://spring.io/guides/gs/producing-web-service/
https://dzone.com/articles/creating-a-soap-web-service-with-spring-boot-start
That said, all tutorials requires to create an "XSD" file.
"Is there a way to create a producer SOAP without supplying the XSD file with SpringBoot?"
is the main question. As I haven't seen any tutorial not following the contract-first approach.
Also, have sub-questions that doesn't sound well for me:
Namespace, should this be PROD url or could be dynamic URL?
PortTypeName, any info what's this for?
LocationUri, is it similar to REST controller as the class request mapping url?
Schema, can this be done via Java beans only without any XSD/XML file through SpringBoot?
Apologies to ask many noob questions, but highly appreciate any informative answers.

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.
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.

When to use models vs service in Laravel?

I have been using for a while but still I am confuse on what to include in my controllers specifically "When should I use Model and When to Use Service"?
I am confused if I am making the right thing.
I would suggest to never use models directly into the controllers.. Adopt the repository-pattern which enables the use of dependency injection of services into the controller.. Use Service Layer to contain the business logic.. In this way all the related codes would be onto similar layer.
Reference for repository pattern:
http://heera.it/laravel-repository-pattern#.VuJcVfl97cs
Please don't use model directly in your controller, unless if you are building a very simple application but for a large application, it would be good to use a repository. Kindly take a look at this tutorial https://bosnadev.com/2015/03/07/using-repository-pattern-in-laravel-5/

Spring mvc - get data from other server, what object to use and how to reuse it?

I have some url that I need to read data from there and use it in my controller.
Usually in java application I use http client, to get data from some url.
My questions are:
What object to use in spring mvc to get data from some url (like http client) ?
How to reuse this objects, so every time not to create it ?
Thank you!
In agreement with the comment by #Evgeny and #Beau above, you can use any client library you like. HttpClient is VERY bean friendly and, for cases where it might be difficult to construct the configuration, you can always provide a Spring factory bean to construct the object.
If you are looking to abstract away the plumbing of the HttpClient API usage, utilize the RestTemplate suggested by #Evgeny (I believe that it is also his brainchild) It is a VERY rich and simple API to leverage.

PUT method in jersey

I am new to Restful webservice. When I was going through the tutorials, I saw that PUT method can be used to create the resource. the creation means adding into the database or somewhere by implementing our own effort? or will Jersey take care of creating the resource its own?
Sorry for asking silly questions.. I did not get the way what PUT is doing..
Thanks
Bhanu
Jersey won't do anything except you tell it to. A PUT request semantically should create or update a ressource, so if you plan to create some entity, thats the HTTP method to use. Use #PUT to annotate your method and implement your functionality (as your tutorials tell you).

Resources