title: Apache CXF - The given SOAPAction does not match an operation
body: <p>I started working again on a project I started a few years ago (code available here: <a href="http://code.google.com/p/mipnp/" rel="noreferrer">http://code.google.com/p/mipnp/</a>).
  It's a UPnP mediaserver that can stream media to an xbox 360.</p>
  
  <p>For the SOAP part in UPnP I used Apache CXF.
  With CXF version 2.4.8 everything works like it should.
  But whenever I try to update to CXF version 2.4.9 (or newer) I get the following exception:</p>
  
  <pre><code>WARNING: Interceptor for {urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1}MediaReceiverRegistrarService#{urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1}IsAuthorized has thrown exception, unwinding now
  org.apache.cxf.interceptor.Fault: The given SOAPAction urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1#IsAuthorized does not match an operation.
    at org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor$SoapActionInAttemptTwoInterceptor.handleMessage(SoapActionInInterceptor.java:188)
    at org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor$SoapActionInAttemptTwoInterceptor.handleMessage(SoapActionInInterceptor.java:162)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:209)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:191)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:114)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1336)
    at com.googlecode.mipnp.upnp.ServerHeaderFilter.doFilter(ServerHeaderFilter.java:60)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:365)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>This is what the SOAP request looks like:</p>
  
  <pre><code>POST /control/x_ms_mediareceiverregistrar HTTP/1.1
  User-Agent: Xbox/2.0.16202.0 UPnP/1.0 Xbox/2.0.16202.0
  Connection: Keep-alive
  Host:192.168.1.11:34331
  SOAPACTION: "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1#IsAuthorized"
  CONTENT-TYPE: text/xml; charset="utf-8"
  Content-Length: 304
  
  &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
     &lt;s:Body&gt;
        &lt;u:IsAuthorized xmlns:u="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"&gt;
           &lt;DeviceID&gt;&lt;/DeviceID&gt;
        &lt;/u:IsAuthorized&gt;
     &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>I'm guessing it has something to do with the 'DeviceID' parameter not being in the 'u' namespace.
  But I can't seem to find a fix or workaround.</p>
  
  <p>This is how i'm creating the web service:</p>
  
  <pre><code>/*
   * MediaReceiverRegistrar.java
   * Created on Jun 30, 2011, 4:00:45 PM
   */
  package com.googlecode.mipnp.mediaserver;
  
  import com.googlecode.mipnp.upnp.ServiceImpl;
  import javax.jws.WebMethod;
  import javax.jws.WebParam;
  import javax.jws.WebService;
  import javax.xml.ws.Holder;
  
  @WebService(
          portName="X_MS_MediaReceiverRegistrar",
          targetNamespace="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1")
  public class MediaReceiverRegistrar extends ServiceImpl {
  
      @WebMethod(operationName="IsAuthorized")
      public void isAuthorized(
              @WebParam(name="DeviceID")
              String deviceId,
              @WebParam(name="Result", mode=WebParam.Mode.OUT)
              Holder&lt;Integer&gt; result) {
  
          result.value = 1;
      }
  }
  </code></pre>
  
  <p>(You can find the complete code <a href="http://code.google.com/p/mipnp/source/browse/trunk/src/main/java/com/googlecode/mipnp/mediaserver/MediaReceiverRegistrar.java" rel="noreferrer">here</a>)</p>
  
  <p>And this is how the wsdl looks like:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;wsdl:definitions name="MediaReceiverRegistrarService" targetNamespace="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;wsdl:types&gt;
  &lt;xs:schema elementFormDefault="unqualified" targetNamespace="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1" version="1.0" xmlns:tns="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;xs:element name="IsAuthorized" type="tns:IsAuthorized"/&gt;
  &lt;xs:element name="IsAuthorizedResponse" type="tns:IsAuthorizedResponse"/&gt;
  &lt;xs:element name="IsValidated" type="tns:IsValidated"/&gt;
  &lt;xs:element name="IsValidatedResponse" type="tns:IsValidatedResponse"/&gt;
  &lt;xs:element name="RegisterDevice" type="tns:RegisterDevice"/&gt;
  &lt;xs:element name="RegisterDeviceResponse" type="tns:RegisterDeviceResponse"/&gt;
  &lt;xs:element name="getIdAsUrn" type="tns:getIdAsUrn"/&gt;
  &lt;xs:element name="getIdAsUrnResponse" type="tns:getIdAsUrnResponse"/&gt;
  &lt;xs:element name="getTypeAsUrn" type="tns:getTypeAsUrn"/&gt;
  &lt;xs:element name="getTypeAsUrnResponse" type="tns:getTypeAsUrnResponse"/&gt;
  &lt;xs:complexType name="getTypeAsUrn"&gt;
      &lt;xs:sequence/&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="getTypeAsUrnResponse"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="return" type="xs:string"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="IsValidated"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="DeviceID" type="xs:string"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="IsValidatedResponse"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="Result" type="xs:int"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="IsAuthorized"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="DeviceID" type="xs:string"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="IsAuthorizedResponse"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="Result" type="xs:int"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="getIdAsUrn"&gt;
      &lt;xs:sequence/&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="getIdAsUrnResponse"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="return" type="xs:string"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="RegisterDevice"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="RegistrationReqMsg" type="xs:base64Binary"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;xs:complexType name="RegisterDeviceResponse"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="RegistrationRespMsg" type="xs:base64Binary"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
    &lt;/wsdl:types&gt;
    &lt;wsdl:message name="RegisterDeviceResponse"&gt;
      &lt;wsdl:part element="tns:RegisterDeviceResponse" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="getTypeAsUrnResponse"&gt;
      &lt;wsdl:part element="tns:getTypeAsUrnResponse" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IsValidatedResponse"&gt;
      &lt;wsdl:part element="tns:IsValidatedResponse" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="getIdAsUrnResponse"&gt;
      &lt;wsdl:part element="tns:getIdAsUrnResponse" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="getIdAsUrn"&gt;
      &lt;wsdl:part element="tns:getIdAsUrn" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="getTypeAsUrn"&gt;
      &lt;wsdl:part element="tns:getTypeAsUrn" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="RegisterDevice"&gt;
      &lt;wsdl:part element="tns:RegisterDevice" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IsValidated"&gt;
      &lt;wsdl:part element="tns:IsValidated" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IsAuthorizedResponse"&gt;
      &lt;wsdl:part element="tns:IsAuthorizedResponse" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="IsAuthorized"&gt;
      &lt;wsdl:part element="tns:IsAuthorized" name="parameters"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:portType name="MediaReceiverRegistrar"&gt;
      &lt;wsdl:operation name="getTypeAsUrn"&gt;
        &lt;wsdl:input message="tns:getTypeAsUrn" name="getTypeAsUrn"&gt;
      &lt;/wsdl:input&gt;
        &lt;wsdl:output message="tns:getTypeAsUrnResponse" name="getTypeAsUrnResponse"&gt;
      &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="IsValidated"&gt;
        &lt;wsdl:input message="tns:IsValidated" name="IsValidated"&gt;
      &lt;/wsdl:input&gt;
        &lt;wsdl:output message="tns:IsValidatedResponse" name="IsValidatedResponse"&gt;
      &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="IsAuthorized"&gt;
        &lt;wsdl:input message="tns:IsAuthorized" name="IsAuthorized"&gt;
      &lt;/wsdl:input&gt;
        &lt;wsdl:output message="tns:IsAuthorizedResponse" name="IsAuthorizedResponse"&gt;
      &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="getIdAsUrn"&gt;
        &lt;wsdl:input message="tns:getIdAsUrn" name="getIdAsUrn"&gt;
      &lt;/wsdl:input&gt;
        &lt;wsdl:output message="tns:getIdAsUrnResponse" name="getIdAsUrnResponse"&gt;
      &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="RegisterDevice"&gt;
        &lt;wsdl:input message="tns:RegisterDevice" name="RegisterDevice"&gt;
      &lt;/wsdl:input&gt;
        &lt;wsdl:output message="tns:RegisterDeviceResponse" name="RegisterDeviceResponse"&gt;
      &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:portType&gt;
    &lt;wsdl:binding name="MediaReceiverRegistrarServiceSoapBinding" type="tns:MediaReceiverRegistrar"&gt;
      &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
      &lt;wsdl:operation name="getTypeAsUrn"&gt;
        &lt;soap:operation soapAction="" style="document"/&gt;
        &lt;wsdl:input name="getTypeAsUrn"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output name="getTypeAsUrnResponse"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="IsValidated"&gt;
        &lt;soap:operation soapAction="" style="document"/&gt;
        &lt;wsdl:input name="IsValidated"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output name="IsValidatedResponse"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="IsAuthorized"&gt;
        &lt;soap:operation soapAction="" style="document"/&gt;
        &lt;wsdl:input name="IsAuthorized"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output name="IsAuthorizedResponse"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="getIdAsUrn"&gt;
        &lt;soap:operation soapAction="" style="document"/&gt;
        &lt;wsdl:input name="getIdAsUrn"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output name="getIdAsUrnResponse"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="RegisterDevice"&gt;
        &lt;soap:operation soapAction="" style="document"/&gt;
        &lt;wsdl:input name="RegisterDevice"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output name="RegisterDeviceResponse"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:binding&gt;
    &lt;wsdl:service name="MediaReceiverRegistrarService"&gt;
      &lt;wsdl:port binding="tns:MediaReceiverRegistrarServiceSoapBinding" name="X_MS_MediaReceiverRegistrar"&gt;
        &lt;soap:address location="http://192.168.1.11:54802/control/x_ms_mediareceiverregistrar"/&gt;
      &lt;/wsdl:port&gt;
    &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>I tried adding the following line, because I read somewhere that the security measures went up since CXF version 2.4.9:</p>
  
  <pre><code>@EndpointProperty(key="soap.no.validate.parts", value="true")
  </code></pre>
  
  <p>But that doesn't make a difference.</p>