raul8 0 Light Poster

Hello,

I want to fetch the rest of the XML stored inside SOAP body, but with the below simple code, I'm not able to:

public class AttributeScanner {
	
	
	protected String getEnvOject(InputStream iStream)
			throws Exception {
		String xml = null;
		// First create the connection
		SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
		SOAPConnection connection = soapConnFactory.createConnection();

		// Next, create the actual message
		MessageFactory messageFactory = MessageFactory.newInstance();

		SOAPMessage message = messageFactory.createMessage();

		// Create objects for the message parts
		SOAPPart soapPart = message.getSOAPPart();
		SOAPEnvelope envelope = soapPart.getEnvelope();
		SOAPBody body = envelope.getBody();
		StreamSource preppedMsgSrc = new StreamSource(iStream);
		soapPart.setContent(preppedMsgSrc);		
		
		message.saveChanges();
		connection.close();		
		return xml;
	}
	
	public static void main(String[] args)throws Exception {
		InputStream iStream = new FileInputStream(new File(
				"./OrderAccepted.xml"));
				
		AttributeScanner scanner = new AttributeScanner();

		scanner.getEnvOject(iStream);

	}
}

Exception:

Exception in thread "main" java.lang.NoSuchMethodError: weblogic.xml.util.TernarySearchTree.put(Ljava/lang/String;Ljava/lang/Object;)V
    at weblogic.xml.babel.scanner.TokenFactory.createStoredToken(TokenFactory.java:136)
    at weblogic.xml.babel.scanner.ScannerState.createStoredToken(ScannerState.java:549)
    at weblogic.xml.babel.scanner.Name.read(Name.java:50)
    at weblogic.xml.babel.scanner.Name.read(Name.java:20)
    at weblogic.xml.babel.scanner.ProcessingInstruction.read(ProcessingInstruction.java:21)
    at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:285)
    at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
    at weblogic.xml.babel.baseparser.BaseParser.prime(BaseParser.java:264)
................

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.