Soap from Java?

Hi all,

Does anyone have an example, or know if its possible, to connect to MailBulid via Soap from Java.

I want to push our customer DB into MailBuild, hence me asking if anyone has a Java example or know if its possible.

Thanks
Jeff Porter

Mathew Mathew, 8 years ago

Hey Jeff,

I think we've helped you out directly via support, but it is definitely possible to use the MailBuild API via SOAP in Java. We don't have any sample code for you though, Java is not our area of expertise.


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
jeff_porter, 8 years ago

Thanks Matt,

So is there any security around the SOAP access? Or can I just send a soap message to ...

http://xxxxxxxxxxx.createsend.com/api/api.asmx?op=Subscribers.GetUnsubscribed

?

I'll let you know how i get on.

jeff_porter, 8 years ago

Hi Matt,

Turns out it was very easy to get a simple Java SOAP example going.

Would you like some screenshots of how to create the SOAP client java API (eclipse)?
As well as a simple Java example that calls the API?


In short:

I used Eclipse to generate all the classes & method based on the WSDL definition.

I then used those classes to make calls via SOAP.

example of the code....

        ApiLocator apiLocator = new ApiLocator();
        ApiSoap apiSoap = apiLocator.getapiSoap12();
       
        String apiKey = "e55axxxxxxxxxxxxxxb7d66c9a";
        String listId = "892e9d3xxxxxxxxxxxxxxxxxd5521d2";
       
        SubscribersGetActive parameters = new SubscribersGetActive(apiKey, listId, "01/09/2008");
       
        SubscribersGetActiveResponse sgar = apiSoap.getSubscribers(parameters);
       
        Subscriber[] subscribers = (Subscriber[]) sgar.getSubscribersGetActiveResult();
        for (int i = 0; i < subscribers.length; i++) {
            System.out.println(subscribers[i].getName() + "    " +subscribers[i].getEmailAddress());
        }

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