Hi Alejandro,
Did you ever get to the bottom of this?
The API Key -- Published Service mapping is held in the Gateway's configuration database in a table called generic_entity. Anytime you add the Portal Managed Service assertion to a Gateway endpoint and save the policy, a new entry is added to this table where the name is equal to the API ID in the assertion. So, the first thing I would verify is if a new entry actually gets created when a new service containing the Portal Managed Service is created using GMU. You can use the following SQL before & after to see if the number of portal managed services has changed:
select count(*) from generic_entity where classname="com.l7tech.external.assertions.apiportalintegration.server.PortalManagedService";
You can use the following to find the actual entry:
select * from generic_entity where name="5ba10b0e-2f85-4ef3-b6b3-87b7faa73b56"\G
Again, the name value to use in the where clause can be found in the API ID field in the Portal Managed Service assertion of the endpoint in question. If no such entry exists, then this is likely your problem.
Now, anytime a new application is created in the Portal an API Key is generated on the Gateway and a new entry is added to the generic_entity where the name is equal to the value of the API Key. You can bring up this entry with the following SQL:
select * from generic_entity where name="l7xxdfc0d02743f9479a92d526c00293288f"\G
In the value_xml field there is a list of service IDs. This is the list of APIs for which this API key is valid. The API ID from the Gateway endpoint in question should appear in this list and look something like this:
<void property="serviceIds">
<void method="put">
<string>5ba10b0e-2f85-4ef3-b6b3-87b7faa73b56</string>
<string>1db2437af8b34992f57aedbb22fe27838f42d019</string>
</void>
</void>
If the API ID does not appear in this list this will also cause problems.
This is where I would start my troubleshooting.
Cheers,
Julian