1

I have a wsdl defining a bunch of operations. One of which is defined as follows:

<wsdl:operation name="obtenirCommunication">
            <wsdl:documentation/>
            <soap:operation soapAction="obtenirCommunication" 
    style="document"/>
            <wsdl:input>
                <soap:body parts="requete" use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body parts="reponse" use="literal"/>
            </wsdl:output>
            <wsdl:fault name="fault">
                <soap:fault name="fault" use="literal"/>
            </wsdl:fault>
        </wsdl:operation>

As you can see, I specifically define the soapAction parameter to be obtenirCommunication. When I build my Java application with Maven, an interface is generated based on the wsdl using CXF.

<jaxws:client id="servicesFondationProxy" serviceName="srv:DesjServiceDivulgation"
        serviceClass="com.desjardins.finances.divulgation.divulgations.services.fondation.service.http.DesjServiceDivulgation"
        address="${com/desjardins/finances/divulgation/divulgations/Services_fondation_endpoint}">
        <jaxws:outInterceptors>
            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
                <constructor-arg>
                    <map>
                        <entry key="action" value="UsernameToken" />
                        <entry key="user" value="[...]" />
                        <entry key="passwordType" value="PasswordText" />
                        <entry key="passwordCallbackRef" value-ref="sfPasswordCallback" />
                    </map>
                </constructor-arg>
            </bean>
            <bean
                class="com.desjardins.finances.divulgation.divulgations.accesServicesFondation.CustomFieldInjectHandler"
                scope="singleton">
            </bean>
        </jaxws:outInterceptors>
        <jaxws:features>
            <wsa:addressing xmlns:wsa="http://cxf.apache.org/ws/addressing" />
        </jaxws:features>

    </jaxws:client>

When I go in this interface I can see the operation correctly set.

        @WebResult(name = "ObtenirCommunicationReponse", targetNamespace = "[...]", partName = "requete")
    @WebMethod(action = "obtenirCommunication")
    public ObtenirCommunicationReponseType obtenirCommunication(
        @WebParam(partName = "requete", name = "ObtenirCommunicationRequete", targetNamespace = "[...]")
        ObtenirCommunicationRequeteType requete
    ) throws Fault;

I can see the operation I defined, the action parameter is set correctly. Now when I run my server and click on the IHM element that toggles the service call, here's the action in the SOAP message being sent:

<Action xmlns="http://www.w3.org/2005/08/addressing">obtenirListeCommunication</Action>

I can't figure out why the action I specifically defined in my wsdl is being overwritten with obtenirListeCommunication. I should specify that obtenirListeCommunication is the action corresponding to the previous call I make when I go through the IHM. To clarify, first I call a service (obtenirListeCommunication) that will fetch and display a bunch of Communication objects. For each of those objects I can then call the second service (obtenirCommunication) to get more info on a specific communication.

It's like the action parameter doesn't get refreshed after the first service call.

My question is: what did I do wrong ? Did I forget to configure something ? Why is the action I specified in my wsdl being ignored / not being refreshed ? How does SOAP generate such headers ?

Thanks in advance for your help.

Yaoming
  • 79
  • 1
  • 6

0 Answers0