I need to connect with Bronto (1. I installed Ant and Axis2 from Apache.
2. Ran
This is create me a sources and build.xml
3. Ran ant in com.bronto directory. It is created build directory with some classes.
What I should do next?. I need to run this simple code from Bronto:
2. Ran
Code:
wsdl2java.bat -o c:\com.bronto -uri [URL unfurl="true"]https://api.bronto.com/v4?wsdl[/URL]
3. Ran ant in com.bronto directory. It is created build directory with some classes.
What I should do next?. I need to run this simple code from Bronto:
Code:
package com.bronto;
import org.apache.axis.client.Stub;
import com.bronto.api.objects.[red]BrontoSoapApi;[/red]
import com.bronto.api.objects.[red]BrontoSoapApiImplService;[/red]
import com.bronto.api.objects.[red]BrontoSoapApiImplServiceLocator;[/red]
import com.bronto.api.objects.[red]StringValue[/red];
public class TestLoginBronto {
private static final String API_TOKEN = "ADD YOUR API TOKEN HERE";
public static void main(String args[]) throws Exception {
BrontoSoapApiImplService locator = new BrontoSoapApiImplServiceLocator();
BrontoSoapApi api = locator.getBrontoSoapApiImplPort();
// Login
String sessionId = api.login(API_TOKEN);
if (sessionId == null) {
System.out.println("Login failed.");
return;
}
((Stub)api).setHeader(locator.getServiceName().getNamespaceURI(), "sessionId", sessionId);
System.out.println("Login was successful.");
}
}