Coder Social home page Coder Social logo

simple-soap-client's Introduction

Simple SOAP client

Simple, lightweight SOAP client implemented in Java.

Maven Central CI Test coverage CodeQL


Features

  • Send SOAP requests - Sends a SOAP request XML and returns the response as string
  • Basic XML utilities - Basic XML parsing included to parse the response and extract values
  • Simple and lightweight - No dependencies needed, uses Java's HttpURLConnection to handle HTTP, and org.w3c.dom, org.xml.sax and javax.xml packages to handle XML parsing

Usage

// Create a client for a specific SOAP operation
SimpleSoapClient client = new SimpleSoapClientImpl("http://www.dneonline.com/calculator", "http://tempuri.org",
        "Add");

// Send a request XML file (the service you wish to use should provide a service description where you can get
// a template XML, and fill the parameters you need), and get the response XML as string:
String response = client.sendSoapRequest(new File("src/test/resources/requestExample.xml"));

// Use the provided XmlUtilities to parse the response string and get the text value of a field
String textContent = XmlUtilities.getTextContentOfXmlElement(XmlUtilities.xmlStringToDocument(response),
        "AddResult")

Building

Use maven to build the project locally.

Meta

Authors

yevgenykuz

License

MIT License

Release instructions

To publish artifacts to central maven repository via Sonatype OSSRH, do the following:

  • Create a maven master password:
mvn --encrypt-master-password
# Enter password to encrypt when prompted
# Save encrypted password in /.m2/settings-security.xml:
<settingsSecurity>
  <master>ENCRYPTED_MASTER_PASSWORD</master>
</settingsSecurity>
  • Configure maven to publish when the ossrh-release profile is used:
# Encrypt passwords for OSSRH website and for your GPG key:
mvn --encrypt-password
# Enter password to encrypt when prompted, encrypted password will be printed to stdout
# Get public GPG key:
gpg --list-keys --keyid-format LONG
# Copy the key ID from: "pub   rsa4096/<GPG_KEY_ID>"
# Add configuration in /.m2/settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>ossrh</id>
      <username>OSSRH_WEBSITE_USER</username>
      <password>OSSRH_WEBSITE_PASS</password>
    </server>
    <server>
      <id>GPG_KEY_ID</id>
      <passphrase>GPG_KEY_PASS</passphrase>
    </server>
  </servers>
  <profiles>
    <profile>
      <id>ossrh-release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <gpg.keyname>GPG_KEY_ID</gpg.keyname>
      </properties>
    </profile>
  </profiles>
</settings>
  • Remove -SNAPSHOT from version, commit and tag, and deploy with mvn -Possrh-release deploy.
  • Bump version and add -SNAPSHOT, commit and push.
  • Create a new release in github with the latest tag.

simple-soap-client's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar yevgenykuz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fpferri

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.