Announcement Announcement Module
Collapse
No announcement yet.
Create a SOAP message from a file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Create a SOAP message from a file

    Hi,

    I am trying to have my message factory (Axiom) create a SOAP message by reading a file.
    This is my code:

    Code:
    File messageFile = new ClassPathResource(messageFileName).getFile();
    FileInputStream messageStream = new FileInputStream(messageFile);
    WebServiceMessageFactory messageFactory = 
    			(WebServiceMessageFactory) getApplicationContext().getBean("messageFactory");
    WebServiceMessage message = messageFactory.createWebServiceMessage(messageStream);
    However, I get an exception:

    Code:
    AxiomSoapMessageFactory requires a TransportInputStream. Object of class [java.io.FileInputStream] must be an instance of class org.springframework.ws.transport.TransportInputStream
    What do I need to do to get this to work? What concrete classes extend TransportInputStream?
    Or do I need to implement my own?

    Thanks.
Working...
X