title: Message part was not recognized. (Does it exist in service WSDL?)
body: <p>I have the following wsdl file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;definitions 
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:tns="http://soap.securityconstraintapp.smals.be/" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
      xmlns:wsp="http://www.w3.org/ns/ws-policy"
      xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
      xmlns:s0="http://schemas.xmlsoap.org/wsdl/" 
      xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
      targetNamespace="http://soap.securityconstraintapp.smals.be/" 
      name="SAMLSecuredHelloImplService"&gt;
      &lt;types&gt;
          &lt;xsd:schema targetNamespace="http://soap.securityconstraintapp.smals.be/"
              xmlns="http://www.w3.org/2001/XMLSchema"&gt;
              &lt;xsd:complexType name="principal"&gt;
                  &lt;xsd:sequence&gt;
                      &lt;xsd:element name="name" type="xsd:string"&gt;&lt;/xsd:element&gt;
                  &lt;/xsd:sequence&gt;
              &lt;/xsd:complexType&gt;
          &lt;/xsd:schema&gt;
      &lt;/types&gt;
      &lt;message name="getHello"&gt;
          &lt;part name="arg0" type="xsd:string" /&gt;
      &lt;/message&gt;
      &lt;message name="getHelloResponse"&gt;
          &lt;part name="return" type="xsd:string" /&gt;
      &lt;/message&gt;
      &lt;message name="getPrincipalRequest"&gt;&lt;/message&gt;
      &lt;message name="getPrincipalResponse"&gt;
          &lt;part name="principal" type="xsd:string" /&gt;
      &lt;/message&gt;
      &lt;portType name="SAMLSecuredHello"&gt;
          &lt;operation name="getHello"&gt;
              &lt;input
                  wsam:Action="http://soap.securityconstraintapp.smals.be/SAMLSecuredHello/getHelloRequest"
                  message="tns:getHello" /&gt;
              &lt;output
                  wsam:Action="http://soap.securityconstraintapp.smals.be/SAMLSecuredHello/getHelloResponse"
                  message="tns:getHelloResponse" /&gt;
          &lt;/operation&gt;
          &lt;operation name="getPrincipal"&gt;
              &lt;input
                  wsam:Action="http://soap.securityconstraintapp.smals.be/SAMLSecuredHello/getPrincipalRequest"
                  message="tns:getPrincipalRequest" /&gt;
              &lt;output
                  wsam:Action="http://soap.securityconstraintapp.smals.be/SAMLSecuredHello/getPrincipalResponse"
                  message="tns:getPrincipalResponse" /&gt;
          &lt;/operation&gt;
      &lt;/portType&gt;
      &lt;binding name="SAMLSecuredHelloImplPortBinding" type="tns:SAMLSecuredHello"&gt;
          &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http"
              style="rpc" /&gt;
          &lt;operation name="getHello"&gt;
              &lt;input&gt;
                  &lt;soap:body use="literal"
                      namespace="http://soap.securityconstraintapp.smals.be/" /&gt;
              &lt;/input&gt;
              &lt;output&gt;
                  &lt;soap:body use="literal"
                      namespace="http://soap.securityconstraintapp.smals.be/" /&gt;
              &lt;/output&gt;
          &lt;/operation&gt;
          &lt;operation name="getPrincipal"&gt;
              &lt;input&gt;
                  &lt;soap:body use="literal"
                      namespace="http://soap.securityconstraintapp.smals.be/" /&gt;
              &lt;/input&gt;
              &lt;output&gt;
                  &lt;soap:body use="literal"
                      namespace="http://soap.securityconstraintapp.smals.be/" /&gt;
              &lt;/output&gt;
          &lt;/operation&gt;
      &lt;/binding&gt;
      &lt;service name="SAMLSecuredHelloImplService"&gt;
          &lt;port name="SAMLSecuredHelloImplPort" binding="tns:SAMLSecuredHelloImplPortBinding"&gt;&lt;/port&gt;
      &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>I generate my java from this wsdl using cxf and it works fine.</p>
  
  <p>The first operation getHello works fine but the getPrincipalrequest does not, I guess this is some minor error in my wsdl but I can't seem to find it.</p>
  
  <p>The error my cxf throws on this request:</p>
  
  <pre><code>10:13:36,778 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-172.17.0.2:8080-3) Interceptor for {http://soap.securityconstraintapp.smals.be/}SAMLSecuredHelloImplService has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Message part {http://soap.securityconstraintapp.smals.be/}getPrincipal was not recognized.  (Does it exist in service WSDL?)
          at org.apache.cxf.interceptor.BareInInterceptor.handleMessage(BareInInterceptor.java:133)
          at org.apache.cxf.binding.soap.interceptor.RPCInInterceptor.handleMessage(RPCInInterceptor.java:111)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
          at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
          at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249)
          at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:97)
          at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:131)
          at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:289)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:209)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
          at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)
          at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:420)
          at org.keycloak.adapters.saml.AbstractSamlAuthenticatorValve.invoke(AbstractSamlAuthenticatorValve.java:184)
          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:559)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
          at be.smals.jboss.ProxyValve.invoke(ProxyValve.java:107)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:656)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)
          at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_131]
  </code></pre>
  
  <p>The responses I get:</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;soap:Body&gt;
        &lt;ns1:getHelloResponse xmlns:ns1="http://soap.securityconstraintapp.smals.be/"&gt;
           &lt;return&gt;SAML, hello ababa&lt;/return&gt;
        &lt;/ns1:getHelloResponse&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;soap:Body&gt;
        &lt;soap:Fault&gt;
           &lt;faultcode&gt;soap:Client&lt;/faultcode&gt;
           &lt;faultstring&gt;Message part {http://soap.securityconstraintapp.smals.be/}getPrincipal was not recognized.  (Does it exist in service WSDL?)&lt;/faultstring&gt;
        &lt;/soap:Fault&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>After changing</p>
  
  <pre><code>&lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /&gt;
  </code></pre>
  
  <p>to </p>
  
  <pre><code>&lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /&gt;
  </code></pre>
  
  <p>I instead got the following error:</p>
  
  <pre><code>10:11:57,657 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-172.17.0.2:8080-1) Interceptor for {http://soap.securityconstraintapp.smals.be/}SAMLSecuredHelloImplService has thrown exception, unwinding now: java.lang.NullPointerException
          at org.apache.cxf.service.factory.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:97)
          at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:146)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_131]
          at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_131]
          at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
          at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
          at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249)
          at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:97)
          at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:131)
          at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:289)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:209)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
          at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)
          at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:420)
          at org.keycloak.adapters.saml.AbstractSamlAuthenticatorValve.invoke(AbstractSamlAuthenticatorValve.java:184)
          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:559)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
          at be.smals.jboss.ProxyValve.invoke(ProxyValve.java:107)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:656)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)
          at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_131]
  
  10:11:57,691 INFO  [org.apache.cxf.services.SAMLSecuredHelloImplService.SAMLSecuredHelloImplPort.SAMLSecuredHello] (http-172.17.0.2:8080-1) Outbound Message
  ---------------------------
  ID: 2
  Response-Code: 500
  Encoding: UTF-8
  Content-Type: text/xml
  Headers: {}
  Payload: &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soap:Body&gt;&lt;soap:Fault&gt;&lt;faultcode&gt;soap:Server&lt;/faultcode&gt;&lt;faultstring&gt;Fault occurred while processing.&lt;/faultstring&gt;&lt;/soap:Fault&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;
  --------------------------------------
  </code></pre>