How to convert a string to a SOAPMessage in Java?

前端 未结 6 913
轻奢々
轻奢々 2020-12-23 21:38

I wonder is there any way to convert a string to SOAPMessage?

Let me say I have a string as follows:

String send = "

        
6条回答
  •  萌比男神i
    2020-12-23 22:03

    Convert the String into an input stream, then read it into the SOAP message factory.

    InputStream is = new ByteArrayInputStream(send.getBytes());
    SOAPMessage request = MessageFactory.newInstance().createMessage(null, is);
    

    You can read about how to do this here.

提交回复
热议问题