Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Performance issue while connecting with the webservices

Avatar

Former Community Member

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.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

14 Replies

Avatar

Level 10

Typically to integrate SOAP based web services into AEM, you create Java proxy classes that consume the WSDL. Then you place the proxy classes into an OSGi bundle. I am not sure what you mean by using config to hook into web services? 

Did you write Java proxy classes as talked about here?

https://helpx.adobe.com/experience-manager/using/creating-cxf-bundles-consume-web.html 

Avatar

Level 10

Need more details - did  you create a custom AEM service that invokes a 3rd party web service? If so - is the web service a SOAP-Based web service or Restful web service? 

Avatar

Former Community Member

All those classes are in place.And the service is working as expected on 5.6.1.This is not a code thats newly being written for 6.1.

------ERROR(error.log)----

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

From this error I am guessing its something to do with Sling and the way we have set the properties for Sling in our servlets but not exactly sure whats wrong there since it works for 5.6.1.

Example of how we have set the properties - 

@Component(immediate = true, metatype = true, enabled = true)
@Properties({ 
    @Property(name = "sling.servlet.methods", value = { "GET", "POST", "PUT", "DELETE" }),
    @Property(name = "sling.servlet.paths", value = { "/services/info" }) })
@Service(value = Servlet.class)

Any suggestions ?

Avatar

Former Community Member

Yes.Its a soap service.We have configured the service through the config manager.

Avatar

Former Community Member

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.

Avatar

Level 10

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 !

Avatar

Level 10

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. 

Avatar

Former Community Member

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.

Avatar

Level 10

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. 

Avatar

Former Community Member

Thanks for your response! 

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

Avatar

Level 10

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.  

Avatar

Former Community Member

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)

Avatar

Correct answer by
Level 10

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

Avatar

Former Community Member

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! :)