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 Ajith Ranabahu <aj...@gmail.com> on 2006/07/06 17:44:00 UTC

Re: [Axis2] Can not output XML declaration, after other output has already been done

A quick clarification!
Does the problem occur after receiving a response ?

Ajith

On 7/6/06, John Ferron <jo...@alliantenergy.com> wrote:
>
>
> All,
>
> I'm getting the following nested exception:
>
>  Can not output XML declaration, after other output has already been done.;
> nested exception is:
>         javax.xml.stream.XMLStreamException: Can not output
> XML declaration, after other output has already been done.; nested exception
> is:
>         org.apache.axis2.AxisFault: Can not output XML declaration, after
> other output has already been done.; nested exception is:
>         javax.xml.stream.XMLStreamException: Can not output
> XML declaration, after other output has already been done.; nested exception
> is:
>         org.apache.axis2.AxisFault: Can not output XML declaration, after
> other output has already been done.; nested exception is:
>         javax.xml.stream.XMLStreamException: Can not output
> XML declaration, after other output has already been done.; nested exception
> is:
>         org.apache.axis2.AxisFault: Can not output XML declaration, after
> other output has already been done.; nested exception is:
>         javax.xml.stream.XMLStreamException: Can not output
> XML declaration, after other output has already been done.; nested exception
> is:
>         org.apache.axis2.AxisFault: Can not output XML declaration, after
> other output has already been done.; nested exception is:
>         javax.xml.stream.XMLStreamException: Can not output
> XML declaration, after other output has already been done.; nested exception
> is:
>         org.apache.axis2.AxisFault: Can not output XML declaration, after
> other output has already been done.; nested exception is:
>         javax.xml.stream.XMLStreamException: Can not output
> XML declaration, after other output has already been done.; nested exception
> is:
>         org.apache.axis2.AxisFault: Can not output XML declaration, after
> other output has already been done.; nested exception is:
>         javax.xml.stream.XMLStreamException: Can not output
> XML declaration, after other output has already been done.; nested exception
> is:
>         org.apache.axis2.AxisFault: Can not output XML declaration, after
> other output has already been done.; nested exception is:
>         javax.xml.stream.XMLStreamException: Can not output
> XML declaration, after other output has already been done.
>
> The following method that sends the data is as follows:  The request element
> that I am passing through to this method is the SOAP envelope which has the
> complete SOAP message that I want to send.
>
> private void sendRecieve(String urlStr, OMElement requestElement) throws
> Exception {
>   URL url = null;
>   OMElement responseElement = null;
>   try {
>    url = new URL(urlStr);
>    log.info("URL: " + urlStr);
>   } catch (MalformedURLException e) {
>    StringFunctions.exceptionToString(e);
>   }
>
>   Options options = new Options();
>   options.setTo(new EndpointReference(url.toString()));
>   options.setProperty(MessageContextConstants.CHUNKED,
> Constants.VALUE_FALSE);
>
>   ServiceClient sender = new ServiceClient();
>   sender.setOptions(options);
>   log.info("Sending: ");
>   log.info(requestElement.toStringWithConsume());
>   responseElement = sender.sendReceive(requestElement);
>   if (responseElement == null) {
>    log.info("Null response");
>   } else {
>    log.info(responseElement.toStringWithConsume());
>   }
>  }
>
> Any help would be greatly appreciated
>
> John


-- 
Ajith Ranabahu

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