2015-11-04 19 views
6

Voglio rendere la query SQL al CUCM DB. Ho generato classi Java da WSDL con il plugin Maven jaxb2, ma Cisco AXL consiglia di usare wsdl2java. Ho molte classi Java con finali Req/Res (richiesta e risposta come ho capito). Questo è il mio codice:API CUCM AXL errate SoapAction

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); 
           } 
          } 
        });    
      } 
    } 
} 

Ma quando l'eseguo, ottengo l'errore:

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

Quindi, per come la vedo, problema è il servizio CUCM AXL ha metodo executeSQLQuery, ma non eseguire SQLQueryReq. Come posso fare in modo che Spring inserisca il metodo corretto in SoapAction? O devo usare solo wsdl2java?


UPDATE

Quando stavo generando classi Java, c'era anche lo schema XSD nella directory. jaxb2 config ha indicato il file WSDL, tuttavia, ho l'errore URI [src/main/resources/AXLAPI.wsdl] does not provide the scheme part. e Sembra che siano state create classi di plugin dallo schema xsd, non da wsdl. Ma questo wsdl era il file originale scaricato da CUCM. Cosa potrebbe esserci di sbagliato?

+0

Per quanto riguarda l'aggiornamento. Il problema è che "src/main/resources/AXLAPI.wsdl" non è un URI valido. L'errore "non fornisce la parte dello schema" indica che manca lo "schema" (ad es. "Https"). Se il WSDL si trova sul tuo filesystem locale, usa qualcosa come 'file: /// percorso/su/AXLAPI.wsdl'. –

+0

Grazie, "non fornisce la parte dello schema" ora scomparso e stampa 'BUILD SUCCESS', ma non genera fonti nella directory di destinazione –

risposta

2

Trovato this collegamento su developers.cisco.com. Questo how-to consiglia di utilizzare AXLPort, una sorta di wrapper per la richiesta SOAP alla CUCM. Mi sembra che l'interfaccia CUCM AXL SOAP non sia la scelta migliore per iniziare a lavorare con Spring WS

Problemi correlati