You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Asensio, Rodrigo" <ro...@gilbarco.com> on 2008/04/09 21:36:21 UTC

returning soap envelope

Hi, I'm trying to return a response in soap standars, here is my server
code


	public OMElement myAction(String someInput) throws Exception {
		SOAPEnvelope soapEnvelope =
MessageContext.getCurrentMessageContext().getEnvelope();
		OMFactory fac = OMAbstractFactory.getOMFactory();
		OMNamespace namespace  =
fac.createOMNamespace("http://myurl.com", "someval");
		OMElement element = fac.createOMElement(someInput,
namespace);
		soapEnvelope.getBody().addChild(element);
		return soapEnvelope;
	}

I'm getting this exception:

Caused by: javax.xml.stream.XMLStreamException: Can not output XML
declaration, after other output has already been done.

any clue ?? I'm doing good writing a soap envelope ?

thanks
Rodrigo

This message (including any attachments) contains confidential 
and/or proprietary information intended only for the addressee.  
Any unauthorized disclosure, copying, distribution or reliance on 
the contents of this information is strictly prohibited and may 
constitute a violation of law.  If you are not the intended 
recipient, please notify the sender immediately by responding to 
this e-mail, and delete the message from your system.  If you 
have any questions about this e-mail please notify the sender 
immediately. 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org