4 Replies Latest reply: Oct 15, 2012 1:39 PM by 968275 RSS

    wsse-Server CodecHandler Failed toUnable to find xml element for parameter

    968275
      Hi All,
      I am invoking a Java webservice with signing and encryption (WSSE) of the soap message from my client program.
      The webservice is built with JWSC ant task and deployed in weblogic 10.3.2 I am getting the below exception while invoking it.
      I am invoking a web service which takes a string as input and returns a string as output. This web service uses signing and encryption on both directions.
      I have checked the public/private key certificates and everything seems to be ok.
      I am not sure how to fix the below issue. Let me know if you have come across this problem and resolved it.


      ---[HTTP response - https://cdctdevapp:7042/casestatusservice/CaseStatusService - 500]---
      Date: Mon, 15 Oct 2012 03:24:12 GMT
      X-powered-by: Servlet/2.5 JSP/2.1
      Content-type: text/xml; charset=utf-8
      Transfer-encoding: chunked
      null: HTTP/1.1 500 Internal Server Error
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>[Server CodecHandler] Failed to decode
      -&gt; Unable to find xml element for parameter: message
      </faultstring><detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">weblogic.wsee.codec.CodecException: Unable to find xml element for parameter: message
           at weblogic.wsee.codec.soap11.SoapDecoder.checkNullElement(SoapDecoder.java:397)
           at weblogic.wsee.codec.soap11.SoapDecoder.decodeParams(SoapDecoder.java:285)
           at weblogic.wsee.codec.soap11.SoapDecoder.decodeParts(SoapDecoder.java:172)
           at weblogic.wsee.codec.soap11.SoapDecoder.decode(SoapDecoder.java:125)
           at weblogic.wsee.codec.soap11.SoapCodec.decode(SoapCodec.java:182)
           at weblogic.wsee.ws.dispatch.server.CodecHandler.decode(CodecHandler.java:139)
           at weblogic.wsee.ws.dispatch.server.CodecHandler.handleRequest(CodecHandler.java:40)
           at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)
           at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:114)
           at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
           at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
           at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
           at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:285)
           at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:169)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
           at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
           at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
           at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
      </bea_fault:stacktrace></detail></env:Fault></env:Body></env:Envelope>--------------------

      <WSEE:1>Created<SoapMessageContext.<init>:48>
      <WSEE:1>set Message called: com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@996b65<SoapMessageContext.setMessage:65>
      <WSEE:1>set Message called: com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@996b65<SoapMessageContext.setMessage:65>
      <WSEE:1>set Message called: com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@996b65<SoapMessageContext.setMessage:65>
      <WSEE:1>set Message called: com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl@996b65<SoapMessageContext.setMessage:65>
      Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: [Server CodecHandler] Failed to decode
      -> Unable to find xml element for parameter: message

           at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:197)
           at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)
           at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:125)
           at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:95)
           at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:136)
           at $Proxy27.sayHello(Unknown Source)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler.invoke(ClientInstanceInvocationHandler.java:84)
           at $Proxy28.sayHello(Unknown Source)
           at org.adr.nydcci.wss.ws5UntSignEncryptHttps.client.ws5UntSignEncryptHttpsPortClient.main(ws5UntSignEncryptHttpsPortClient.java:44)
        • 1. Re: wsse-Server CodecHandler Failed toUnable to find xml element for parameter
          Kalyan Pasupuleti-Oracle
          Hi,

          It looks like you are running older DD file in weblogic.xml file check this one.

          bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"


          wls 6,7,8 was able to read till wls 10.3.0 but not after that so please change the DD file according to new one.



          Check for namespace for wls 10.3


          http://docs.oracle.com/cd/E15051_01/wls/docs103/webapp/weblogic_xml.html


          Regards,
          Kal
          • 2. Re: wsse-Server CodecHandler Failed toUnable to find xml element for parameter
            968275
            Thanks Kal for your response. However I am unable to find a reference for an older DD file in my webservice .war file (casestatuswebservice.war)
            The application is deployed as a .ear file which contains *"casestatuswebservice.war"*, apart from other .war & .jar files.
            Below is the content of few key DD files from my casestatuswebservice.war file. Please let me know if you see any issue with the DD files. I couldn't find any.

            Thanks,
            Sriram


            web.xml:
            <?xml version='1.0' encoding='UTF-8'?>
            <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5">
            <display-name>CaseStatusServiceWebApp</display-name>
            <servlet>
            <servlet-name>CaseStatusServiceServlethttp</servlet-name>
            <servlet-class>com.verizon.isp.app.wg.casestatuswebservice.ejb.CaseStatusWebService</servlet-class>
            <load-on-startup>0</load-on-startup>
            </servlet>
            <servlet-mapping>
            <servlet-name>CaseStatusServiceServlethttp</servlet-name>
            <url-pattern>/CaseStatusService</url-pattern>
            </servlet-mapping>
            </web-app>


            weblogic-webservices.xml:
            <?xml version='1.0' encoding='UTF-8'?>
            <weblogic-webservices xmlns="http://xmlns.oracle.com/weblogic/weblogic-webservices" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
            "http://xmlns.oracle.com/weblogic/weblogic-webservices http://xmlns.oracle.com/weblogic/weblogic-webservices/1.1/weblogic-webservices.xsd">
            <webservice-description>
            <webservice-description-name>com.verizon.isp.app.wg.casestatuswebservice.ejb.CaseStatusWebService</webservice-description-name>
            <webservice-type>JAXRPC</webservice-type>
            <port-component>
            <port-component-name>CaseStatusServiceSoap12HttpPort</port-component-name>
            <service-endpoint-address>
            <webservice-contextpath>casestatusservice</webservice-contextpath>
            <webservice-serviceuri>/CaseStatusService</webservice-serviceuri>
            </service-endpoint-address>
            </port-component>
            </webservice-description>
            </weblogic-webservices>



            WEB-INF/CaseStatusService.xml:
            <?xml version='1.0' encoding='UTF-8'?>
            <j2ee:java-wsdl-mapping xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <j2ee:package-mapping>
            <j2ee:package-type>com.verizon.isp.app.wg.casestatuswebservice.ejb</j2ee:package-type>
            <j2ee:namespaceURI>http://com/verizon/isp/app/wg/casestatuswebservice/ejb</j2ee:namespaceURI>
            </j2ee:package-mapping>
            <j2ee:service-interface-mapping>
            <j2ee:service-interface>javax.xml.rpc.Service</j2ee:service-interface>
            <j2ee:wsdl-service-name xmlns:ejb="http://com/verizon/isp/app/wg/casestatuswebservice/ejb">ejb:CaseStatusService</j2ee:wsdl-service-name>
            <j2ee:port-mapping>
            <j2ee:port-name>CaseStatusServiceSoap12HttpPort</j2ee:port-name>
            <j2ee:java-port-name>getCaseStatusServiceSoap12HttpPort</j2ee:java-port-name>
            </j2ee:port-mapping>
            </j2ee:service-interface-mapping>
            <j2ee:service-endpoint-interface-mapping>
            <j2ee:service-endpoint-interface>com.verizon.isp.app.wg.casestatuswebservice.ejb.CaseStatusWebServicePortType</j2ee:service-endpoint-interface>
            <j2ee:wsdl-port-type xmlns:ejb="http://com/verizon/isp/app/wg/casestatuswebservice/ejb">ejb:CaseStatusWebService</j2ee:wsdl-port-type>
            <j2ee:wsdl-binding xmlns:ejb="http://com/verizon/isp/app/wg/casestatuswebservice/ejb">ejb:CaseStatusServiceSoapBinding</j2ee:wsdl-binding>
            <j2ee:service-endpoint-method-mapping>
            <j2ee:java-method-name>sayHello</j2ee:java-method-name>
            <j2ee:wsdl-operation>sayHello</j2ee:wsdl-operation>
            <j2ee:wrapped-element></j2ee:wrapped-element>
            <j2ee:method-param-parts-mapping>
            <j2ee:param-position>0</j2ee:param-position>
            <j2ee:param-type>java.lang.String</j2ee:param-type>
            <j2ee:wsdl-message-mapping>
            <j2ee:wsdl-message xmlns:ejb="http://com/verizon/isp/app/wg/casestatuswebservice/ejb">ejb:sayHello</j2ee:wsdl-message>
            <j2ee:wsdl-message-part-name>message</j2ee:wsdl-message-part-name>
            <j2ee:parameter-mode>IN</j2ee:parameter-mode>
            </j2ee:wsdl-message-mapping>
            </j2ee:method-param-parts-mapping>
            <j2ee:wsdl-return-value-mapping>
            <j2ee:method-return-value>java.lang.String</j2ee:method-return-value>
            <j2ee:wsdl-message xmlns:ejb="http://com/verizon/isp/app/wg/casestatuswebservice/ejb">ejb:sayHelloResponse</j2ee:wsdl-message>
            <j2ee:wsdl-message-part-name>return</j2ee:wsdl-message-part-name>
            </j2ee:wsdl-return-value-mapping>
            </j2ee:service-endpoint-method-mapping>
            </j2ee:service-endpoint-interface-mapping>
            </j2ee:java-wsdl-mapping>

            WEB-INF/weblogic-webservices-policy.xml:
            <?xml version='1.0' encoding='UTF-8'?>
            <webservice-policy-ref xmlns="http://xmlns.oracle.com/weblogic/webservice-policy-ref" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocatio
            n="http://xmlns.oracle.com/weblogic/webservice-policy-ref http://xmlns.oracle.com/weblogic/webservice-policy-ref/1.1/webservice-policy-ref.xsd"></webservice-
            policy-ref>

            WEB-INF/weblogic-webservices.xml
            <?xml version='1.0' encoding='UTF-8'?>
            <weblogic-webservices xmlns="http://xmlns.oracle.com/weblogic/weblogic-webservices" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
            "http://xmlns.oracle.com/weblogic/weblogic-webservices http://xmlns.oracle.com/weblogic/weblogic-webservices/1.1/weblogic-webservices.xsd">
            <webservice-description>
            <webservice-description-name>com.verizon.isp.app.wg.casestatuswebservice.ejb.CaseStatusWebService</webservice-description-name>
            <webservice-type>JAXRPC</webservice-type>
            <port-component>
            <port-component-name>CaseStatusServiceSoap12HttpPort</port-component-name>
            <service-endpoint-address>
            <webservice-contextpath>casestatusservice</webservice-contextpath>
            <webservice-serviceuri>/CaseStatusService</webservice-serviceuri>
            </service-endpoint-address>
            </port-component>
            </webservice-description>
            </weblogic-webservices>


            WEB-INF/weblogic.xml:
            <?xml version='1.0' encoding='UTF-8'?>
            <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://
            xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">
            <context-root>casestatusservice</context-root>
            </weblogic-web-app>^

            WEB-INF/webservices.xml:
            <?xml version='1.0' encoding='UTF-8'?>
            <webservices xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2">
            <webservice-description>
            <webservice-description-name>com.verizon.isp.app.wg.casestatuswebservice.ejb.CaseStatusWebService</webservice-description-name>
            <wsdl-file>WEB-INF/wsdl/CaseStatusService.wsdl</wsdl-file>
            <jaxrpc-mapping-file>WEB-INF/CaseStatusService.xml</jaxrpc-mapping-file>
            <port-component>
            <port-component-name>CaseStatusServiceSoap12HttpPort</port-component-name>
            <wsdl-port xmlns:ejb="http://com/verizon/isp/app/wg/casestatuswebservice/ejb">ejb:CaseStatusServiceSoap12HttpPort</wsdl-port>
            <service-endpoint-interface>com.verizon.isp.app.wg.casestatuswebservice.ejb.CaseStatusWebServicePortType</service-endpoint-interface>
            <service-impl-bean>
            <servlet-link>CaseStatusServiceServlethttp</servlet-link>
            </service-impl-bean>
            </port-component>
            </webservice-description>
            </webservices>



            WSDL file:
            <?xml version='1.0' encoding='UTF-8'?>
            <WL5G3N0:definitions name="CaseStatusServiceDefinitions" targetNamespace="http://com/verizon/isp/app/wg/casestatuswebservice/ejb" xmlns="" xmlns:WL5G3N0="htt
            p://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://com/verizon/isp/app/wg/casestatuswebservice/ejb" xmlns:WL5G3N2="http://schemas.xmlsoap.org/wsdl/soap/" x
            mlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
            <wsp:UsingPolicy WL5G3N0:Required="true"/>
            <WL5G3N0:types>
            <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://com/verizon/isp/app/wg/casestatuswebservice/ejb" xml
            ns:xs="http://www.w3.org/2001/XMLSchema">
            <xs:element name="sayHello">
            <xs:complexType>
            <xs:sequence>
            <xs:element name="message" type="xs:string"/>
            </xs:sequence>
            </xs:complexType>
            </xs:element>
            <xs:element name="sayHelloResponse">
            <xs:complexType>
            <xs:sequence>
            <xs:element name="return" type="xs:string"/>
            </xs:sequence>
            </xs:complexType>
            </xs:element>
            </xs:schema>
            </WL5G3N0:types>
            <WL5G3N0:message name="sayHello">
            <WL5G3N0:part element="WL5G3N1:sayHello" name="parameters"/>
            </WL5G3N0:message>
            <WL5G3N0:message name="sayHelloResponse">
            <WL5G3N0:part element="WL5G3N1:sayHelloResponse" name="parameters"/>
            </WL5G3N0:message>
            <WL5G3N0:portType name="CaseStatusWebService">
            <WL5G3N0:operation name="sayHello" parameterOrder="parameters">
            <WL5G3N0:input message="WL5G3N1:sayHello"/>
            <WL5G3N0:output message="WL5G3N1:sayHelloResponse"/>
            </WL5G3N0:operation>
            </WL5G3N0:portType>
            <WL5G3N0:binding name="CaseStatusServiceSoapBinding" type="WL5G3N1:CaseStatusWebService">
            <WL5G3N2:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <WL5G3N0:operation name="sayHello">
            <wsp:Policy>

            <wsp:PolicyReference URI="policy:Wssp1.2-2007-Wss1.1-X509-Basic256"/>
            <wsp:PolicyReference URI="policy:Wssp1.2-2007-EncryptBody"/>
            </wsp:Policy>
            <WL5G3N2:operation style="document"/>
            <WL5G3N0:input>
            <WL5G3N2:body parts="parameters" use="literal"/>
            </WL5G3N0:input>
            <WL5G3N0:output>
            <WL5G3N2:body parts="parameters" use="literal"/>
            </WL5G3N0:output>
            </WL5G3N0:operation>
            </WL5G3N0:binding>
            <WL5G3N0:service name="CaseStatusService">
            <WL5G3N0:port binding="WL5G3N1:CaseStatusServiceSoapBinding" name="CaseStatusServiceSoap12HttpPort">
            <WL5G3N2:address location="http://localhost:7001/casestatusservice/CaseStatusService"/>
            </WL5G3N0:port>
            </WL5G3N0:service>
            </WL5G3N0:definitions>
            • 3. Re: wsse-Server CodecHandler Failed toUnable to find xml element for parameter
              user696
              There is no issue with DD files.

              The reason your getting exception is because of following reason.

              Let assume we have wsdl file which has the following element

              <xs:element name="Sample">
              <xs:complexType>
              <xs:sequence>
              <xs:element name="message" type="xs:string"/>
              </xs:sequence>
              </xs:complexType>
              </xs:element>

              When generating the request, instead if sending "message" it is sending with a different attribute name


              <soapenv:Body>
              <ns1:Sample soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://sample/ns">
              <ns1:arg0 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">XXXX</ns1:arg0>
              </ns1:Sample></soapenv:Body>

              So please check the SOAP Payload and see if that is being match with XML Schema object.
              This should fix your problem


              HTH
              Regards,
              Sunil P
              • 4. Re: wsse-Server CodecHandler Failed toUnable to find xml element for parameter
                968275
                Thanks a lot Sunil. I was able to solve the issue.
                The request was not framed correctly, as my JWS annotation of my client was pointing to a wrong name.
                corrected the " @WebParam (name="") " attribute of my client and it worked fine. The issue is resolved now.

                Thanks,
                Sriram