How to get response from SOAP endpoint in java?

前端 未结 5 1638
悲哀的现实
悲哀的现实 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:23

    Try with

       QName qn = new QName("http://www.webserviceX.NET","ElementName","web");
    

    EDIT: Also, as others have suggested - you will be better off using generated client code here - Axis, JAX-WS etc are all options.

    The correct code should be as below.

      QName bodyName = new QName("http://www.webserviceX.NET", "GetAtomicNumber");
      SOAPBodyElement bodyElement = sbody.addBodyElement(bodyName);
      QName qn = new QName("ElementName");
    

提交回复
热议问题