1

I have deployed a web service on OpenShift by annotating a class with @WebService and a public method with @WebMethod. Then, I deployed the class in a WildFly8 container and the server started the service. In order to be able to access the WSDL file I had to create a file "jboss-web.xml" inside the WEB-INF folder and change the context-root.

Now I am able to access the WSDL file, but not the service itself. The problem is in this line of the wsdl file:

<wsdl:service name="PlotterService">
    <wsdl:port binding="tns:PlotterServiceSoapBinding" name="PlotterPort">
      <soap:address location="http://127.8.173.1:8080/Plotter"/>
    </wsdl:port>
</wsdl:service>

The address location is set to an internal IP and should be replaced with the URL of my application. How can I do that? The only file I am able to modify is the class that I annotated at the beginning.

Ciri
  • 371
  • 1
  • 6
  • 19

1 Answers1

1

I managed to solve this:

Openshift does not have Web services setup by default, so we need to modify the server configuration. To do this open .openshift/config/standalone.xml (this file may be hidden) in an editor and make the following additions:

If the webservices subsystem is not configured as below under the element, copy the following and replace the webservices subsystem to enable and configure Web Services:

<subsystem xmlns="urn:jboss:domain:webservices:1.1">
    <modify-wsdl-address>true</modify-wsdl-address>
    <wsdl-host>${env.OPENSHIFT_APP_DNS}</wsdl-host>
    <wsdl-port>80</wsdl-port>
    <endpoint-config name="Standard-Endpoint-Config"/>
    <endpoint-config name="Recording-Endpoint-Config">
    <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
        <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
    </pre-handler-chain>
    </endpoint-config>
</subsystem>
Ciri
  • 371
  • 1
  • 6
  • 19
  • I'm having the same issue and the webservices subsystem is configured as you added above. still I'm unable to get service endpoint – Mohammad Faisal Nov 02 '14 at 17:10
  • In my case this modification did the trick. I found this by chance on a github page with a custom cartridge. Unfortunately, I'm not familiar with OpenShift to be able to help you any further, but looking around on github for similar applications and comparing configuration files might prove effective. – Ciri Nov 10 '14 at 15:35
  • can u provide some help over here ->http://stackoverflow.com/questions/37665010/unable-to-deploy-restful-webservice-on-openshift?noredirect=1#comment62808863_37665010 – Parth Doshi Jun 07 '16 at 02:41