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

View Entire Topic

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");