13 Replies Latest reply on Aug 2, 2011 10:01 AM by dtonhofer

    Changing of soap:address location

    marius.oancea

      I have a webservice that is a stateless session bean.

      The service is deployed in jboss 4.2.1GA.

      When a customer download the wsdl, the soap address loaction is something like: 192.168.1.9:8080 and i have to change this to www.here.com.

      I've tried to play around with @WebContext, @WebService and some other advices found at http://jbws.dyndns.org/mediawiki/index.php/JBossWS_FAQs#How_do_I_know_what_endpoint_address_is_being_used.3F but i fail to make the generated wsdl file containing a custom url like for example:

      <soap:address location="http://www.here.com/services/MyService" />

      Anythink I try, the generated wsdl is containing:
      <soap:address location="http://127.0.0.1:8080/services/MyService" />

      or in general the IP of the server where service is installed instead of name.

      This is unacceptable on a production environment (if you use apache and mod_jk...)

      I also tried to use a :

      <jboss-client>
      <jndi-name>jbossws-client</jndi-name>

      <service-ref>
      <service-ref-name>service/MyService</service-ref-name>
      <wsdl-override>http://www.here.com:8080/jaxws-test/MyService?wsdl</wsdl-override>
      </service-ref>

      </jboss-client>

      But does not work. Maybe I do not place the file in the right place ?


      Finally i accepted even to use wsdlLocation in WebService anotation. But this is also not work (specified wsdl is used but the address is still replaced with the wrong ip).

      Please help.

        • 1. Re: Changing of soap:address location
          ropalka
          • 2. Re: Changing of soap:address location
            marius.oancea

            Yes. I know this and works but on my jboss there are many application with different webServiceHost(s)

            /deployment/bean[@name='WSServerConfig']/property[@name='webServiceHost']

            That is why i need this setting to be done service specific not jboss install specific.

            • 3. Re: Changing of soap:address location
              memema

              I have the same problem. Some solution or workaround? Thanks

              • 4. Re: Changing of soap:address location
                marius.oancea

                The only solution I found is to:
                1. Modify \jboss-4.2.1.GA\server\default\deploy\jbossws.sar\jbossws.beans\META-INF\jboss-beans.xml so that

                <property name="alwaysModifySOAPAddress">false</property>


                2. Use wsdlLocation in WebService anotation

                Take care, if abc is not existing, jboss will still replace abc with the ${jboss.bind.address}.


                <soap:address location="http://abc/services/MyService" />



                • 5. Re: Changing of soap:address location
                  memema

                  I have a more complex situation: one internal JBoss server with the web service, and several forwards from externals apache web servers (sorry for my bad english). Different customers have different access points thought differents urls and domains (the customer A access to http://serverA/ws, customer B to http://serverB/ws, etc), but the internal web service and jboss are the same. The annotation solution doesn't work in my case. Another idea?

                  • 6. Re: Changing of soap:address location
                    asoldano

                     

                    "memema" wrote:
                    I have a more complex situation: one internal JBoss server with the web service, and several forwards from externals apache web servers (sorry for my bad english). Different customers have different access points thought differents urls and domains (the customer A access to http://serverA/ws, customer B to http://serverB/ws, etc), but the internal web service and jboss are the same. The annotation solution doesn't work in my case. Another idea?


                    Not sure if this is exactly your use case, however you could comment out this
                    <property name="webServiceHost">${jboss.bind.address}</property>
                    

                    in your jbossws.beans/META-INF/jboss-beans.xml file (leave modifySOAPAddress to true). This way the engine should rewrite the soap:address using the host/port used to invoke the servlet providing you the wsdl.

                    • 7. Re: Changing of soap:address location
                      markusdöring

                      Sorry for bumping this old topic, but i have the same problem as memema.
                      I have commented out the webServiceHost and the rewrite worked just fine on JBossAS4.2.0 (JBossWS1.2).
                      Recently i updated to JBossAS4.2.2 (JBossWS2.0.1) and now it don't work anymore. it always generates the endpoint to http://jbossws.undefined.host:8080
                      Is this a knows issue in the current JBossWS?

                      • 8. Re: Changing of soap:address location
                        gbc1

                        I have same issue with jboaa ws 2.03... Does anyone have infos how to solve it?

                        • 9. Re: Changing of soap:address location

                          I was able to edit jbossws.beans/META-INF/jboss-beans.xml to change this

                          <soap address location="http://127.0.0.1:11011/ws/t"/>
                          


                          to the public facing url,

                          <soap address location="http://www.mydomaine.com:80/ws/t"/>
                          


                          Versions:

                          JBoss 4.2.2.GA
                          JBossWS Native 3.0.3.GA
                          libapache-mod-jk 1.2.18-3
                          apache 1.3.34-4.1

                          Changed part of jboss-beans.xml

                          <!-- An abstraction of server configuration aspects. -->
                          <bean name="WSServerConfig" class="org.jboss.wsf.stack.jbws.NativeServerConfig">
                           <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
                          
                           <!--
                           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 'modifySOAPAddress' is true.
                           If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
                          
                           If 'webServiceHost' is not set, JBossWS uses requesters protocol host when rewriting the <soap:address>.
                           -->
                           <!--
                           <property name="webServiceHost">${jboss.bind.address}</property>
                           -->
                           <property name="modifySOAPAddress">true</property>
                          
                           <!--
                           Set these properties to explicitly define the ports that will be used for rewriting the SOAP address.
                           Otherwise the ports will be identified by querying the list of installed connectors.
                           If multiple connectors are found the port of the first connector is used.
                           <property name="webServiceSecurePort">8443</property>
                           <property name="webServicePort">8080</property>
                           -->
                           <property name="webServicePort">80</property>
                          </bean>
                          


                          I commented out the webServiceHost property and uncommented the webServicePort port setting it to 80.

                          It would be better if JBossWS could also get the port from the requesters protocol port.


                          • 10. Re: Changing of soap:address location
                            izgur

                            Where do I find jbossws.beans/META-INF/jboss-beans.xml in JBoss 5.1 ?

                             

                            Thank you!

                            • 11. Re: Changing of soap:address location
                              izgur

                              I have do all steps but nothing changes...

                              I see that jbossws.beans/META-INF/jboss-beans.xml in only in jboss/server/all configuration, so I changes it there although i use the default configuration. Did Jboss took the changes made in all ???

                               

                              If he made, then probably this commenting lines doesn't work if u run jboss with -Djava.bind.address=x.x.x.x. Then it always takes the java.bind.address for the soap:address ?!

                               

                              karamba.)

                              • 12. Re: Changing of soap:address location
                                rosdi

                                For JBoss 5.1 the jboss-beans.xml is in server/{instance}/deployers/jbossws.deployer/META-INF/jboss-beans.xml

                                • 13. Re: Changing of soap:address location
                                  dtonhofer

                                  Alessio Soldano's approach above works nicely - http://community.jboss.org/message/337798#337798

                                   

                                  In JBoss 6 proxied behind an Apache HTTPd, go to

                                   

                                  ./deployers/jbossws.deployer/META-INF/stack-agnostic-jboss-beans.xml

                                   

                                  and comment out the line

                                   

                                  <property name="webServiceHost">${jboss.bind.address}</property>

                                   

                                  The WSDL will then show the correct soap:address location, not 127.0.0.1 or something like that.