Java Spring WS org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope

前端 未结 3 721
星月不相逢
星月不相逢 2020-12-11 18:08

I\'am experencing a strange behaviour of a spring ws in different environments. Following works fine with Soap UI on a local tomcat 7.0.29, but does return below mentioned e

相关标签:
3条回答
  • 2020-12-11 18:51

    I had the same error as you. I've found the solution here: http://mmmsoftware.blogspot.com.es/2009/06/xml-namespace-error-with-spring-ws.html

    Basically you have to use upper versions of xalan and xercesimpl. My pom's dependencies look like this:

    <project ...>
     ...
    <dependencies>
    
                 ...
    
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>1.1.3</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>maven-cobertura-plugin</artifactId>
                    <groupId>maven-plugins</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>maven-findbugs-plugin</artifactId>
                    <groupId>maven-plugins</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xalan</artifactId>
                    <groupId>xalan</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xercesImpl</artifactId>
                    <groupId>xerces</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    
                 ...
    
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.7.0</version>
            <type>jar</type>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>xml-apis</artifactId>
                    <groupId>xml-apis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.9.1</version>
            <type>jar</type>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>xml-apis</artifactId>
                    <groupId>xml-apis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
     ...
    </project>
    

    I hope it helps you.

    0 讨论(0)
  • 2020-12-11 18:55

    I've just managed the same problem.

    In my situation the problem was in old spring-ws version being used with HTTPS.

    Upgrading to the latest (2.1.3) helped.

    0 讨论(0)
  • 2020-12-11 19:05

    i had this problem

    i created xml file that write a envelope soup in it.and run it by curl like this:

    curl --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:urn:LoginRequest" --data @loginRequest.xml http://.....:8080/.../LoginRequest.asmx

    then it return upper exception .

    in my case ,the problem was extra line in loginRequest.xml

    i just remove extra line ,it fixed :)

    0 讨论(0)
提交回复
热议问题