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="" xmlns:xsi="" xmlns:xsd="">
        <User.GetClientsResponse xmlns="">
            <User.GetClientsResult xsi:type="ArrayOfClient">
                    <Name>Client Test 1</Name>
                    <Name>Client Test 2</Name>
                    <Name>Client Test 3</Name>

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?


jamesd jamesd, 7 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, 7 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.

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free