The attempt to create null QNames and null Elements appears problematic as you 
sub nulls for name AND prefix/localname 
(note that TestingUtils has a method createDummyOMElement  which accomplishes 
the objective implemented via)
OMElement payload = TestingUtils.createDummyOMElement();

What happens when you run the testcase supplied here
http://kickjava.com/src/org/apache/axis2/engine/CommonsHTTPEchoRawXMLTest.java.htm

?
M-
This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
----- Original Message ----- 
From: "Paul Fremantle" <[EMAIL PROTECTED]>
To: <axis-user@ws.apache.org>
Sent: Sunday, November 12, 2006 8:27 AM
Subject: Re: [Axis2][SOAP]Can not output XML declaration, after other output 
has already been done.


> Also, can you please use TCPMON to capture the actual request/response
> that you are getting from Axis2.
> 
> Paul
> 
> On 11/12/06, Paul Fremantle <[EMAIL PROTECTED]> wrote:
>> Tony
>>
>> I can't see the SOAP response. Can you please repost it?
>>
>> Ta
>> Paul
>>
>> On 11/12/06, Tony Fang <[EMAIL PROTECTED]> wrote:
>> > Hi, there.
>> >
>> > I always get the exception like "org.apache.axis2.AxisFault: Can not output
>> > XML declaration, after other output has already been done.; nested 
>> > exception
>> > is: " when I try to run the following code. Does some one also meet this
>> > AxisFault before?
>> >
>> > you can find the Web Service here, both WSDL file, and SOAP Request and
>> > Response sample. (I am sure, I can get the response when I using Axis1.1)
>> >
>> > Any commonts would help me.
>> >
>> > Thanks
>> > Tony
>> >
>> > ---- Flowing the test code ----------------
>> >
>> >
>> >
>> > package tony.axis.test;
>> >
>> > import org.apache.axiom.om.*;
>> > import org.apache.axiom.soap.*;
>> > import org.apache.axis2.AxisFault;
>> > import org.apache.axis2.Constants;
>> > import org.apache.axis2.addressing.EndpointReference;
>> > import org.apache.axis2.client.* ;
>> > import org.apache.axis2.context.MessageContext;
>> > import org.apache.axis2.context.MessageContextConstants;
>> > import org.apache.axis2.client.async.*;
>> >
>> > public class SoapTest2 {
>> >
>> >  public static void main(String[] args) {
>> >
>> >   //String url =
>> > "http://www.xignite.com/xFutures.asmx/GetFutureSymbol";;
>> >   String url ="
>> > http://www.xignite.com/services/GetFutureSymbol";;
>> >
>> >   Options options = new Options();
>> >
>> > //options.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);
>> >   options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>> >   options.setTo(new EndpointReference(url));
>> >
>> >
>> >   try {
>> >    ServiceClient serviceClient = new ServiceClient();
>> >    serviceClient.setOptions(options);
>> >    SOAPFactory omFactory =
>> > OMAbstractFactory.getSOAP11Factory();
>> >          SOAPEnvelope envelope = omFactory.getDefaultEnvelope ();
>> >    OMNamespace xsi =
>> > omFactory.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance";,
>> > "xsi");
>> >    OMNamespace xsd = omFactory.createOMNamespace
>> > ("http://www.w3.org/2001/XMLSchema";, "xsd");
>> >    OMNamespace soap = omFactory.createOMNamespace("
>> > http://schemas.xmlsoap.org/soap/envelope/";, "soap");
>> >    OMNamespace defNs =
>> > omFactory.createOMNamespace("http://www.xignite.com/services/";,
>> > "");
>> >    OMNamespace nullNs = omFactory.createOMNamespace("", "");
>> >
>> >    OMElement operation =
>> >                 omFactory.createOMElement("GetFutureSymbol",
>> >                         "",
>> >                         "");
>> >    operation.setNamespace(defNs);
>> >
>> >    SOAPHeader header = envelope.getHeader();
>> >    SOAPBody body = envelope.getBody();
>> >    body.addChild(operation);
>> >
>> >    envelope.setNamespace(xsi);
>> >    envelope.setNamespace(xsd);
>> >    envelope.setNamespace(soap);
>> >
>> >    OMElement username = omFactory.createOMElement("Username", nullNs);
>> >    username.setText("");
>> >    header.addChild(username);
>> >    OMElement password = omFactory.createOMElement("Password", nullNs);
>> >    password.setText("");
>> >    header.addChild(password);
>> >    OMElement tracer = omFactory.createOMElement("Tracer", nullNs);
>> >    tracer.setText("");
>> >    header.addChild(tracer);
>> >    OMElement symbol = omFactory.createOMElement("Symbol", nullNs);
>> >    symbol.setText("CL");
>> >    operation.addChild(symbol);
>> >    OMElement month = omFactory.createOMElement("Month", nullNs);
>> >    month.setText("9");
>> >    operation.addChild(month);
>> >    OMElement year = omFactory.createOMElement("Year", nullNs);
>> >    year.setText("2002");
>> >    operation.addChild(year);
>> >
>> >    System.out.println(envelope);
>> >    OMElement result = serviceClient.sendReceive(envelope);
>> >    System.out.print(result);
>> >
>> >   } catch (AxisFault e1) {
>> >    System.out.println("AxisFault");
>> >    System.out.println(e1.getFaultRole());
>> >    e1.printStackTrace();
>> >   }
>> >  }
>> > }
>> >
>>
>>
>> --
>> Paul Fremantle
>> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>>
>> http://bloglines.com/blog/paulfremantle
>> [EMAIL PROTECTED]
>>
>> "Oxygenating the Web Service Platform", www.wso2.com
>>
> 
> 
> -- 
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> 
> http://bloglines.com/blog/paulfremantle
> [EMAIL PROTECTED]
> 
> "Oxygenating the Web Service Platform", www.wso2.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to