How to get response from SOAP endpoint in java?

前端 未结 5 1636
悲哀的现实
悲哀的现实 2021-01-21 16:44

I am very new to SOAP, so was looking into some programs online, this is what I came up with but I get a null response, must be some silly thing, but need little help

Pl

5条回答
  •  情歌与酒
    2021-01-21 17:17

    With cxf-codegen-plugin maven plugin you can create a client of the soap service quickly by adding these dependencies:

    
                org.apache.cxf
                cxf-rt-frontend-jaxws
                2.4.2
            
            
                org.apache.cxf
                cxf-rt-transports-http
                2.4.2
            
            
                org.apache.cxf
                cxf-rt-core
                2.4.2
            
    

    and adding this build section:

    org.apache.cxf cxf-codegen-plugin 2.1.2 generate-sources generate-sources wsdl2java ${basedir}/target/generated-sources/cxf ${basedir}/src/main/resources/wsdlfile.wsdl -client -wsdlLocation -p com.package.for.generated.classes

    then inside ${basedir}/target/generated-sources/cxf you will have classes required to call the web service and an example of how to do it.

    Hope it helps!

提交回复
热议问题