• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not able to access HTTP webservice sitting behind a HTTPS load balancer

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We are developing a webservice client to access a HTTP webservice that sits behind a HTTPS load balancer. We are using JAX-WS RI 2.1 for client implementation. Used wsimport to generated stub code from the WSDL.

What we are provided is a HTTPS URL which is basically of the load balancer. They then redirect the requests to actual http url where the service is bound. There is no access to this http port from outside network, it has to go through the load balancer only.
This is the stack trace.
-------------------------------------------------------------------------------------------------
com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException.

java.net.SocketException: Connection reset
java.net.SocketException: Connection reset

at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex (RuntimeWSDLParser.java:172)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse (RuntimeWSDLParser.java:144)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL (WSServiceDelegate.java:264)
at com.sun.xml.ws.client.WSServiceDelegate.<init> (WSServiceDelegate.java:227)
at com.sun.xml.ws.client.WSServiceDelegate.<init> (WSServiceDelegate.java:175)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate (ProviderImpl.java:104)
at javax.xml.ws.Service.<init>(Service.java:77)
-------------------------------------------------------------------------------------------------


Tried with SOAP UI as well. Even SOAP UI is getting connection reset error even with "Follow Redirect" set to true.
Here is SOAP UI error stack trace.
-----------------------------------------------------------------------------------------------------------------------------------------------------
Fri Mar 28 10:33:33 IST 2014:ERROR:java.net.SocketException: Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:149)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:110)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:264)
at org.apache.http.impl.conn.LoggingSessionInputBuffer.readLine(LoggingSessionInputBuffer.java:115)
at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:98)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doReceiveResponse(HttpClientSupport.java:147)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:236)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:345)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:241)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
-----------------------------------------------------------------------------------------------------------------------------------------------------


WGET is also failing.

******************************************************************************************************************************************************
wget --no-check-certificate --debug https://<IP>/NPCWebApp/services/NPCWebService
DEBUG output created by Wget 1.12 on linux-gnu.

--2014-04-04 16:52:20-- https://<IP>/NPCWebApp/services/NPCWebService
Connecting to <IP>:443... connected.
Created socket 3.
Releasing 0x0000000001d78080 (new refcount 0).
Deleting unused 0x0000000001d78080.
Initiating SSL handshake.
Handshake successful; connected socket 3 to SSL handle 0x0000000001dc4480
certificate:
subject: /C=IN/ST=Haryana/L=Gurgaon/O=MITS/OU=Interconnection Solutions/CN=MNP-INDIA-TEST-CERT
issuer: /C=IN/ST=Haryana/L=Gurgaon/O=MITS/OU=Interconnection Solutions/CN=MNP-INDIA-TEST-CERT
WARNING: cannot verify <IP>âs certificate, issued by â/C=IN/ST=Haryana/L=Gurgaon/O=MITS/OU=Interconnection Solutions/CN=MNP-INDIA-TEST-CERTâ
Self-signed certificate encountered.
WARNING: certificate common name âMNP-INDIA-TEST-CERTâ<IP>â

---request begin---
GET /NPCWebApp/services/NPCWebService HTTP/1.0
User-Agent: Wget/1.12 (linux-gnu)
Accept: */*
Host: <IP>
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Closed 3/SSL 0x0000000001dc4480
Retrying.
*******************************************************************************************************************************************************


Any help on this is greatly appreciated.

Thanks,
Manju
 
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Contact the network admin to help you do the needful (open the ports, correct the redirect, etc).
 
Manjunatha Murthy
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Roger,
There lies the problem. They are saying they have done everything right on their load balancer side and other clients are using it successfully via the loadbalancer itself.

Regards,
Manju
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The solid proof to prove that problem is in loadbalancer is : You must be able to access the WSDL from the endpoint URL with - <EndpointURL>?wsdl

Example : https://www.webservice.com/loadbalancer/webservice?wsdl

When you enter this URL in browser, you must be able to see the WSDL otherwise webservice is not accesble or available on this endpoint.

Hope this helps.
 
Manjunatha Murthy
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Thanks for your comments.
The wsdl is not accessible using <url>?wsdl URL. But we were able to get around this problem.

We instantiated the service by using local copy of wsdl instead of the wsdl from target server. And then using following code (sample)


Here urlString had the value of loadbalancer URL and url pointed to local copy of wsdl.

Regards,
Manju
 
Sujeeth Pakala
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is happening if you invoke webservice like :



Manjunatha : There is no cocept of instantiating webservice using wsdl !. WSDL is a contract. It can be either in your local machine or any shared drive or service registry. It should be SAME for bother service invoker , service agent, service provider etc.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im getting ssl handshake exception while connecting to service running behind loadbalancer (https)

i havent got any certificate from service im not sure do we need to use certficate if so how to use it could you please explain
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic