flectSoap

Return to index link to github

Overview

JavaDoc

This is a simple SOAP client for Java.

This is a full scratch implementation of SOAP.(Not depend on Apache Axis or Apache SOAP)


Sample

This is a sample code to login Salesforce.

(If you want to use Salesforce SOAP API, it is easier to use flectSalesforce.)

    SoapClient client = new SoapClient(new File("partner.wsdl"));
    
    //Input parameters are set in java.util.Map.
    //Its structure is same as SOAP body.
    //You can set values in the deep position by using ExtendedMap.
    ExtendedMap input = new ExtendedMap(true);
    input.putDeep("login.username", SALESFORCE_USERNAME);
    input.putDeep("login.password", SALESFORCE_PASSWORD + SALESFORCE_SECRET);
    
    /*
    //Above code is same as this.
    Map input = new HashMap();
    Map loginEl = new HashMap();
    loginEl.put("username", SALESFORCE_USERNAME);
    loginEl.put("password", SALESFORCE_PASSWORD + SALESFORCE_SECRET);
    input.put("login", loginEl);
    */
    
    //Invoke method
    SoapResponse res = client.invoke("login", null, input);
    ExtendedMap output = res.getAsMap();
    String sessionId = (String)output.getDeep("loginResponse.result.sessionId");
    String endpont = (String)output.getDeep("loginResponse.result.serverUrl");
    client.setEndpoint(endpoint);

Latest release

Download - 1.2.1

Maven

    <repositories>
        <repository>
            <id>jp.co.flect</id>
            <name>FLECT maven repository</name>
            <url>http://flect.github.io/maven-repo/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>jp.co.flect</groupId>
            <artifactId>flectSoap</artifactId>
            <version>1.2.1</version>
        </dependency>
    </dependencies>

License

MIT

商用利用を公式サポートする有償版のご用意があります。

詳細は info@flect.co.jp にお問い合わせください。