cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing CPA Data from Java Mapping - How ?

helmut_skolaut3
Active Participant
0 Kudos

Hi all,

I want to read the adapter specific identifiers from the business systems in my Java Mapping (or if not possible in an Adapter Module).
I have found the following two packages:

com.sap.aii.af.service.cpa

com.sap.aii.af.service.administration.api.cpa

But as I am still a beginner in Java, I don't find how to start off. Has someone already accessed CPA information from own Java code and can help me with a code sniped?

Thanks

   Helmut

Accepted Solutions (1)

Accepted Solutions (1)

helmut_skolaut3
Active Participant
0 Kudos

Hi all,

I found out, with the help of a consultant how to solve it:

String sndService = source.getInputHeader().getSenderService(); 

trace.addInfo("Sender Service read from Header: " + sndService); 

String sndParty = source.getInputHeader().getSenderParty(); 

trace.addInfo("Sender Party read from Header: " + sndParty);   

try { 

     CPALookupManager lm = CPAFactory.getInstance().getLookupManager(); 

     LinkedList llSI = lm.getServiceIdentifiersByService(lm.getServiceByPartyService(sndParty, sndService)); 

     ListIteratoriterSI = llSI.listIterator(); 

      while (iterSI.hasNext()){ 

           ServiceIdentifier SI = iterSI.next(); 

           switch (SI.getServiceSchema())   { 

                case ("LogicalSystem"):

                    sndprn = SI.getServiceIdentifier();

....

Hope that would also help others....

Regards

   Helmut

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hello Helmut,

Can you explain further which properties you are trying to access?

Rather than use a Custom API / Code, have you considered using the Integration Directory API?

The Integration Directory API can be triggered using the SOAP Adapter of PI.

You can make Query request, get the response as a XML, and then use a Message Mapping / UDF to thereby read these contents.

This would make sure not much of a Java Mapping / Java coding is required.

Ofcourse to use this we need to make sure the Integration Directory API meets your requirement and hence if you can elaborate further as to which parameter you need to access, this would help confirm the same..

Regards

Bhavesh

helmut_skolaut3
Active Participant
0 Kudos

Thanks Bhavesh for quick reply,

I want to read e.g. Logical System or Marketplace Adapter information. The problem with the directory API is that for that you have to configure a SOAP channel, etc... it's all very oversized for me .. If there is a way to access the CPA directly it would be more efficient.

Regards

   Helmut

bhavesh_kantilal
Active Contributor
0 Kudos

Hello Helmut,

I unfortunately have not used the Java Classes you have mentioned to access the Channel details.

In my opinion, the Integration Directory API is the best way to do this as it is a more standard approach and also does not need support resources requiring any additional skills.

With that , lets see if anyone has a direct approach that you would like to go with as well..