InaccessibleWSDLException error from SOAP generated client in JAVA

前端 未结 1 1884
北海茫月
北海茫月 2021-01-25 11:16

We are working with service provider\'s wsdl which is not discoverable due to security reason and they provide us a bunch of files including wsdl ,xsd etc.We need to access the

相关标签:
1条回答
  • 2021-01-25 11:34

    After few research, I have found these !

    1)For Spring WS, generated client is not working (As like Netbean Generated SOAP client)

    2) This link help me a lot to consume a Spring-WS service using Spring STS Consuming a SOAP web service

    but few things need to be done before you proceed

    a) fix maven-jaxb2-plugin version to lower version (0.12.1)

    b) add a binding.xjb file with these contains

    <?xml version="1.0"?>
    <jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
                  xmlns:xjc= "http://java.sun.com/xml/ns/jaxb/xjc"
                  jxb:extensionBindingPrefixes="xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <jxb:bindings>
            <jxb:globalBindings>
                <xjc:simple/>
            </jxb:globalBindings>
        </jxb:bindings>
    </jxb:bindings>
    

    other wise xjc will not work

    3) Copy wsdl & xsd files to local project directory and pom configuration will be as follows (for scenario where wsdl is not hosted for security reason)

    <configuration>
                        <schemaDirectory>${project.basedir}/src/main/resources/wsdl</schemaDirectory>
                        <schemaIncludes>
                            <include>*.wsdl</include>
                        </schemaIncludes>
                    </configuration>
    

    3)It is not recommended to edit the wsdl file

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