2012-08-28 12 views
6

Sto provando a generare uno stub utilizzando jax-ws per il servizio di amministrazione di WSO2 Identity Server https://xx.xx.xx.xx:9447/services/RemoteUserStoreManagerService?wsdl.Generazione di stub con jax-ws non riuscita

Ho scaricato il WSDL, ma quando ho eseguito:

wsimport -p org.wso2 RemoteUserStoreManagerService.xml 

Ottengo i seguenti errori

[ERROR] operation "updateCredential" has an invalid style 
    line 679 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "setUserClaimValue" has an invalid style 
    line 683 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUserClaimValues" has an invalid style 
    line 692 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUserClaimValue" has an invalid style 
    line 696 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateCredentialByAdmin" has an invalid style 
    line 705 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteRole" has an invalid style 
    line 739 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUser" has an invalid style 
    line 748 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateRoleName" has an invalid style 
    line 762 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateRoleListOfUser" has an invalid style 
    line 766 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "addUser" has an invalid style 
    line 780 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "addRole" has an invalid style 
    line 784 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateUserListOfRole" has an invalid style 
    line 788 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "setUserClaimValues" has an invalid style 
    line 797 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateCredential" has an invalid style 
    line 857 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "setUserClaimValue" has an invalid style 
    line 878 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUserClaimValues" has an invalid style 
    line 887 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUserClaimValue" has an invalid style 
    line 908 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateCredentialByAdmin" has an invalid style 
    line 917 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteRole" has an invalid style 
    line 1010 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUser" has an invalid style 
    line 1019 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateRoleName" has an invalid style 
    line 1040 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateRoleListOfUser" has an invalid style 
    line 1061 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "addUser" has an invalid style 
    line 1094 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "addRole" has an invalid style 
    line 1103 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateUserListOfRole" has an invalid style 
    line 1112 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "setUserClaimValues" has an invalid style 
    line 1121 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateCredential" has an invalid style 
    line 1205 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "setUserClaimValue" has an invalid style 
    line 1226 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUserClaimValues" has an invalid style 
    line 1235 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUserClaimValue" has an invalid style 
    line 1256 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateCredentialByAdmin" has an invalid style 
    line 1265 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteRole" has an invalid style 
    line 1358 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "deleteUser" has an invalid style 
    line 1367 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateRoleName" has an invalid style 
    line 1388 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateRoleListOfUser" has an invalid style 
    line 1409 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "addUser" has an invalid style 
    line 1442 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "addRole" has an invalid style 
    line 1451 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "updateUserListOfRole" has an invalid style 
    line 1460 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] operation "setUserClaimValues" has an invalid style 
    line 1469 of file:/C:/tmp/RemoteUserStoreManagerService.xml 

[ERROR] missing required property "style" of element "operation" 


     Failed to parse the WSDL. 

Ecco lo schema WSDL attorno alla riga 679 del file in cui appare il primo errore (non pubblicare l'intero schema, perché è piuttosto grande):

 <wsdl:operation name="updateCredential"> 
     <wsdl:input message="ns:updateCredentialRequest" wsaw:Action="urn:updateCredential"/> 
     <wsdl:fault message="ns:RemoteUserStoreManagerServiceUserStoreException" name="RemoteUserStoreManagerServiceUserStoreException" wsaw:Action="urn:updateCredentialRemoteUserStoreManagerServiceUserStoreException"/> 
    </wsdl:operation> 
    <wsdl:operation name="setUserClaimValue"> 
     <wsdl:input message="ns:setUserClaimValueRequest" wsaw:Action="urn:setUserClaimValue"/> 
     <wsdl:fault message="ns:RemoteUserStoreManagerServiceUserStoreException" name="RemoteUserStoreManagerServiceUserStoreException" wsaw:Action="urn:setUserClaimValueRemoteUserStoreManagerServiceUserStoreException"/> 
    </wsdl:operation> 
    <wsdl:operation name="getUserClaimValuesForClaims"> 
     <wsdl:input message="ns:getUserClaimValuesForClaimsRequest" wsaw:Action="urn:getUserClaimValuesForClaims"/> 
     <wsdl:output message="ns:getUserClaimValuesForClaimsResponse" wsaw:Action="urn:getUserClaimValuesForClaimsResponse"/> 
     <wsdl:fault message="ns:RemoteUserStoreManagerServiceUserStoreException" name="RemoteUserStoreManagerServiceUserStoreException" wsaw:Action="urn:getUserClaimValuesForClaimsRemoteUserStoreManagerServiceUserStoreException"/> 
    </wsdl:operation> 

risposta

3

Provare ad aggiungere un messaggio di output in tutto operazioni wsdl. È interessante notare che wsimport non si lamenta sull'operazione getUserClaimValuesForClaims e che il metodo ha definito il messaggio di output.

EDIT: È possibile modificare wsdl senza timore perché questi metodi problematici hanno un tipo di reso vuoto in modo da poter inserire tutto ciò che si desidera come tipo di ritorno e semplicemente ignorarlo. In altre parole, quando si chiama il servizio Web si è interessati solo ai parametri di input poiché questi metodi in realtà non restituiscono nulla. Pertanto, effettuare le seguenti operazioni:

  1. Eseguire una copia di WSDL, ad esempio name it client.wsdl
  2. Aggiungi messaggio di output a tutte le operazioni che non hanno lo
  3. generare un client di servizi Web da client.wsdl (non modificare il servizio!)
  4. metodi di servizio di chiamata Web e ignorare il tipo di cambio di questi "problematici" quelli
+0

Ho notato che, ma il problema è che questo servizio è costruito nel nucleo di carbonio WSO2 e non sono sicuro di come e se posso modificarlo. Suppongo di aver bisogno di una sorta di soluzione alternativa. – Ivo

+0

Bene, prima prova solo a modificare WSDL senza modificare il servizio. È possibile (non sono sicuro per questo caso particolare, però), l'ho fatto molte volte. –

+0

Grazie, l'ho provato e ho funzionato bene, tuttavia sono apparsi nuovi errori. – Ivo

0

La risposta di Miljen Mikic è stata eccellente e mi ha portato alla soluzione giusta. Ho pensato di dare un esempio di come fare ciò che ha suggerito. Avviso dall'elenco errore che gli errori sono a coppie:

[ERROR] operation "updateCredential" has an invalid style 
line 679 of file:/C:/tmp/RemoteUserStoreManagerService.xml 
. 
. 
. 
[ERROR] operation "updateCredential" has an invalid style 
line 1205 of file:/C:/tmp/RemoteUserStoreManagerService.xml 
. 
. 
. 

campione wsdl del PO incluso solo i primi 2 errori, ma la soluzione è simile per tutti. Il risultato diventa:

<wsdl:operation name="updateCredential"> 
    <wsdl:input message="ns:updateCredentialRequest" wsaw:Action="urn:updateCredential"/> 
    <wsdl:output message="" /> 
    <wsdl:fault message="ns:RemoteUserStoreManagerServiceUserStoreException" name="RemoteUserStoreManagerServiceUserStoreException" wsaw:Action="urn:updateCredentialRemoteUserStoreManagerServiceUserStoreException"/> 
</wsdl:operation> 
<wsdl:operation name="setUserClaimValue"> 
    <wsdl:input message="ns:setUserClaimValueRequest" wsaw:Action="urn:setUserClaimValue"/> 
    <wsdl:output message="" /> 
    <wsdl:fault message="ns:RemoteUserStoreManagerServiceUserStoreException" name="RemoteUserStoreManagerServiceUserStoreException" wsaw:Action="urn:setUserClaimValueRemoteUserStoreManagerServiceUserStoreException"/> 
</wsdl:operation>