2012-08-28 24 views
6

Estoy intentando generar un stub usando jax-ws para el servicio de administración de WSO2 Identity Server https://xx.xx.xx.xx:9447/services/RemoteUserStoreManagerService?wsdl.Generar stubs con jax-ws falla

He descargado el WSDL, pero cuando corro:

wsimport -p org.wso2 RemoteUserStoreManagerService.xml 

consigo los siguientes errores

[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. 

He aquí el esquema WSDL alrededor de la línea 679 del archivo donde aparece el primer error (no publicar el esquema completo, porque es bastante 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> 

Respuesta

3

Intente agregar el mensaje de salida en todos operaciones wsdl. Es interesante observar que wsimport no se queja en el funcionamiento getUserClaimValuesForClaims, y que el método tiene un mensaje de salida definido.

EDITAR: Puede editar WSDL sin temor debido a que estos métodos problemáticos tienen tipo de retorno nula por lo que puede poner lo que quiera como un tipo de retorno y simplemente ignorarlo. En otras palabras, al llamar al servicio web, solo está interesado en los parámetros de entrada, ya que estos métodos en realidad no devuelven nada. Por lo tanto, haga lo siguiente:

  1. hacer una copia de WSDL, por ejemplo, el nombre que client.wsdl
  2. Añadir mensaje de salida a todas las operaciones que no tienen que
  3. Generar un cliente de servicios Web desde client.wsdl (no cambiar el servicio!)
  4. métodos de servicio web de llamadas e ignorar el tipo de cambio de estos "problemáticos"
+0

Me di cuenta de eso, pero el problema es que este servicio está construido en el núcleo de carbono WSO2 y no estoy seguro de cómo y si puedo modificarlo. Supongo que necesito algún tipo de solución. – Ivo

+0

Bueno, primero intente ajustar WSDL sin modificar el servicio. Es posible (aunque no estoy seguro para este caso particular) haberlo hecho muchas veces. –

+0

Gracias, lo he intentado y funcionó bien, sin embargo aparecieron nuevos errores. – Ivo

0

La respuesta de Miljen Mikic fue excelente y me ayudó a encontrar la solución correcta. Pensé que daría un ejemplo de cómo hacer lo que él sugirió. Aviso de la lista de errores que los errores vienen en pares:

[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 
. 
. 
. 

muestra de WSDL de la OP sólo incluía los 2 primeros errores, pero la solución es similar para todos. El resultado es el siguiente: