Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JAX-WS Client work over HTTPS but not over HTTP

1,250 views
Skip to first unread message

full...@gmail.com

unread,
Jun 27, 2008, 2:24:10 PM6/27/08
to
Hi, I have a problem with a very simple web service example using JAX-WS.

Basically, the problem is that if I put in the binding part of the WSDL an soap:address location with HTTP the static client does not work and throws

javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: HTTP ( 400 ) Bad Request address : http: //localhost:9081/bank/BankingService

But if I only change it for HTTPS it works . (For full explanation read below)

Is there any config on WAS that I must change for a Client works over HTTP?... I have the default configuration of the trial WAS.

The situation is:


I run a Web Service Server generated WS from a JavaBean
I generate a JAX-WS Client
I generate a Servlet using the WS Client that I generated before
I test the WS using the Web Service Explorer and it work ok
But when I test the client using the Servlet it does not work
After some search, tests, read the redbooks, and many headaches I have discovered one point:

If in WSDL of the WS Server I have in the binding part pointing to a HTTPS URL it works...

soap:address location= "https://localhost:9444/bank/BankingService"

But if I change that line for:

soap:address location= "http://localhost:9081/bank/BankingService"


This simple change implies that the use of the client on the servlet work or not. This is how I use the client:

BankingService service = new BankingService();
BankingSEI port = service.getAccountsPort();
long result = port.createAccount( "Bob" , 1000.5);

The full exception that I get is:

javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: HTTP ( 400 ) Bad Request address : http: //localhost:9081/bank/BankingService
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:180)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:79)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:134)
at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:596)
at org.apache.axis2.jaxws.core.controller.AxisInvocationController.doInvoke(AxisInvocationController.java:111)
at org.apache.axis2.jaxws.core.controller.InvocationController.invoke(InvocationController.java:110)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:275)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:147)
at $Proxy102.createAccount(Unknown Source)
at servlet.ThinClientTest.invokeWS(ThinClientTest.java:37)
at servlet.ThinClientTest.doPost(ThinClientTest.java:26)
at servlet.ThinClientTest.doGet(ThinClientTest.java:20)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1075)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:550)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3391)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Caused by: org.apache.axis2.AxisFault: HTTP ( 400 ) Bad Request address : http: //localhost:9081/bank/BankingService
at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.processStatusCode(SOAPOverHTTPSender.java:2722)
at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:400)
at com.ibm.ws.websvcs.transport.http.HTTPTransportSender.invoke(HTTPTransportSender.java:292)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:658)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:340)
at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:304)
at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:591)
... 31 more


Also, I have generated a client from a WSDL of this web service: http://www.webservicex.net/l ength.asmx?wsdl and again in the Web Service Explorer (that as far I know use a dynamic client) works, but with the generated static client it does not work.

My environment is:


Websphere Application Server 6.1.0.17 (Trial)
Web Service Feature Pack 6.1.0.17
Rational Application Developer 7.0.0.6 (Trial)

Thanks in advance,

Martin

PD: Sorry for my English! It isn't my native language

Cesar

unread,
Jun 28, 2008, 12:37:44 PM6/28/08
to
On 27 jun, 13:24, fulli...@gmail.com wrote:
> Hi, I have a problem with a very simple web service example using JAX-WS.
>
> Basically, the problem is that if I put in the binding part of the WSDL an soap:address location with  HTTP  the static client  does not work  and throws
>
>  javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: HTTP ( 400 ) Bad Request address : http: //localhost:9081/bank/BankingService
>
> But if I only change it for  HTTPS it works . (For full explanation read below)
>
> Is there any config on WAS that I must change for a Client works over HTTP?... I have the default configuration of the trial WAS.
>
> The situation is:
>
>  I run a Web Service Server generated WS from a JavaBean
>  I generate a JAX-WS Client
>  I generate a Servlet using the WS Client that I generated before
>  I test the WS using the Web Service Explorer and it work ok
>  But when I test the client using the Servlet it does not work
>  After some search, tests, read the redbooks, and many headaches I have discovered one point:
>
>    If in WSDL of the WS Server I have in the binding part pointing to a HTTPS URL it works...
>
>          soap:address location= "https://localhost:9444/bank/BankingService"
>
>    But if I change that line for:
>
>          soap:address location= "http://localhost:9081/bank/BankingService"
>
> This simple change implies that the use of the client on the servlet work or not. This is how I use the client:
>
>  BankingService service =  new  BankingService();
> BankingSEI port = service.getAccountsPort();
>  long  result = port.createAccount( "Bob" , 1000.5);
>
> The full exception that I get is:
>
>  javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: HTTP ( 400 ) Bad Request address : http: //localhost:9081/bank/BankingService
>         at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Exception­Factory.java:180)
>         at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFa­ctory.java:79)
>         at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFa­ctory.java:134)
>         at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(Axi­sInvocationController.java:596)
>         at org.apache.axis2.jaxws.core.controller.AxisInvocationController.doInvoke(Ax­isInvocationController.java:111)
>         at org.apache.axis2.jaxws.core.controller.InvocationController.invoke(Invocati­onController.java:110)
>         at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWS­ProxyHandler.java:275)
>         at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHand­ler.java:147)

>         at $Proxy102.createAccount(Unknown Source)
>         at servlet.ThinClientTest.invokeWS(ThinClientTest.java:37)
>         at servlet.ThinClientTest.doPost(ThinClientTest.java:26)
>         at servlet.ThinClientTest.doGet(ThinClientTest.java:20)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:­1075)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper­.java:550)
>         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapp­er.java:478)

>         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3391)
>         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
>         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
>         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455­)
>         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
>         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(H­ttpInboundLink.java:458)
>         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(H­ttpInboundLink.java:387)
>         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.­java:267)
>         at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscrimi­nators(NewConnectionInitialReadCallback.java:214)
>         at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewCo­nnectionInitialReadCallback.java:113)
>         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioRe­adCompletionListener.java:165)
>         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.jav­a:217)
>         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFutur­e.java:161)

>         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
>         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:74­3)

>         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
>         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
> Caused by: org.apache.axis2.AxisFault: HTTP ( 400 ) Bad Request address : http: //localhost:9081/bank/BankingService
>         at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.processStatusCode(SOAP­OverHTTPSender.java:2722)
>         at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSende­r.java:400)
>         at com.ibm.ws.websvcs.transport.http.HTTPTransportSender.invoke(HTTPTransportS­ender.java:292)
>         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:658)
>         at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperati­on.java:340)
>         at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOper­ation.java:304)
>         at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(Axi­sInvocationController.java:591)
>         ... 31 more
>
> Also, I have generated a client from a WSDL of this web service:  http://www.webservicex.net/length.asmx?wsdl  and again in the Web Service Explorer (that as far I know use a dynamic client) works, but with the generated static client it does not work.

>
> My environment is:
>
>  Websphere Application Server 6.1.0.17 (Trial)
>  Web Service Feature Pack 6.1.0.17
>  Rational Application Developer 7.0.0.6 (Trial)
>
> Thanks in advance,
>
> Martin
>
> PD: Sorry for my English! It isn't my native language

Hi Martin,
Have you checked if the "http://localhost:9081/bank/BankingService" is
working fine? i suggest you try it by copying the url to the address
bar in any browser and check if you get the same (http 400) error. If
you get same error then you will have to check the virtual hosts
settings in websphere application server.
To work with "localhost:9081" you should have a something like this in
the virtual hosts list:
localhost 9081
* 9081

If you dont get any error, then check for the plugin log and
system.out.log files to verify what the error might be.

best regards,
Cesar

0 new messages