Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CUCM AXL API wrong SoapAction

I want to make SQL query to CUCM DB. I generated Java classes from WSDL with Maven jaxb2 plugin, but Cisco AXL docs advice to use wsdl2java. I've got lot of Java classes with Req/Res endings (request and response as I understand). This is my code:

public class CUCMDatabaseConnector extends WebServiceGatewaySupport{
    private String SOAP_ACTION = "CUCM:DB ver=10.5";    

    public void updateData(){
            String END_USERS_REQUEST = REQUEST,
                    AXLurl = "https://" + properties.getCurrentCUCM_IP() + ":8443/axl/";

            ExecuteSQLQueryReq sqlRequest = new ExecuteSQLQueryReq();
            sqlRequest.setSql(END_USERS_REQUEST);

            WebServiceTemplate template = getWebServiceTemplate();
            template.setMessageSender(NullHostnameVerifier.getMessageSender());
            ExecuteSQLQueryRes sqlResponse = (ExecuteSQLQueryRes) template
                    .marshalSendAndReceive(
                            AXLurl, 
                            sqlRequest,
                            new WebServiceMessageCallback() {
                                @Override
                                public void doWithMessage(WebServiceMessage message) throws IOException, TransformerException {
                                    TransportContext context = TransportContextHolder.getTransportContext();
                                    HttpUrlConnection connection = (HttpUrlConnection) context.getConnection();

                                    //adding required headers
                                    connection.addRequestHeader( "SOAPAction", SOAP_ACTION);
                                    connection.addRequestHeader("Authorization", autenString);
                                }
                           }
                    });             
            }
    }
}

But when I run it, I get error:

org.springframework.ws.soap.client.SoapFaultClientException: The endpoint reference (EPR) for the Operation not found is https://IP:8443/axl/services/AXLAPIService and the WSA Action = CUCM:DB ver=10.5 executeSQLQueryReq

So, as I see, problem is CUCM AXL service has executeSQLQuery method, but not executeSQLQueryReq. How can I make Spring putting correct method in SoapAction? Or I need to use only wsdl2java?


UPDATE

When I was generating java classes, there was also .xsd schema in the directory. jaxb2 config pointed to WSDL file, however, I've got error URI [src/main/resources/AXLAPI.wsdl] does not provide the scheme part., and It looks like plugin built classes from xsd schema, not wsdl. But this wsdl was original file downloaded from CUCM. What could be wrong?

like image 961
Sergey Maksimenko Avatar asked Nov 04 '15 06:11

Sergey Maksimenko


1 Answers

Found this link on developers.cisco.com. This how-to advices to use AXLPort, a kind of wrapper for making SOAP request to CUCM. Looks to me, CUCM AXL SOAP interface is not the best choice to start working with Spring WS

like image 107
Sergey Maksimenko Avatar answered Oct 05 '22 15:10

Sergey Maksimenko