Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

org.simple4j:WSClient

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

org.simple4j:WSClient

This is a simple Web Service Client library to call wide variety of web service behind HTTP. In theory it can support any interface or payload. On the request side, to convert java object to HTTP request components (URL, headers, body), templating is used which allows it to call XML, JSON, SOAP, REST or anyother custom interface. On the response side, it uses pluggable parser and a mapper to only extract the fields that are of interest for the client program. The parser currently supports JSON and XML and returns a collections tree.

  • 24.09.19.2
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

WSClient

Simple4j WSClient is a generic web service client that can be used for all types of data exchanges (XML, JSON, SOAP, REST and more) over both http and https protocols. Many of the data marshallers and parsers adds heavier dependency between client and server components for stricter type. This can result in tight coupling of web services and its client, defeating the purpose of the creation of web service technology.

WSClient focuses on loose coupling by using templating on the request marshaling side opening up the possibility to even any non-standard format. On the response side, it uses generic parsing of XML and JSON to nested Java Collections object tree. It also support custom parsing of any non-standard response formats other than XML and JSON. This flexible and configurable design allows easy adaptability and maintainability of client application without making any code change even if the interface changes on the server side.

Currently, Freemarker, Velocity and a custom simple templates are being supported. This can be extended from IFormatter class if other template engines are needed. The IFormatter instance can be used for generation of HTTP request URL, headers and body.

On the response parsing side, XML and JSON are supported and it can be extended from IParser for any additional support. If the response body has lot of nested attributes, custom retrieval can be configured (Caller.responseBodyToCustomFieldMapping) using nested wildcardable paths.

The entry point for the client code is org.simple4j.wsclient.caller.Caller.call

Sample code showing how to configure and use various capabilities of the framework can be found in test cases. The test cases use WireMock to have a mock web service. The client code is configured and executed from the test cases.

Test cases from simple to complex case.

  • ConnectionConfigTest
  • MethodsTest
  • RequestObjectTypeTest
  • ResponseObjectTypeTest

We strongly believe that the binary and configuration should be physically separate after application deployment. The configuration files should be kept a plain file structure for easy manual updates and not be bundled in an archive. This gives tremendous flexibility to modify application behaviour just by doing simpler configuration changes. Because of the above belief, this project is and will be free of Spring annotations. This also removes strong widespread dependency on Spring framework.

FAQs

Package last updated on 28 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc