Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:117)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
at com.sun.proxy.$Proxy56.openSession(Unknown Source)
at com.odeal.util.SmsSoapClient.<init>(SmsSoapClient.java:45)
at com.odeal.factory.SmsSoapClientFactory.buildSoapClient(SmsSoapClientFactory.java:55)
at com.odeal.App.run(App.java:32)
at com.odeal.App.run(App.java:14)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:76)
at io.dropwizard.cli.Cli.run(Cli.java:70)
at io.dropwizard.Application.run(Application.java:73)
at com.odeal.App.main(App.java:17)
public class SmsServiceConfiguration extends Configuration{
@NotNull
private SmsSoapClientFactory smsSoapClientFactory = new SmsSoapClientFactory();
@JsonCreator
public SmsServiceConfiguration(@JsonProperty("smsProvider") SmsSoapClientFactory smsSoapClientFactory) {
this.smsSoapClientFactory = smsSoapClientFactory;
}
@JsonProperty("smsProvider")
public SmsSoapClientFactory getSmsSoapClientFactory() {
return smsSoapClientFactory;
}
}
public class SmsSoapClientFactory {
private String username;
private String password;
private String sender;
private SmsSoapClient smsSoapClient;
private KeenClient keenClient;
@JsonProperty
public String getUsername() {
return username;
}
@JsonProperty
public void setUsername(String username) {
this.username = username;
}
@JsonProperty
public String getPassword() {
return password;
}
@JsonProperty
public void setPassword(String password) {
this.password = password;
}
@JsonProperty
public String getSender() {
return sender;
}
@JsonProperty
public void setSender(String sender) {
this.sender = sender;
}
public SmsSoapClient buildSoapClient(Environment env) {
if (smsSoapClient != null) { return smsSoapClient; }
final SmsSoapClient client= new SmsSoapClient(getUsername(), getPassword());
env.lifecycle().manage(new Managed() {
@Override
public void start() throws Exception {
client.openSession(); // this is where exception occurs making just simple session init call
}
@Override
public void stop() throws Exception {
}
});
this.smsSoapClient = client;
return smsSoapClient;
}
}
// application class run method
@Override
public void run(SmsServiceConfiguration configuration, Environment environment) throws Exception {
final SmsSoapClient smsSoapClient = configuration.getSmsSoapClientFactory().buildSoapClient(environment);
// register resources = endpoints
environment.jersey().register(new SmsResource(smsSoapClient));
}