axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Demetris <demet...@ece.neu.edu>
Subject Re: Axis2 and POJO from Axis1
Date Fri, 23 Apr 2010 20:55:38 GMT

I gave up using the POJO method for generating the outgoing SOAP message 
as it does
not seem to work. I am able to generate a correct SOAP envelope using 
the SOAPFactory
etc explicitly. However, I get the following:

org.apache.axis2.AxisFault: Unknown SOAP Version. Current Axis handles 
only SOAP 1.1 and SOAP 1.2 messages
    at 
org.apache.axis2.context.MessageContext.setEnvelope(MessageContext.java:1310)
    at 
org.apache.axis2.rpcclient.BooksAxis2SOAPRPCclient.main(BooksAxis2SOAPRPCclient.java:75)

This is the code - I am initializing the SOAP11 modules so why is it 
complaining at the last line below?
Thanks

               Options options = new Options();
                
options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);                  
 

                options.setTo(targetEPR);
                options.setAction("urn:getBooks");
                   
                ServiceClient client = new ServiceClient();
                client.setOptions(options);
                   
                OperationClient mepClient = client
                    .createClient(ServiceClient.ANON_OUT_IN_OP);
                   
                SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
                OMNamespace ns = fac.createOMNamespace(
                        "http://http://myBooksAxis2.axis2.apache.org/", 
"ns1");
                OMElement payload = fac.createOMElement("getBooks", ns);

                SOAPEnvelope env = fac.getDefaultEnvelope();
                env.setNamespace(ns);
                   
                env.getBody().addChild(payload);
                MessageContext mc = new MessageContext();               
                mc.setEnvelope(env);


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


Mime
View raw message