Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to fix invoke CXF webService connection timeout

Avatar

Avatar
Validate 10
Level 2
bbboy2014
Level 2

Like

1 like

Total Posts

150 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
bbboy2014
Level 2

Like

1 like

Total Posts

150 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
bbboy2014
Level 2

15-10-2015

Hi,

I run into a issue that class in osgi bundle invokes CXF webService with HTTPS approach. Please look at following code:

URL wsdlURL = new URL(strURL.toString()); WebService4AEM_Service ss = new WebService4AEM_Service(wsdlURL, SERVICE_NAME); WebService4AEM port = ss.getWebService4AEMPort(); log.info("Invoking login..."); java.lang.String _login_arg0 = username; java.lang.String _login_arg1 = password; java.lang.String _login__return = port.login(_login_arg0, _login_arg1); log.info("Login FullAccessToken = " + _login__return);

When run at line " port.login(....) " ,  background throws exceptional message as following:

javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://w18.globalsight.com:443/globalsight/aemServices/WebService4AEM?wsdl. It failed with: Connection timed out: connect. at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:151) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:133) at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:254) at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:217) at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:165) at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93) at javax.xml.ws.Service.<init>(Service.java:56) at com.globalsight.www.webservices.WebService4AEM_Service.<init>(WebService4AEM_Service.java:43) at com.adobe.cq.CustomerServiceImpl.insertGlobalsightData(CustomerServiceImpl.java:103) at org.apache.jsp.apps.jcrpersist.components.page.templateJCR.persist_json_jsp._jspService(persist_json_jsp.java:159) at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

 

BTW, but if i make that to invoke in a single class file that have a main function,  the problem is ok.

public static void main(String[] args) { .... URL wsdlURL = new URL(strURL.toString()); WebService4AEM_Service ss = null; ss = new WebService4AEM_Service(wsdlURL, SERVICE_NAME); WebService4AEM port = ss.getWebService4AEMPort(); java.lang.String _login_arg0 = username; java.lang.String _login_arg1 = password; java.lang.String _login__return = port.login(_login_arg0, _login_arg1); .... }

 

Also i find a way and try to solve that problem as following for increase time-out time, but can't find cxf-rt-frontend-jaxws.jar(contains class ClientProxy and others) this file existed in the Adobe repository https://repo.adobe.com/nexus/content/groups/public/org/apache/cxf/.

Client cl = ClientProxy.getClient(servicePort); HTTPConduit http = (HTTPConduit) cl.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(10000); httpClientPolicy.setReceiveTimeout(1000); http.setClient(httpClientPolicy);

Anyone know how to resolve this problem? Keep waiting reply onlines.

Thanks a lot in advance.

Brian

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

15-10-2015

We have an article that shows how to successfully build an AEM web service OSGi bundle using CFX:

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

(you may know about this one - but for other communty members looking for this informtion -- see the above link). 

When you build the proxy Java classes using CXF - the tool generates these classes (using the sample WSDL in the article)

[img]proxyclasses.png[/img]

We used these default classes and they work perfectly.

Now for configuring these classes to change default values - ie - timeout value, etc - you will hvae to look on the CFX web site - that is not related to AEM. Start researching that here:

http://cxf.apache.org/

Hope this helps. 

Answers (4)

Answers (4)

Avatar

Avatar
Validate 10
Level 2
bbboy2014
Level 2

Like

1 like

Total Posts

150 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
bbboy2014
Level 2

Like

1 like

Total Posts

150 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
bbboy2014
Level 2

15-10-2015

It helpful a lot.  Thanks for your comments.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

15-10-2015

Looks like you are trying to make an AJAX call to an AEM servlet. That should be straightforward - as shown here:

https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

no need to encode URL for it to work - see the above code - you can deploy the package and see it work. 

Avatar

Avatar
Validate 10
Level 2
bbboy2014
Level 2

Like

1 like

Total Posts

150 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
bbboy2014
Level 2

Like

1 like

Total Posts

150 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
bbboy2014
Level 2

15-10-2015

hi scott,

I check the associated log in the AEM,  find the reason why time out is :  user type  the parameter  login-password is .m4c*Int3l+     but as a result  request.getParameter("password") that get value ignored the symbol "+".

var url = location.pathname.replace(".html", "/_jcr_content.persist.json") + "?hostName="+ hostName +"&hostPort="+ hostPort +"&username="+ username +"&password=" + password + "&enableHttps="+ enableHttps +"&desc="+desc +"&checkInterval=" +checkInterval; $.ajax(url, { dataType: "text", success: function(rawData, status, xhr) { var data;

I  don't know why happened that?  If should to need encode url  and decode url?   please comment on it.

Avatar

Avatar
Validate 10
Level 2
bbboy2014
Level 2

Like

1 like

Total Posts

150 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
bbboy2014
Level 2

Like

1 like

Total Posts

150 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
bbboy2014
Level 2

15-10-2015

Hi Scott,

 

The problem happened as well.   But i find the solution is following:

var data = $("password").val(); data = data.replace(/\+/g, "%2B");