Performance issue while connecting with the webservices | Community
Skip to main content
October 16, 2015
Solved

Performance issue while connecting with the webservices

  • October 16, 2015
  • 14 replies
  • 1917 views

Hello

We are migrating from 5.6.1 to 6.1 server.We have configured 3rd party webservices for profiles.

These webservices work perfectly fine with 5.6.1 but seem to give a performance issue on 6.1 and we get a delayed response(about more than a minute to respond) while saving profile records.

There is no change in the webservice code with regards to migration.

Is there any configuration I need to change as part of 6.1 while might help avoid this issue.Not sure on the root cause for this delay.Logs have not been too helpful either.

Thanks,

Sonali.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

This may be an AEM bug - i recommend opening a support ticket for this use case.

https://helpx.adobe.com/marketing-cloud/contact-support.html

However - this does not look related to invoking 3rd party web services from an AEM OSGi bundle

14 replies

October 16, 2015

Yes you are right! That was the initial guess.But this looks something related only the CSRF issue and tokens not getting passed as expected.We have opened a Adobe ticket for this.Thanks for your help so far! :)

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

This may be an AEM bug - i recommend opening a support ticket for this use case.

https://helpx.adobe.com/marketing-cloud/contact-support.html

However - this does not look related to invoking 3rd party web services from an AEM OSGi bundle

October 16, 2015

We figured out that it gives an exception while passing the csrf tokens in between multiple modal windows.

To describe it in detail,if we sign-up 'granite.csrf.standalone' loads fine from global.jsp where we have configured it,it will passon to the next popup window,and the one after that has contact information,while saving this contact information it would give following error - Is this an existing error with CSRF that we know of ? or is there something we can change at the site configuration level so as to avoid this error with multiple modal windows - 

09.10.2015 08:21:10.356 *INFO* [10.170.214.77 [1444400470356] POST /services/contactInfo HTTP/1.1] com.adobe.granite.csrf.impl.CSRFFilter isValidRequest: not well formed CSRF token - rejecting

09.10.2015 08:21:10.356 *INFO* [10.170.214.77 [1444400470356] POST /services/Info HTTP/1.1] com.adobe.granite.csrf.impl.CSRFFilter doFilter: the provided CSRF token is invalid

09.10.2015 08:21:10.359 *WARN* [10.170.214.77 [1444400470356] POST /services/Info HTTP/1.1] com.day.cq.wcm.core.impl.components.ComponentCacheImpl No component node found at /services/contactInfo.servlet

09.10.2015 08:21:10.375 *ERROR* [10.170.214.77 [1444400470356] POST /services/Info HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.

javax.jcr.RepositoryException: org.apache.sling.api.resource.PersistenceException: Resource at '/404.html' is not modifiable.

        at org.apache.sling.servlets.post.impl.operations.ModifyOperation.doRun(ModifyOperation.java:113)

smacdonald2008
Level 10
October 16, 2015

I would use CFX - as shown in the article - to consume the 3rd party WSDL. Use CFX to produce the Java proxy classes.

Then use these classes to invoke the WSDL.

Do this:

1 - Use CFX to create the Java proxy classes. Next, get it working inside of Eclipse. That is, add the Java proxy classes to an eclipse project. Write the Java app logic to invoke the WSDL (this is dependant om the WSDL). Its better to use the strongly typed Java proxy API to consume the web service. 

2 - Once you get that working - then you know your Java proxy classes work. Bundle them into a JAR and then add that JAR into an OSGi bundle as shown in the article. 

3 - Deploy the OSGi to AEM. Invoke via a JSP as shown in the article.  

October 16, 2015

Thanks for your response! 

Could you please elaborate on how I can get rid of the XMLHttpRequest.send.That would really be helpful.

smacdonald2008
Level 10
October 16, 2015

Yes - that may be the reason why there is a delay.  Something wrong with XMLHttpRequest.send . 

I have tested our AEM CFX web service article on AEM 6.1. It works fine - as shown here: 

[img]AEM61WS.png[/img]

As shown in the article - we use Apache CFX to create Java proxy classes (we do not use XMLHttpRequest.send ) to invoke the 3rd party web service. Then bundle them up and invoke from an AEM JSP. 

Also - note that the sample 6.1 artilce package is now attached to the article for local dev testing. 

October 16, 2015

I got this is the browser console - 

Failed to load resource: the server responded with a status of 404 (Not Found)XMLHttpRequest.send @ csrf.js:221
csrf.js:239 Unable to read CSRF meta information

I know I need to add some clientlibs for CSRF to my code due to which it might be failing.

We have all jsp files as a part of our components no sightly code.Any directions for adding the same?

Maybe this is why its causing a delay.

smacdonald2008
Level 10
October 16, 2015

For testing purposes and to pin point your code - try to comment out the web service logic in your servlet, Then keep the logic very simple - try writing a log message. See if that works - this will tell you if the exception is from something wrong with how the servlet is invoked or if the issue is with the web service call. 

I am going to test our web service CFX example on AEM 6.1 to make sure there is no web service and AEM 6.1 issues. 

Lokesh_Shivalingaiah
Level 10
October 16, 2015

Can you give more details on exception.At what process are you getting this Exception ?? It would be helpful if you provide more error log !

October 16, 2015

This is what I got in the AEM error logs -

POST /services/info HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.