Hi Adrian,

I added the following class to force an AddressingOperationInfo object to be
added. Note that the "Response"
string added is for our C# client.


/**
* This class registers an AddressingOperationInfo object with an
* OperationInfo, as required to support WS-Addressing.
*/
public class FcMoonServiceFactory extends JAXWSServiceFactory
{


/**
* Forces a new AddressingOperationInfo object to be registered with the
* OperationInfo.
*/

@Override
protected OperationInfo addOperation(Service endpoint, Method method, String
style)
{

OperationInfo op = super.addOperation(endpoint, method, style);

/*
* The AddressingOperationInfo ctor registers itself so nothing needs
* to be done with the new object created by this method.
*
* The "Response" string is appeneded to the action to provide a
* return string that matches that expected by the C# client.
*/

String action = getAction(op);
new AddressingOperationInfo(action, action + "Response", null, op);

return op;

}

}


Please let me know if this works for you.


Phil


On 27/02/07, Adrian Corcoran <[EMAIL PROTECTED]> wrote:

Hi,

I have a problem with invoking a service using ws-addressing. I have the
ws addressing action set, the AddressingInHandler does not seem to be able
to find the operation for that action. In fact when I debug through the
AddressingInHandler I see that service.getOperations() returns all the
correct operations for the service, however these OperationInfo have no
AddressingOperationInfo... I can't see any reason why, infact I can't see
where AddressingOperationInfo's are created!

I am using JAXB2 binding at the moment. Below is my config, am stumped!

Thanks for looking..


== soap request being sent ==

<env:Envelope xmlns:env=" http://schemas.xmlsoap.org/soap/envelope/";
    xmlns:wsa="http://www.w3.org/2005/08/addressing";>
    <env:Header>
        <wsa:Action> http://www.noname.com/de/ws/customerservice/EnrolCI
</wsa:Action>
        <wsa:ReplyTo>
            <wsa:Address>queue://CustomerServiceResponse</wsa:Address>
        </wsa:ReplyTo>
    </env:Header>
    <env:Body>
        <EnrolCIRequest xmlns="http://www.noname.com/de/ws";
            RequestIdentifier="requestidentifier">

 <serviceProviderInstanceIdentifier>0</serviceProviderInstanceIdentifier>
            <username>username</username>
            <address>address</address>
        </EnrolCIRequest>
    </env:Body>
</env:Envelope>

== services.xml ===
<beans xmlns="http://xfire.codehaus.org/config/1.0";>


  <xfire>
    <transports>
      <bean id="jmsTransport"
            class="org.codehaus.xfire.transport.jms.JMSTransport"
            xmlns=" http://xbean.org/schemas/spring/1.0";>
        <constructor-arg ref="xfire"/>
        <constructor-arg ref="connectionFactory"/>
      </bean>
    </transports>
  </xfire>

    <service xmlns:c="urn:CustomerService">
        <name>CustomerService</name>
        <serviceClass>de.ws.xfire.service.CustomerService_v1Impl</serviceClass>

        <serviceFactory>org.codehaus.xfire.jaxb2.JaxbServiceFactory
</serviceFactory>
        <inHandlers>
            <handler handlerClass="
org.codehaus.xfire.addressing.AddressingInHandler "/>
        </inHandlers>
        <outHandlers>
            <handler handlerClass="
org.codehaus.xfire.addressing.AddressingOutHandler"/>
        </outHandlers>
        <bindings>
            <soap11Binding name="c:CustomerServiceJMSBinding"
                transport="urn:xfire:transport:jms">
                <endpoints>
                    <endpoint name="c:CustomerServiceJMSEndpoint"
                        url="jms://CustomerService" />
                </endpoints>
            </soap11Binding>
        </bindings>

    </service>

    <bean id="connectionFactory"
        class="org.apache.activemq.ActiveMQConnectionFactory"
        singleton="true" xmlns="http://xbean.org/schemas/spring/1.0/ ">
        <constructor-arg value="tcp://localhost:61616"
            type="java.lang.String" />
    </bean>

</beans>


== CustomerService_v1Impl.java ===

package com.noname.de.ws.xfire.service;

import javax.jws.WebService;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.noname.de.ws.EnrolCIResponse ;

@WebService(serviceName = "CustomerService_v1", targetNamespace = "
http://www.noname.com/de/ws/customerservice";, endpointInterface = "
com.noname.de.ws.xfire.service.CustomerService_v1")
public class CustomerService_v1Impl
    implements CustomerService_v1
{

    final static Log logger = LogFactory.getLog(CustomerService_v1Impl.class);


    public EnrolCIResponse enrolCI(com.noname.de.ws.EnrolCIRequest req) {

        logger.debug("got req.....");

        EnrolCIResponse res = new EnrolCIResponse();

        return res;
    }
}


== CustomerService_v1 ==
package com.noname.de.ws.xfire.service;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult ;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

import com.noname.de.ws.EnrolCIResponse;

@WebService(name = "CustomerService_v1", targetNamespace = 
"http://www.noname.com/de/ws/customerservice
")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use =
SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface CustomerService_v1 {


    @WebMethod(operationName = "EnrolCI", action = "
http://www.noname.com/de/ws/customerservice/EnrolCI";)
    @WebResult(name = "EnrolCIResponse", targetNamespace = "
http://www.noname.com/de/ws";)
    public EnrolCIResponse enrolCI(
        @WebParam(name = "EnrolCIRequest", targetNamespace = 
"http://www.noname.com/de/ws
")
        com.noname.de.ws.EnrolCIRequest EnrolCIRequest);

}



Reply via email to