How to add header to SOAP request?

前端 未结 4 952
攒了一身酷
攒了一身酷 2020-12-04 13:58

I try to invoke HTTPS SOAP web service through java code:

    URL url = new URL(\"https://somehost:8181/services/\"SomeService?wsdl\");
    QName qname = new         


        
4条回答
  •  天涯浪人
    2020-12-04 14:24

    I have followed the steps mentioned by @LaabidiRaissi. The code works fine but it never appends the security element under the header. I have confirmed it by printing out the outbound SOAP message to System.out. After a deep research, I have found that the SOAPMessage needs to be explicitly saved for reflecting the updated message header.

    soapMessage.saveChanges();
    

    For more reference - Check this link

提交回复
热议问题