FuelSDK-Java icon indicating copy to clipboard operation
FuelSDK-Java copied to clipboard

Initializing ETClient for REST connection requires CXF

Open eranbetzalel opened this issue 10 years ago • 6 comments

I think the following code should do the trick:

public ETSoapConnection getSoapConnection() throws ETSdkException{
        if (soapConnection == null) {
            if (soapEndpoint == null) {
                String response = restConnection.get(PATH_ENDPOINTS_SOAP);
                JsonParser jsonParser = new JsonParser();
                JsonObject jsonObject = jsonParser.parse(response).getAsJsonObject();
                soapEndpoint = jsonObject.get("url").getAsString();
                logger.debug("SOAP endpoint: " + soapEndpoint);
            }

            soapConnection = new ETSoapConnection(this, soapEndpoint);
        }

        return soapConnection;
    }

eranbetzalel avatar Jan 14 '15 15:01 eranbetzalel

I'm not sure I'm following--are you suggesting it should be possible to initialize the client library such that CXF isn't required when you're using it purely for REST? -ian

imurdock avatar Jan 29 '15 22:01 imurdock

Why is the CXF dependency not listed in the README as one of the required dependencies for the SDK jar to run? I am looking for a way to bring in the necessary dependencies while still keeping the dependency profile small, because I am running into problems with the jetty and spring dependencies of CXF when I allow all of fuel-java transitive dependencies to be brought in.

josephnoall avatar Aug 13 '15 18:08 josephnoall

I'm adding this as an enhancement for v1.2: In v1.2, CXF will be optional--the SDK will read and write SOAP envelopes natively. -ian

imurdock avatar Sep 14 '15 02:09 imurdock

In the meantime I have added the CXF dependency to the README. -ian

imurdock avatar Sep 14 '15 02:09 imurdock

Yes, I only needed REST, so I altered the code to support only one at a time.

eranbetzalel avatar Sep 15 '15 09:09 eranbetzalel

Please consider providing two different artifacts for using either REST or SOAP in future. The SOAP client is really very clumsy and pulls in gigabytes of dependencies.

Geooorg avatar Nov 11 '16 16:11 Geooorg