0

I am trying to generate a client for a web service with the WSDL_LOCATION: http://localhost:8089/SWIStoZZZws/SWIStoZZZws.asmx?WSDL

I'm using an Apache CXF 2.6.2. machine.

However, the client somehow ignores port 8089 and sent HTTP request to http://localhost/SWIStoZZZws/SWIStoZZZws.asmx?WSDL and as a result I have following error:

Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with http://localhost/SWIStoZZZws/SWIStoZZZws.asmx
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1619)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1530)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1438)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:660)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    ... 54 more

Any idea? Please help... I've been struggling with this for daaaaays. Cheers!

SpencerPark
  • 3,298
  • 1
  • 15
  • 27
  • 1
    Hello, did you try these solution : https://stackoverflow.com/a/5953252/390462. Another idea : maybe you can download the wsdl and generate your class implementation after that first step. – BendaThierry.com Apr 12 '20 at 23:50

2 Answers2

0

You can follow the official documentation in which you will find that code :

<beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:jaxws="http://cxf.apache.org/jaxws"
     xsi:schemaLocation="
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
     http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

     <jaxws:endpoint id="classImpl"
          implementor="org.apache.cxf.jaxws.service.Hello"
          endpointName="e:HelloEndpointCustomized"
          serviceName="s:HelloServiceCustomized"
          address="http://localhost:8080/test"
          xmlns:e="http://service.jaxws.cxf.apache.org/endpoint"
          xmlns:s="http://service.jaxws.cxf.apache.org/service" />

 </beans>
BendaThierry.com
  • 2,080
  • 1
  • 15
  • 17
  • This is not a possible solution in my case, because I use proxy web service that invokes other service, so in the beans I should have only configured proxy service. Thank you. – Zineta Husic Apr 13 '20 at 19:00
0

How you get endpoint address? Maybe you get endpoint address from file which is auto generate in your IDE

  • I have few ways to get endpoint address: First I tried by getting it directly from the database, where I keep web service's addresses and call them by using proxy service. Than I tried using the accessing the one that is auto-generated, finally I wrote a following URL: `URL wsdlURL1=new URL ("http://localhost:8089/SWIStoZZZws/SWIStoZZZws.asmx?WSDL"); SWIStoZZZws ss = new SWIStoZZZws(wsdlURL1, SERVICE_NAME);` This works and creates web service, so now I get **Could not send Message.** error. I think I will get out of my mind. huh – Zineta Husic Apr 13 '20 at 19:02
  • Some time ago when I changed WSDL address ( like in this excample [link](https://stackoverflow.com/questions/4455195/how-to-avoid-the-need-to-specify-the-wsdl-location-in-a-cxf-or-jax-ws-generated) I did not change default output error (like Can not initialize the default wsdl from http://localhost/SWIStoZZZws/SWIStoZZZws.asmx). It is important because maybe you send request on correnct URL, but get you error with default URL – Daniel Jabłoński Apr 14 '20 at 20:18
  • SOLVED! Hey people, just figure it out. The problem is in address binding, so, in order to change address in runtime, I have aded a code bellow after port definition: `String endpointURL = "http://localhost:8089/SWIStoZZZws/SWIStoZZZws.asmx?WSDL"; BindingProvider bp = (BindingProvider)port; bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);` as here is explained [link](https://stackoverflow.com/questions/2490737/how-to-change-webservice-url-endpoint) Thank You all... – Zineta Husic May 01 '20 at 23:52