Skip to content

Instantly share code, notes, and snippets.

@jeqo
Created June 5, 2014 15:57
Show Gist options
  • Save jeqo/d3e08bf1bda750fc94df to your computer and use it in GitHub Desktop.
Save jeqo/d3e08bf1bda750fc94df to your computer and use it in GitHub Desktop.
Test case to access SOA Suite SOAP web service
package com.jeqo.htcore;
import com.oracle.xmlns.bpel.workflow.taskqueryservice.TaskQueryService;
import com.oracle.xmlns.bpel.workflow.taskqueryservice.TaskQueryService_Service;
import com.oracle.xmlns.bpel.workflow.taskqueryservice.WorkflowErrorMessage;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.bpel.services.workflow.common.model.CredentialType;
import oracle.bpel.services.workflow.common.model.WorkflowContextType;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Jorge Quilcate
*/
public class ServiceAccessTest {
public ServiceAccessTest() {
}
@Test
public void testAccess() {
try {
TaskQueryService_Service taskQueryServiceClient = new TaskQueryService_Service();
TaskQueryService taskQueryService = taskQueryServiceClient.getTaskQueryServicePort();
CredentialType credentialType = new CredentialType();
credentialType.setLogin("weblogic");
credentialType.setPassword("welcome1");
credentialType.setIdentityContext("jazn.com");
System.out.println("Authenticating...");
WorkflowContextType workflowContextType = taskQueryService.authenticate(credentialType);
System.out.println("Authenticated to TaskQueryService");
assertNotNull(workflowContextType);
} catch (WorkflowErrorMessage ex) {
Logger.getLogger(ServiceAccessTest.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment