cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.11 Directory API to mass change communication channels

Former Member
0 Kudos

Hi all,

I am using PI Directory for mass updating communication channels. The update consists of mass deactivate active channels in the Directory.

I am using the web service CommunicationChannelIn to udpate.

The problem is that this web service, do not give the possibility of updating individual properties of a communication channel.

In order to change one property, let say AdapterStatus, we need to read the whole adapter settings by using the read operation of the web service, getting the result of class com.sap.xi.basis.CommunicationChannel, build a new object of type com.sap.xi.basis.RestrictedCommunicationChannel by using setters and getters methods, with changing the wanted channel property, and then call the change operation to update.

Here is the code snippet i have used in order to copy all the channel properties before calling the update method :

The problem with this approach is that i am not sure to have copied all the wanted properties (thanks SAP for having used a different java class types form read operation and the change one ...)  and that i am not loosing some information in the copy process ...

Any comment or idea to ensure that the channels are copied exactly as they are ?

Thanks alots,

Nadir

Accepted Solutions (0)

Answers (2)

Answers (2)

KarthikBangeraM
Active Participant
0 Kudos

Hi Nadir,

Use the get property of com.sap.xi.basis.CommunicationChannel to get the return as JAXBElement<String> and input this list to the set property of CommunicationChannelRestricted as shown below.

Hope this helps.

Regards,

Karthik

RaghuVamseedhar
Active Contributor
0 Kudos

Nadir,

Read operation will return list of CommunicationChannel objects. Take those objects and set file.adapterStatus as inactive, then use same CC object in Change operation. This way, there is no need to read all properties.

Please check these blogs for more info

Former Member
0 Kudos

Thank you Raghu for your reply.

But for me it is not possible to use the same objet that is returned by the method Read directly in the change method. This is because these are not using same classes :

- The Read Method of the web service returns communication channels as objects of type : com.sap.xi.basis.CommunicationChannel

- The Change method uses objcts of type com.sap.xi.basis.RestrictedCommunicationChannel.

And there is no way to cast from on type into the other.

Nadir

RaghuVamseedhar
Active Contributor
0 Kudos

Yes Nadir.

Two different classes to represent same Channel (one for read and one for change).

You are reading almost all properties. Please double check if you missed any property (sender, receiver identifier). I think your code is good to go.

Former Member
0 Kudos

Thanks again for your reply !

I am trying to hook the wsdl of the CommunicationChannelIn service in order to force the use of the CommunicationChannel class instead of the RestrictedCommunicationChannel in the change operation and the regenerate the java proxy and data types classes. I will tell if that works.