You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Mathaus Erich Ramos (JIRA)" <ji...@apache.org> on 2018/11/17 21:17:00 UTC

[jira] [Updated] (CXF-7898) Cxf returns 'null' on MessagePartInfo typeClass in services with multiple portTypes

     [ https://issues.apache.org/jira/browse/CXF-7898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mathaus Erich Ramos updated CXF-7898:
-------------------------------------
    Description: 
I created a program to read differents wsdls and build their input and output attributes. But, I found a issue that when there are more than one portType and multiple Bindings each using a different portType, the classType of MessagePartInfo extracted from operationInfo Inputs and Outpus is always null, except in the first Binding readed. 
 I maked a test changing the portType of all bindings to just one, and all of them has readded with no problem.
 I think that the CXF cannot read multiple PortTypes.

 

*Code used to extract:*
{code:java}
public class DynClient {
    
    
    public static void main(String[] args) {
        JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
        Client client = factory.createClient("http://intsaprm.hptransportes.com.br:8051/wsConsultaSQL/MEX?wsdl");
        
        for (ServiceInfo service : client.getEndpoint().getService().getServiceInfos()) {
            for (BindingInfo binding : service.getBindings()) {
                System.out.println("Binding: " + binding.getName().getLocalPart());
                binding.getOperations().forEach(operation -> {                    
                    if (operation.getInput() != null) {                        
                        operation.getInput().getMessageParts().forEach(part -> {
                            System.out.println(part.getName().getLocalPart() + "=>" + part.getTypeClass());
                        });
                    }
                    if (operation.getOutput() != null) {
                        operation.getOutput().getMessageParts().forEach(part -> {
                            System.out.println(part.getName().getLocalPart() + "=>" + part.getTypeClass());
                        });
                    }
                });
            }
        }
        
    }
}{code}
 

*Output:*


{panel:title=My title}
Binding: RM_IwsBase
parameters=>class com.totvs.CheckServiceActivity
parameters=>class com.totvs.CheckServiceActivityResponse
parameters=>class com.totvs.AutenticaAcesso
parameters=>class com.totvs.AutenticaAcessoResponse
parameters=>class com.totvs.Implements
parameters=>class com.totvs.ImplementsResponse
Binding: RM_IwsConsultaSQL
parameters=>null
parameters=>null
parameters=>null
parameters=>null
parameters=>null
parameters=>null
Binding: RM_IRMSServer
parameters=>null
parameters=>null
parameters=>null
parameters=>null
{panel}

 

  was:
I created a program to read differents wsdls and build their input and output attributes. But, I found a issue that when there are more than one portType and multiple Bindings each using a different portType, the classType of MessagePartInfo extracted from operationInfo Inputs and Outpus is always null, except in the first Binding readed. 
I maked a test changing the portType of all bindings to just one, and all of them has readded with no problem.
I think that the CXF cannot read multiple PortTypes.

 

*Code used to read:*
{code:java}
public Map<String, Object> extractRequestAttributes(OperationInfo operation) throws ExtractionException {
 Map<String, Object> values = new HashMap<>();
 if (operation.getInput() != null) { 
 for (MessagePartInfo part : operation.getInput().getMessageParts()) {
 Class<?> partType = part.getTypeClass();
 ...
}{code}
 

(Complete code on: [https://github.com/MathUlbrich/SoftExpertPoC])

 

*Wsdl used to read:*
[http://intsaprm.hptransportes.com.br:8051/wsConsultaSQL/MEX?wsdl]


> Cxf returns 'null' on MessagePartInfo typeClass in services with multiple portTypes
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-7898
>                 URL: https://issues.apache.org/jira/browse/CXF-7898
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>            Reporter: Mathaus Erich Ramos
>            Priority: Major
>
> I created a program to read differents wsdls and build their input and output attributes. But, I found a issue that when there are more than one portType and multiple Bindings each using a different portType, the classType of MessagePartInfo extracted from operationInfo Inputs and Outpus is always null, except in the first Binding readed. 
>  I maked a test changing the portType of all bindings to just one, and all of them has readded with no problem.
>  I think that the CXF cannot read multiple PortTypes.
>  
> *Code used to extract:*
> {code:java}
> public class DynClient {
>     
>     
>     public static void main(String[] args) {
>         JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
>         Client client = factory.createClient("http://intsaprm.hptransportes.com.br:8051/wsConsultaSQL/MEX?wsdl");
>         
>         for (ServiceInfo service : client.getEndpoint().getService().getServiceInfos()) {
>             for (BindingInfo binding : service.getBindings()) {
>                 System.out.println("Binding: " + binding.getName().getLocalPart());
>                 binding.getOperations().forEach(operation -> {                    
>                     if (operation.getInput() != null) {                        
>                         operation.getInput().getMessageParts().forEach(part -> {
>                             System.out.println(part.getName().getLocalPart() + "=>" + part.getTypeClass());
>                         });
>                     }
>                     if (operation.getOutput() != null) {
>                         operation.getOutput().getMessageParts().forEach(part -> {
>                             System.out.println(part.getName().getLocalPart() + "=>" + part.getTypeClass());
>                         });
>                     }
>                 });
>             }
>         }
>         
>     }
> }{code}
>  
> *Output:*
> {panel:title=My title}
> Binding: RM_IwsBase
> parameters=>class com.totvs.CheckServiceActivity
> parameters=>class com.totvs.CheckServiceActivityResponse
> parameters=>class com.totvs.AutenticaAcesso
> parameters=>class com.totvs.AutenticaAcessoResponse
> parameters=>class com.totvs.Implements
> parameters=>class com.totvs.ImplementsResponse
> Binding: RM_IwsConsultaSQL
> parameters=>null
> parameters=>null
> parameters=>null
> parameters=>null
> parameters=>null
> parameters=>null
> Binding: RM_IRMSServer
> parameters=>null
> parameters=>null
> parameters=>null
> parameters=>null
> {panel}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)