Problem getting response data using Java wrapper

Hi guys.

I trying the Java wrapper to make calls to Campaign Monitor API and I have some strange behaviour.

First of all, I had to compile the source code using Java 1.5 since my environment is using Java 1.5.  The jar file from github is compiled using Java 1.6.

Here's my problem:
I have 3 clients in my Campaign Monitor dashboard.

I use the API to call the "getClients" method using the SOAP Api.  This method returns all clients from my Campaign Monitor dashboard.  I make the call and I receive an instance of "UserGetClientsresponse" object.  To retrieve the data from the response, I call getUserGetClientsResult from the "UserGetClientsresponse" instance.  That should return me an instance of "ArrayOfClient".  Instead, I'm getting an instance of "ElementNSImpl" that output "[User.GetClientsResult: null]".  So I don't get any data.

I used Wireshark to sniff out request going to and coming from Campaign Monitor and the content is fine.  I can see the data from the response.  Here the response I'm getting:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <User.GetClientsResponse xmlns="http://api.createsend.com/api/">
            <User.GetClientsResult xsi:type="ArrayOfClient">
                <Client>
                    <ClientID>13e8d61d7b150cd22e7958fd78d4333a</ClientID>
                    <Name>Client Test 1</Name>
                </Client>
                <Client>
                    <ClientID>00179b291090f2ce395d0cda5d8e19ff</ClientID>
                    <Name>Client Test 2</Name>
                </Client>
                <Client>
                    <ClientID>813ece8efb35dc16768e51fb7e41b330</ClientID>
                    <Name>Client Test 3</Name>
                </Client>
            </User.GetClientsResult>
        </User.GetClientsResponse>
    </soap:Body></soap:Envelope>

I suppose that everything is fine between the communication.  The problem seems to come from the Java Wrapper.

I tried other "get*" calls with the same result.

I tried the "createClient" call and everything went fine.  The client was created on Campaign Monitor and the api call returned me the API Client Id correctly.

Anyone already got a similar problem that could help me out?

Regards,

jamesd jamesd, 6 years ago

Hi Billy,

I believe I've just replied to your support request about this. I've added a wrapper method for User.GetClients and don't see a problem under Java 1.6, which suggests that there could be a problem with the re-compiled version for Java 1.5.

You'd probably be best to try re-generating the proxy classes under Java 1.5 using maven. The README file within the wsdl-tools directory has brief instructions on how this can be done.

Hi James.

I downloaded the source files and compiled them using my IDE.  I guess that should do the same result as using Maven.  I tried to re-generate the proxy classes using Maven, but I'm getting an error when executing the wsimport command.  The problem is the Java version.  When I re-generate the proxy classes using Java 1.6, that works, but not in Java 1.5

jamesd jamesd, 6 years ago

I haven't had a chance to try re-generating the proxy classes under Java 1.5 and it's hard to tell what the problem is if you don't provide details of the error you are experiencing.

If you do figure it out, feel free to fork the repository and make a pull request with the changes that fix it for Java 1.5.

Hi James.

Other than what I already said in the first post, I don't know what else I could give you.  Could you help me out on what you would need to figure this out?

Thanks for your time.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098