WSO2 APIM Application Registration urn:approve action not found - wso2

UPDATE: We have reproduced the same problem connecting to EI 6.1.1 business process module
We are trying to implement a application registration (generation of key) for API manager (version 2.1.0), using BPS (version 3.6.0).
For this, we are following the instructions in
https://docs.wso2.com/display/AM210/Adding+an+Application+Registration+Workflow
We have also corrected a typo in the content of the package, as provide by the
https://github.com/wso2/product-apim/pull/2730/files#diff-737be153055f194110665b96252dcebe
The previous workflow (ApplicationCreation) works fine, but this, when we click in "GenerateKeys" in store, fails with error in BPS, saying that the action urn:approve is invalid
TID: [-1234] [] [2018-06-20 21:11:32,909] DEBUG {org.wso2.carbon.bpel.messagetrace} - Message received: ApplicationRegistrationWorkFlowProcess.{http://workflow.application.apimgt.carbon.wso2.org}initiate {org.wso2.carbon.bpel.messagetrace}
TID: [-1234] [] [2018-06-20 21:11:33,824] WARN {org.apache.axis2.addressing.AddressingFaultsHelper} - triggerActionNotSupportedFault: messageContext: [MessageContext: logID=11ff1a7f886692cdddf6394b6d5e88da06b8bac0e1095ec3] problemAction: urn:approve {org.apache.axis2.addressing.AddressingFaultsHelper}
TID: [-1234] [] [2018-06-20 21:11:33,830] ERROR {org.apache.axis2.engine.AxisEngine} - The [action] cannot be processed at the receiver. {org.apache.axis2.engine.AxisEngine}
org.apache.axis2.AxisFault: The [action] cannot be processed at the receiver.
We have checked, in BPS carbon console, that the service ApplicationRegistrationWorkFlowProcess is deployed, and the WSDL 1.1 endpoint is deployed with soapAction=urn:approve.
The endpoint in API Manager (store), the workflow-extensions in registry /_system/governance/apimgt/applicationdata/workflow-extensions.xml are modified as described to
<SandboxApplicationRegistration executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationWSWorkflowExecutor">
<Property name="serviceEndpoint">http://apibps.example.com:9765/services/ApplicationRegistrationWorkFlowProcess/</Property>
<Property name="username">admin</Property>
<Property name="password">admin</Property>
<Property name="callbackURL">https://apimanager.example.com:8243/services/WorkflowCallbackService</Property>
</SandboxApplicationRegistration>

I tested the same with APIM 2.2.0 and BPS 3.6.0 and EI 6.2.0. It worked fine. Can you change the port in callbackURL of SandboxApplicationRegistration in workflow-extensions.xml to 8248 and retry?

Related

WSO2 API-Manager HTTP Requests terminate after 5mins with Error 101508

We deployed a long running HTTP service on WSO2 APIM 3.2.0 that needs approx. 6-15minutes to reply to a request. To support long running HTTP calls we configured the API endpoint timeouts to 15mins and also the APIM in the deployment.toml:
[synapse_properties]
'synapse.global_timeout_interval' = 900000
[passthru_http]
'http.socket.timeout' = 1000000
However, always after exactly 5 minutes we get the following error:
<am:fault xmlns:am=“http://wso2.org/apimanager”><am:code>101508</am:code><am:type>Status report</am:type><am:message>Runtime Error</am:message><am:description>Error in Sender</am:description></am:fault>
This indicates that our backend service is terminating the connection. However, if we call the service directly, i.e. without APIM Gateway it replies after 6-15min. Do we miss any timeout settings in APIM that it completes after 5mins ?
Thanks a lot for your help!
Cheers,
Sebastian
101508, this will happen because the backend endpoint is getting timed out. You could see the occurrences of the endpoint time out and in the same way, the entire HTTP socket also gets timeout in the wso2carbon.log.
Sample endpoint timeout log
TID: [-1234] [] [2022-02-22 21:30:43,187] WARN {org.apache.synapse.endpoints.EndpointContext} - Endpoint : <ENDPOINT> will be marked SUSPENDED as it failed {org.apache.synapse.endpoints.EndpointContext}
Sample socket timeout
TID: [-1] [] [2022-02-22 21:30:43,186] WARN {org.apache.synapse.transport.passthru.TargetHandler} - Connection closed by target host before receiving the response {org.apache.synapse.transport.passthru.TargetHandler
Please check the endpoint and htp.socket.timeout values as mentioned in the WSO2 documentation[1].
You should increase the above values that should be more than 6-15 minutes. You can configure it in milliseconds.
[1] https://apim.docs.wso2.com/en/3.2.0/learn/design-api/endpoints/resiliency/endpoint-timeouts/
Note: The socket timeout value should be greater than both the Synapse global timeout and any endpoint timeouts given for your API.

WSO2 APIM 4 JMS Provider is not yet started

I'm getting the below error after starting a new WSO2 APIM 4 instance.
TID: [-1] [] [2022-01-09 09:19:45,277] ERROR {org.wso2.carbon.apimgt.common.jms.JMSListener} - JMS Provider is not yet started. Please start the JMS provider now.
TID: [-1] [] [2022-01-09 09:19:45,277] ERROR {org.wso2.carbon.apimgt.common.jms.JMSListener} - Connection attempt : 4 for JMS Provider failed. Next retry in 160 seconds
OS: CentOS 7.9
Java: OpenJDK 8
wso2apim version :4.0.0
I was using super admin password containing (#) issue resolved by removing the (#) from my admin password.
API amanger uses this password in connection strings to connect to JMS .

wso2 api manager content-length issue

I'm using WSO2 API MANAGER version 1.10.0. I have a issue related Content-Length setting. there are two api.
one api have 411 error (required Content-Length)
then I set below property in passthru-http.properties file.
http.headers.preserve=Content-Length
after that 411 error solved. but another api occurring exception.
TID: [-1] [] [2016-12-23 16:11:18,946] ERROR {org.apache.synapse.transport.passthru.SourceHandler} - Content-Length header already present {org.apache.synapse.transport.passthru.SourceHandler}
org.apache.http.ProtocolException: Content-Length header already present
at org.apache.http.protocol.ResponseContent.process(ResponseContent.java:101)
at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:139)
at org.apache.synapse.transport.passthru.SourceResponse.start(SourceResponse.java:170)
at org.apache.synapse.transport.passthru.SourceHandler.responseReady(SourceHandler.java:193)
at org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(DefaultNHttpServerConnection.java:305)
at org.apache.synapse.transport.http.conn.LoggingNHttpServerConnection.produceOutput(LoggingNHttpServerConnection.java:114)
at org.apache.synapse.transport.passthru.ServerIODispatch.onOutputReady(ServerIODispatch.java:87)
at org.apache.synapse.transport.passthru.ServerIODispatch.onOutputReady(ServerIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:150)
at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:180)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:586)
at java.lang.Thread.run(Thread.java:745)
As a result, the two APIs can not run concurrently due to Content-Length configuration.
ps.
I saw below url.
WSO2 API Manager 1.10 issue
I modified main.xml in /repository/deployment/server/synapse-configs/default/sequences folder
it's not working for me.
You can disable chunking globally by 2 methods.
1) Edit velocity template file and add this.
<property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
See this blog on how to do that.
2) Add a new mediation sequence. See this.

Wso2 ESB Integration with SFDC

I am integrating WSO2 ESB 4.8.1 with SFDC.
Using SFDC connector 1.0
In WSO2 i have written the code <salesforce.logout/>, according to WSO2 Documentation they say that it closes the current connection.
<salesforce.logout/> produces below soap message which i identified in WSO2 ESB log
TID: [0] [ESB] [2016-08-30 07:55:39,442] DEBUG {org.apache.synapse.transport.http.wire} -  << "<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"><soapenv:Header><urn:SessionHeader><urn:sessionId>00D17000000BPGr!AQcAQDIggW.ikXtsb0Ckm8c8pKKDlF_8QN42jL31WUa6hDLOdEeNIjrYsevKW0FeZLDzlrjcDLwMni_7gYaZgNfdN4zv9Cgj</urn:sessionId></urn:SessionHeader></soapenv:Header><soapenv:Body><urn:logout></urn:logout></soapenv:Body></soapenv:Envelope>[\r][\n]" {org.apache.synapse.transport.http.wire}
But few times i am getting below error (INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash:) when <salesforce.logout/> is executed
TID: [0] [ESB] [2016-08-30 07:55:39,529] DEBUG {org.apache.synapse.transport.http.wire} -  >> "<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>sf:INVALID_SESSION_ID</faultcode><faultstring>INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: je59etMAEPM+m9VdYJb0AW==[\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [ESB] [2016-08-30 07:55:39,529] DEBUG {org.apache.synapse.transport.http.wire} -  >> "This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in. </faultstring><detail><sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault"><sf:exceptionCode>INVALID_SESSION_ID</sf:exceptionCode><sf:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: je59etMAEPM+m9VdYJb0AW==[\n]" {org.apache.synapse.transport.http.wire}
TID: [0] [ESB] [2016-08-30 07:55:39,529] DEBUG {org.apache.synapse.transport.http.wire} -  >> "This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in. </sf:exceptionMessage></sf:UnexpectedErrorFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>[\r][\n]" {org.apache.synapse.transport.http.wire}
Is it SFDC issue/WSO2 SFDC connector issue/WSO2 ESB configuration issue.?
For upsert operation we are using configkey attribute in entire project, below is the code
<salesforce.upsert configKey="sfdc_connection_dtls">
          <allOrNone>0</allOrNone>
          <allowFieldTruncate>0</allowFieldTruncate>
          <sobjects xmlns:sfdc="sfdc">{//sfdc:sObjects}</sobjects>
        </salesforce.upsert>
So when i use <salesforce.logout/> in the respective sequence, does it closes only the current connection which is available in sequence.? or it closes all connection which are existing.?
Where ever i am using salesforce.upsert(below is the skeleton code) can i use <salesforce.logout/> after salesforce.upsert call.?
<salesforce.upsert configKey="sfdc_connection_dtls">
<!-- sobject goes here -->
</salesforce.upsert>
Looking forward for your help
Thanks,
Tejas
In WSO2 SFDC connector, there's a single SF connection created per flow per init configuration. Therefore, if you issue a logout, your subsequent requests will fail. It is not necessary to issue logout since the connection is anyway terminated at the end of the flow.

WSO2 API Manager service API call failure while loading throttling policy

Currently we are trying to expose our Axis2 web services via WSO2 API manager. However in some cases service do not return result and looking at logs on WSO2 API manager we see the following
ERROR {org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler} - Unable to load throttling policy using key: gov:/apimgt/applicationdata/tiers.xml {org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler} TID: [0] [AM] [2013-01-07 16:42:22,951]
INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: /TestService/1.0.0, WSAction: urn:testOperation, SOAPAction: urn:testOperation, MessageID: urn:uuid:a8f94f58-5e2d-4d51-afc7-83182b51d173, Direction: request, STATUS = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Unable to load throttling policy using key: gov:/apimgt/applicationdata/tiers.xml, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><p:testOperation xmlns:p="http://example.com"><param>d1</param></p:testOperation></soapenv:Body></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}
For configuration i use the default h2 database as registry and mysql database for user and api manager database.
This issue is a known issue [1],which will be fixed in the next AM release. We also encountered this issue at a instance,when we are trying invoking two different APIs at same time or within short time period.
Thanks;
[1] https://wso2.org/jira/browse/APIMANAGER-835