Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6720

SoapJaxbDataFormat not handling correctly SOAP action with request wrapper element

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.12.0
    • 2.16.4, 2.17.1, 2.18.0
    • camel-soap
    • None
    • Unknown

    Description

      If an interface to be used as SOAP service interface is configured to have parameters wrapped in a request wrapper element (eg. using @RequestWrapper),
      then an attempt to invoke a its method will throw NPE:

      java.lang.NullPointerException
      	at org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy.findQNameForSoapActionOrType(ServiceInterfaceStrategy.java:207)
      	at org.apache.camel.dataformat.soap.SoapJaxbDataFormat.createContentFromObject(SoapJaxbDataFormat.java:208)
      	at org.apache.camel.dataformat.soap.Soap11DataFormatAdapter.doMarshal(Soap11DataFormatAdapter.java:77)
      	at org.apache.camel.dataformat.soap.SoapJaxbDataFormat.marshal(SoapJaxbDataFormat.java:141)
      	at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)
      

      The reason for this is sequence of following:

      1. The ServiceInterfaceStrategy is creating a mapping of methods to MethodInfo.
      2. In case of RequestWrapper, the wrapper class is used as a single input TypeInfo, and no TypeInfo is being held for the real parameters.
      3. At method invocation, it tries to lookup the TypeInfo in the MethodInfo, but for the real parameter class, and it only contains mapping for the request wrapper. So it fails with NPE.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            c0stra Ondrej Fischer
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment