[ 
http://jira.codehaus.org/browse/XFIRE-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_100564
 ] 

Boletho commented on XFIRE-1051:
--------------------------------

I accidentally hit enter. Continuing my post:

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";>
        <display-name>HelloWorldWS</display-name>
        <context-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>
                        /WEB-INF/applicationContext.xml
                        classpath:org/codehaus/xfire/spring/xfire.xml
                </param-value>
        </context-param>

        <listener>
                <listener-class>
                        org.springframework.web.context.ContextLoaderListener
                </listener-class>
        </listener>

        <servlet>
                <servlet-name>xfire</servlet-name>
                <servlet-class>
                        org.springframework.web.servlet.DispatcherServlet
                </servlet-class>
        </servlet>

</web-app>

xfire-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" 
"http://www.springframework.org/dtd/spring-beans.dtd";>
<beans>
        <bean
                
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
                <property name="urlMap">
                        <map>
                                <entry key="/1.0">
                                        <ref bean="helloworld" />
                                </entry>
        
                        </map>
                </property>
        </bean>
        
        <bean id="helloworld"
                class="org.codehaus.xfire.spring.remoting.XFireExporter">
              <property name="serviceFactory">
                        <ref bean="xfire.serviceFactory" />
                </property>  
                <property name="xfire">
                        <ref bean="xfire" />
                </property>
                <property name="serviceBean">
                        <ref bean="helloWorldService" />
                </property>
 
        <property name="serviceClass">
                        <value>
                                
com.example.helloworld.webservice.HelloWorldService
                        </value>
                </property>
                <property name="inHandlers">
                        <list>
                                <bean 
class="org.codehaus.xfire.util.dom.DOMInHandler" />
                                <bean
                                        
class="org.codehaus.xfire.security.wss4j.WSS4JInHandler">
                                        <property name="properties">
                                                      <map>
                                                                <entry 
key="passwordCallbackRef" >
                                                                   <ref 
bean="userNameTokenPasswordCallback" />
                                                               </entry>
                                                              <entry 
key="action" value="UsernameToken" />
                                                         </map>
                                        </property>
                                </bean>
                                <!-- look in applicationContext_ws-security.xml 
for definition -->
                                <ref bean="customerNumberAuthorizationHandler" 
/>                               
                                <ref bean="userAuthorizationHandler" />
                                <ref bean="userNameTokenValidationHandler"/>
                        </list>
                </property>
        </bean>

        <!-- END SNIPPET: xfire -->
</beans>

With this code in place my wsdl:address location was always created properly 
but wsdlsoap:operation soapAction was always empty. Then i went onto add ws 
addressing support so that soap action is non-empty. To do that I extended 
ObectServiceFactory and provided for get action, my class and configuration 
follow. After I have made the changes the generated WSDL no longer shows the 
proper address location although my soap action shows up with the value i have 
configured it for:

public class WsaObjectServiceFactory extends ObjectServiceFactory {
    private static final Logger LOGGER = 
Logger.getLogger(WsaObjectServiceFactory.class);

    /**
     * Creates a new WsaObjectServiceFactory object.
     *
     * @param bp
     */
    public WsaObjectServiceFactory(BindingProvider bp) {
        super(bp);
    }

    /**
     * Creates a new WsaObjectServiceFactory object.
     */
    public WsaObjectServiceFactory() {
        super();
    }

    /**
     * Get action.
     *
     * @param arg0
     *
     * @return action.
     */
    protected String getAction(OperationInfo arg0) {
        AddressingOperationInfo aoi = new 
AddressingOperationInfo("urn:getHelloWorld",
                arg0);
        LOGGER.debug("set aoi: " + aoi);

        return "urn:getHelloWorld";
    }
}

web.xml
NO CHANGES

xfire-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" 
"http://www.springframework.org/dtd/spring-beans.dtd";>
<beans>
        <bean
                
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
                <property name="urlMap">
                        <map>
                                <entry key="/1.0">
                                        <ref bean="helloworld" />
                                </entry>
        
                        </map>
                </property>
        </bean>
        <bean id="wsaServiceFactory"
                
class="com.example.helloworld.webservice.WsaObjectServiceFactory">
    </constructor-arg>
                <constructor-arg index="0" ref="aegisBindingProvider" />
        </bean>

        <bean id="aegisBindingProvider"
                class="org.codehaus.xfire.aegis.AegisBindingProvider">
                <constructor-arg index="0" ref="aegisTypeRegistry" />
        </bean>

        <bean id="aegisTypeRegistry"
                
class="org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry">
                <constructor-arg value="true" />
        </bean>

 
        <bean id="eligibility"
                class="org.codehaus.xfire.spring.remoting.XFireExporter">
                <property name="xfire">
                        <ref bean="xfire" />
                </property>
                <property name="serviceBean">
                        <ref bean="helloWorldService" />
                </property>

                <property 
name="namespace"><value>com.example.helloworld.webservice</value></property>
        
                <property name="serviceClass">
                        <value>
                                
com.example.helloworld.webservice.HelloWorldService
                        </value>
                </property>
                <property name="serviceFactory">
                        <ref bean="wsaServiceFactory" />
                </property>
                <property name="properties">
                        <map>
                                <entry>
                                        <key>
                                                
<value>wsdlBuilder.generateImports</value>
                                        </key>
                                        <value>true</value>
                                </entry>
                        </map>
                </property>

                <property name="inHandlers">
                        <list>
                                <bean 
class="org.codehaus.xfire.util.dom.DOMInHandler" />
                                <bean 
class="org.codehaus.xfire.addressing.AddressingInHandler" />
                                <bean
                                        
class="org.codehaus.xfire.security.wss4j.WSS4JInHandler">
                                        <property name="properties">
                                                      <map>
                                                                <entry 
key="passwordCallbackRef" >
                                                                   <ref 
bean="userNameTokenPasswordCallback" />
                                                               </entry>
                                                              <entry 
key="action" value="UsernameToken Timestamp" />
                                                         </map>
                                        </property>
                                </bean>
                                <!-- look in applicationContext_ws-security.xml 
for definition -->
                                <ref bean="customerNumberAuthorizationHandler" 
/>                               
                                <ref bean="userAuthorizationHandler" />
                                <ref bean="userNameTokenValidationHandler"/>
                        </list>
                </property>
        </bean>

        <!-- END SNIPPET: xfire -->
</beans>

What am i doing wrong? Please help

> Invalid wsdlsoap:address location is created when using custom service 
> factory.
> -------------------------------------------------------------------------------
>
>                 Key: XFIRE-1051
>                 URL: http://jira.codehaus.org/browse/XFIRE-1051
>             Project: XFire
>          Issue Type: Bug
>    Affects Versions: 1.2.5
>         Environment: WAS 6.0, Java 1.4, Windows XP SP2
>            Reporter: Boletho
>            Assignee: Dan Diephouse
>
> I have looked around and found two bugs 
> (http://jira.codehaus.org/browse/XFIRE-366 and 
> http://jira.codehaus.org/browse/XFIRE-243) but they didn't solve my problem.
> I have created a web service and it worked fine, following are the relevant 
> configuration files:
> web.xml

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to