Question

Getting "Unable to find a matching Operation for this remote invocation" error on calling Web Service from Spring Integration client.

The Web Service has multiple operations, say process1, process2, process3 etc.

How to call Operation process2 that have 2 fields. Please tel me, what is missing in the below implementation.

Spring Integration config file:

    <bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
        <property name="classesToBeBound">
            <list>
                <value>com.model.Request</value>
            </list>
        </property>
    </bean>

    <int:gateway id="ws" service-interface="com.gateway.WsGateway"
        default-request-channel="inputChannel" />

    <int-ws:outbound-gateway request-channel="inputChannel"
        marshaller="jaxbMarshaller"
        uri="wsdl_url" />

WsGateway.java

public interface WsGateway {
    @Gateway(requestChannel = "inputChannel")
    public void callWS(Request request);
}

Request.java

@XmlAccessorType(value = XmlAccessType.FIELD)
@XmlRootElement(name = "process2")
public class Request {

    @XmlElement(name = "name")
    private String name;

    @XmlElement(name = "dept")
    private String dept;
}


Main.java

Request req = new Request();
req.setName("foo");
req.setDept("xyz");

gateway.callWS(req);
Was it helpful?

Solution

I suggest you to compare the XML wich is produced by your application with that which is required by the WS's WSDL.

You can do it via SOAP UI and some network wireshark.

I may guess, but you need a nakespace declaration for the XML which is a body of SOAP message:

@XmlType(name = 'RequestType', namespace = 'THE_NAMESPACE_URL')
@XmlAccessorType(value = XmlAccessType.FIELD)
@XmlRootElement(name = "process2", namespace = 'THE_NAMESPACE_URL')
public class Request
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top