Hello,

I am trying to get some very simple blocking client side code to work 
based on the examples in the user guide

I get an AxisFault, "First Element must contain the local name, 
Envelope" exception in response to
sender.sendReceive(request) in the code listing below.

I have all the 0.95 jars in the classpath and the service itself works 
ok - I have tested that by other means.

I did try creating a complete message (below), without and without the 
soap namespace, but I still get the above exception

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:tns="http://nrmw.qld.gov.au/imsFeatureExtractService";>
   <soap:Body>
      <tns:getServiceIdentifiersRequest/>
   </soap:Body>
</soap:Envelope>


Any hints? I've seen the envelope problem referenced a few times in 
google, but couldn't see how to resolve it

Also I haven't been able to get a wsdl2code client using adb or 
xmlbeans databinding to work, although server side xmlbeans databinding 
from wsdl2code worked fine (will do separate posts)

Many thanks
Peter Barrs

-----

OMFactory fac = OMAbstractFactory.getOMFactory();

OMNamespace tns = fac.createOMNamespace(
        "http://nrmw.qld.gov.au/imsFeatureExtractService";, "tns");

OMElement request = fac.createOMElement("getServiceIdentifiersRequest", 
tns);

try {
  
    Options options = new Options();
    options.setTo(new EndpointReference
("http://jade:8080/axis2/services/FeatureExtractService";));
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

    //Blocking invocation
    ServiceClient sender = new ServiceClient();
    sender.setOptions(options);
    OMElement result = sender.sendReceive(request);

    StringWriter writer = new StringWriter();
    result.serialize(XMLOutputFactory.newInstance
().createXMLStreamWriter(writer));
    writer.flush();

    System.out.println("response:"+writer.toString());

} catch (AxisFault axisFault) {
    axisFault.printStackTrace();
} catch (XMLStreamException e) {
    e.printStackTrace();
}

org.apache.axis2.AxisFault: First Element must contain the local name, 
Envelope; nested exception is:
        org.apache.ws.commons.soap.SOAPProcessingException: First 
Element must contain the local name, Envelope
        at org.apache.axis2.transport.TransportUtils.createSOAPMessage
(TransportUtils.java:124)
        at org.apache.axis2.transport.TransportUtils.createSOAPMessage
(TransportUtils.java:65)
        at org.apache.axis2.description.OutInAxisOperationClient.send
(OutInAxisOperation.java:352)
        at org.apache.axis2.description.OutInAxisOperationClient.execute
(OutInAxisOperation.java:267)
        at org.apache.axis2.client.ServiceClient.sendReceive
(ServiceClient.java:445)
        at org.apache.axis2.client.ServiceClient.sendReceive
(ServiceClient.java:400)
        at net.data_arterial.featureExtractService.Tester.test2
(Tester.java:133)
        at net.data_arterial.featureExtractService.Tester.main
(Tester.java:165)
Caused by: org.apache.ws.commons.soap.SOAPProcessingException: First 
Element must contain the local name, Envelope
        at 
org.apache.ws.commons.soap.impl.builder.StAXSOAPModelBuilder.constructNo
de(StAXSOAPModelBuilder.java:195)
        at 
org.apache.ws.commons.soap.impl.builder.StAXSOAPModelBuilder.createOMEle
ment(StAXSOAPModelBuilder.java:153)
        at org.apache.ws.commons.om.impl.builder.StAXOMBuilder.next
(StAXOMBuilder.java:205)
        at 
org.apache.ws.commons.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnve
lope(StAXSOAPModelBuilder.java:137)
        at 
org.apache.ws.commons.soap.impl.builder.StAXSOAPModelBuilder.identifySOA
PVersion(StAXSOAPModelBuilder.java:11
3)
        at 
org.apache.ws.commons.soap.impl.builder.StAXSOAPModelBuilder.<init>
(StAXSOAPModelBuilder.java:90)
        at org.apache.axis2.transport.TransportUtils.createSOAPMessage
(TransportUtils.java:118)
        ... 7 more


Reply via email to