4 Replies Latest reply on Nov 22, 2006 12:28 PM by atquake

    WSDL SOAP ADDRESS REPLACE_WITH_ACTUAL_URL

    ovidiucn

      Hello,
      I have implemented a web service as a servlet endpoint and i'm trying to secure the communication between client & server (SSL). I have enabled the https server connector (8443).
      Right now, I'm stuck because i'm trying to change the soap address in the generated wsdl file. I have already investigated the solutions you provided in:



      My problem is that i don't manually generate the wsdl file from SEI (using wstools), but, let JBoss, at deployment time to generate it (JavaToWSDL).
      Unfourtunatelly, the soap:address element holds the http url, not the https one.
      My service is correctly deployed and the client web service can access the wsdl file using GET on https, but when it reaches to call the method on the web service the server responds with HTTP 302 (moved temporarely) and the Location http response attribute passes the https url; thus, the client xml parser crashes.

      Below, i attached some source code & configurations:

      web.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="WebApp_ID" version="2.4"
       xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
       <servlet>
       <servlet-name>HelloWorldService</servlet-name>
       <servlet-class>org.jboss.samples.HelloWorldWS</servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>HelloWorldService</servlet-name>
       <url-pattern>/HelloWorldService</url-pattern>
       </servlet-mapping>
      
       <security-constraint>
       <web-resource-collection>
       <web-resource-name>SecureHello</web-resource-name>
       <url-pattern>/HelloWorldService</url-pattern>
       <!-- <http-method>GET</http-method> -->
       <http-method>POST</http-method>
       </web-resource-collection>
      
       <auth-constraint>
       <role-name>*</role-name>
       </auth-constraint>
      
       <user-data-constraint>
       <transport-guarantee>CONFIDENTIAL</transport-guarantee>
       </user-data-constraint>
       </security-constraint>
      
       <security-role>
       <description>Any authorized user</description>
       <role-name>*</role-name>
       </security-role>
      
       <login-config>
       <auth-method>BASIC</auth-method>
       <realm-name>emp-db</realm-name>
       </login-config>
      
      </web-app>
      


      wsdl file accesed with https://hostname:8443/jboss-ws-hello/HelloWorldService?wsdl
      <definitions name='HelloWorldService' targetNamespace='http://com.burrsutter.jbossws/helloworld' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://com.burrsutter.jbossws/helloworld' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
       <types></types>
       <message name='HelloWorld_sayHelloResponse'>
       <part name='result' type='xsd:string'/>
       </message>
       <message name='HelloWorld_sayHello'>
       <part name='String_1' type='xsd:string'/>
       </message>
       <portType name='HelloWorld'>
      
       <operation name='sayHello' parameterOrder='String_1'>
       <input message='tns:HelloWorld_sayHello'/>
       <output message='tns:HelloWorld_sayHelloResponse'/>
       </operation>
       </portType>
       <binding name='HelloWorldBinding' type='tns:HelloWorld'>
       <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
       <operation name='sayHello'>
       <soap:operation soapAction=''/>
      
       <input>
       <soap:body namespace='http://com.burrsutter.jbossws/helloworld' use='literal'/>
       </input>
       <output>
       <soap:body namespace='http://com.burrsutter.jbossws/helloworld' use='literal'/>
       </output>
       </operation>
       </binding>
       <service name='HelloWorldService'>
      
       <port binding='tns:HelloWorldBinding' name='HelloWorldPort'>
       <soap:address location='http://hostname:8080/jboss-ws-hello/HelloWorldService'/>
       </port>
       </service>
      </definitions>
      


      the jboss-beans.xml looks like this
      <?xml version="1.0" encoding="UTF-8"?>
      
      <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
       xmlns="urn:jboss:bean-deployer">
      
       <bean name="ServiceEndpointManager" class="org.jboss.ws.server.ServiceEndpointManager">
       <!-- The WSDL, that is a required deployment artifact for an endpoint, has a soap:address>
      element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
       If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless AlwaysModifySOAPAddress is true.
       If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below. -->
      
      
       <property name="webServiceHost">${jboss.bind.address}</property>
       <property name="webServiceSecurePort">8443</property>
       <property name="webServicePort">8080</property>
       <property name="alwaysModifySOAPAddress">true</property>
      
       ...
      </deployment>
      


      Am i missing something? Is this somehow related to this JIRA issue? http://jira.jboss.org/jira/browse/JBWS-454
      I'm not using ws4ee, i'm using jbossws 1.0.3 GA (updated according to the forum discussions i mentioned above).
      Any thoughts?

      Thank you,
      Ovidiu