OpenEMM API 2.0 in JAVA/Maven Project

Use this forum for questions regarding adoption and functionality of OpenEMM

Moderator: moderator

MSelke
Posts: 28
Joined: Thu Feb 25, 2016 11:19 am

OpenEMM API 2.0 in JAVA/Maven Project

Post by MSelke »

Hello,

I installed OpenEMM on a VM in my network and i think this works fine. I editted the emm and the cms property files so that the URLS show to the IP Adress of the VM. I can access the emmservices.wsdl from the machine where my project is installed, and build some Java classes with apache CXF to access the API 2.0. My Problem is that i didnt know how to implement the access to OpenEMM. I build a getSubscriber request and i can run it, but then I get a Authentification error. because im not logged in on the OpenEMM Server and i can't see where I can fill in my login credentials for the ws-user.

Code: Select all

OpenemmService openemmService = new OpenemmService()
Openemm openemm = openemmService.getOpenemmSoap11();

GetSubscriberRequest getSubscriberRequest =new GetSubscriberRequest();
getSubscriberRequest.getCustomerID(0);
openemm.getSubscriber(getSubscriberRequest);
This is my pom.xml snippet.

Code: Select all

<plugin>
      <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-codegen-plugin</artifactId>
          <version>${cxf.version}</version>
          <executions>
              <execution>
                  <id>generate-sources</id>
                  <phase>generate-sources</phase>
                  <configuration>
                     <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
                      <wsdlOptions>
                          <wsdlOption>
                              <wsdl>http://IP-ADDRESS:8080/openemm-ws/emmservices.wsdl</wsdl>
                          </wsdlOption>
                      </wsdlOptions>
                  </configuration>
                  <goals>
                      <goal>wsdl2java</goal>
                  </goals>
              </execution>
        </executions>
</plugin>
Do I use the right wsdl, are there other classes I have to use for access?

I think what helps is a little example for an Serverrequest like(getSubscriber) from a Java based project.

thanks in advance

Martin