Directory API Development – Part 1 of 3
Due to the amount of information on this topic (there are over 30 screenshots not including the code listing), I have divided the blog into 3 parts. The 1st part contains the high-level view of the Directory API and pre-requisites. The Directory API Development – Part 2 of 3 contains the details of setup, e.g. importing WSDL, generating proxies, before starting code development in Directory API Development – Part 3 of 3.
Differences between the Integration Directory and Directory API
- The programming interface enables you to configure multiple objects at the same time.
- Using the programming interface you can only edit your own change lists. You cannot take on and edit the change lists of other users.
- There are no default change list, e.g. with the name “Standard Change List”, which means that you must specify a change list of your own, or else, a new change list name will be generated each time based on a combination of username and time stamp.
- There is no ‘delta’ handling of attribute changes. This means that when you make a change to an object, you will still need to specify all the attributes for that object, just as though it is a create.
h4. Using the Directory API
SAP NetWeaver PI 7.0’s Directory API is available for SAP NetWeaver PI 7.1 and since SAP NetWeaver PI 7.0 SPS13 and SAP NetWeaver XI 3.0 SPS21.
The SAP NetWeaver PI 7.0 Directory APIs are implemented as webservices in SAP NetWeaver’s java server.
Java proxies can be generated in NetWeaver Developer Studio (NWDS) from:
- Web service URL from the web service runtime of the JEE server, by using the “Web Services Navigator”
- External definitions in the “SAP Basis 7.00” SWCV
h4. Usage Examples:
- Customize Content Presentation of the Integration Directory. You can actually build your own version of the Integratoin Directory.
- Create custom views of the contents of the Integration Directory, for example, for the purpose of statistics or administrative reports.
- Create solutions or company-specific user-interfaces (e.g. maintaining partners in B2B scenarios in a spreadsheet).
- In a pub/sub scenarios, the configuration objects (e.g. communication channels, receiver agreements, etc.) can be created from an external source (e.g. file or database). 100s of objects can be created without going thru the manual process of using the Integration Directory.
- h3. Pre-Requisite of using the Directory API:
To use the Directory API, the userid must be assigned specific roles. These roles must be assigned in the java server. The roles are not available using the ABAP transaction code SU01. h4. Assigning roles in PI 7.0 or XI 3.0:
- Start Visual Administrator (VA)
- Navigate to: Server * » * Services * » * Security Provider * » * Runtime * » * Policy Configuration
In Security Roles: add roles api_develop and api_display to Users or Groups
Since Visual Administrator in no longer available with PI 7.1, we will have to use the NetWeaver Administrator.
Start the NWA using http://<server>:In Assigned Roles tab, enter search using criteria: SAP_XI_API*
Select and add roles: SAP_XI_API_DISPLAY_J2EE and SAP_XI_API_DEVELOP_J2EE
To make sure the assigned roles are correct, we can test using the webservice navigator:
Start the webservice navigator: http://<server>:Directory API Development – Part 2 of 3
Directory API Development – Part 3 of 3 </p></li></ol>
Is it only available with EHP 1?
Directory API has been available since SAP NetWeaver PI 7.0 SPS13 and SAP NetWeaver XI 3.0 SPS21. Although, a new set of services will also be available with PI 7.11 (PI 7.1 EhP1). So, with PI 7.11, there will 2 sets of webservices, one for PI 7.0 and the other for PI 7.1. The PI 7.0 version can be used with most, but not all, of the objects in the PI 7.1 Integration Directory.
To test or view the webservices in PI, go to the WSNavigator. You can use a search filter, e.g. "communication", and see the webservice(s) for communication channels.
Is posibility to create Parties dynamic using this API?.I have a lot of Parties/ Services to create.
I really appreciate any help.
My scenario is one to many, one Interface with several receiver Parties/Business Components. so I created a Receiver Determination with one party as the receiver using regular Integration Builder Tool and I was trying to add more receiver by Directory API for the remaining receivers to the one which I manually. But I did not see a way or option to add more to the receivers list, when I tried that it was simply overwriting the existing one when I used the Change Operation but when I try to use create Operation it complains that the Object already exists..
Do you have any idea the way to use the API to add more receivers to the list.
Directory API does allow for adding mulitple receivers. The receiver list should be an array of receivers which you can specify. You have to instantiate each receiver as a new instance and not re-use the existing one.
Thanks for the Quick response, can I just "add" a new receiver to existing list(big list) to the receiver determination? I think its just overwriting the existing list.
Yes, you can. But you have to create a new instance of the receiver. Do you change the existing one by changing the values and add.
I am not clear about "you have to create a new instance of the receiver". We have a Receiver Determination with 5000 receivers, now I need to add 500 more receivers to the list. I am using "Change" operation of wsdl ReceiverDeterminationChangeRequest. First I am not sure any option to use to add the new receiver to the list, I am using Rule\Receiver node to add the new receiver but its simply overwriting the list with new receiver. Can you clarify how can I achieve this?
Sorry about the misunderstanding. I wonder if there is a limitation at 5000 receivers. Can you manually add more receivers to see if it is overwriting the current ones? If so, can you create a customer message for the developer on the limitation? Else, you should be able to add more.
Also, I wonder if there is another way to do this. Is the message to be sent to all the 5000+ receivers or do you have an XPath expression to determine which receiver(s) is to receive the message? If it is the latter case, then you can write a multi-mapping program to determine the receiver; in this case, you do not need to enter all 5000+ receivers.
The issue I am facing here is not the limitation on the number. Lets say I have 10 receivers to the existing RD and I am trying to add 2 more receivers to the list its simply overwriting 10 receivers with 2 new(so all my existing 10 receivers are gone from the list). My question is When add new receivers should I include the existing 10 receivers plus 2 new receivers? or can I just include the 2 new receivers in the list in the XML?
I am sorry I think I am not able to ask question clearly. Let me clarify here again, we need to configure few thousands of EDI parties for AS2 interfaces. We have scheduled to deploy few hundred (~200) parties at a time with this we have to do this iteration in few releases. So my question is when we create RD first time with 200 receivers it works fine but for the next release we need to add 200 more without touching the existing receivers list I mean I want just append to the list. But when I use this Change webservice I am not able to add to the list but its simply overwriting as a create functionality so I am wondering is there any option to just add the receivers list?
Thank you for your help so far, We are able to create ID objects using this API but unable to assign an object to a folder.
I have Folder Structure like
\IBM\ - for IBM
\HARTFORD\ - for Hartford.
So we are trying to create all the ID object under the vendor folder like IBM. When we run the program the objects are getting created but those doesn't show up in the specified folder and we have no errors/warning in the logs. We can still see them created in Object View.
Interesting this is that there is no folder issue in our system PI 711_00 but in 711_06 has this problem. I am not sure what casing this issue in our new system.
Please let me know if you have idea on this issue.
I believe working with folders is available with PI 7.3.
Can these API development be possible by getting first the metadata of a certain object existing lets say in Communication Channel, then push that metadata that consists previous information to the new environment related to Change List user.
I'm having a concept of this tool that from transporting objects to the new environment, the details of the communication channel is not carried from the previous system (File Transport..not seen the results of CTS+ transport). So basically, my concept would be a gui (left environment will be the source system, right environment will be the target system). Load the metadata of that source system (communication channel - object name base) and then load it it to the new system, change some parameters if needed then save).
If its possible, how to get the metadata of that object?
The APIs are web services. So, you can get the metadata from the WSDL. The APIs can be used to retrieve the content from the source system, and poppulate to the content of the target system and update.
A gui tool to do this will have to be custom developed. But, I am not sure this will be so useful. During transport, the system-related info are purposely not transported. The systems used in DEV are different than those used in TST or PRD. Therefore, we don't want to have DEV systems to be accidentally used in a PRD environment.
What I've seen many customers do is to provide an external medium, e.g. EXCEL, that is used by the administrator to store and maintain system-specific information based on the environment, e.g. TST, PRD. Then this file is used to update the content after transport. Such a program is much simpler to develop. And, it can be added as a final step after transport. This will avoid the required task to logon to the system and manually enter the data, and possibly entered wrongly due to spelling or typo or otherwise.
You have some of the most useful blogs on SCN and personally I have had a chance to attend some of your sessions in TechEd as well.
In my company we are planning to adapt new PI Naming Standards. I wanted to know if we could use this API to rename the name of a communication channels, config scenario, Business Components etc in dev, QA and Prod systems.
I am trying to use the API for Configuration Scenario objects to print the objects in the Configuration scenario. I need the sample code to fetch the Configuration Scenario objects like Sender system , receiver sytem , sender and reciever communication channels , Receiver determination etc... Which method is to be used to fetch all these objects of a Configuration Scenario. It would be of great help if youc an provide me the sample code to fetch the same.