axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Robinson" <>
Subject RE: [Axis2] How to specifiy operation name
Date Tue, 14 Mar 2006 16:18:56 GMT
My main problem is that depending on the XML instance that I read in and send I sometimes get:


org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: Operation Not found EPR is
and WSA Action = 

            at org.apache.axis2.engine.DispatchPhase.checkPostConditions(

            at org.apache.axis2.engine.Phase.invoke(

            at org.apache.axis2.engine.AxisEngine.invoke(

            at org.apache.axis2.engine.AxisEngine.receive(

            at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(

            at org.apache.axis2.transport.http.AxisServlet.doPost(

            at javax.servlet.http.HttpServlet.service(

            at javax.servlet.http.HttpServlet.service(


Which seems to depend on the root node of the XML instance. If I send in something like: 


 <?xml version = '1.0' encoding = 'UTF-8'?>


  <js:ChildSupportPackage xmlns:js="">

            <j:Case xmlns:j="">


Everything works fine and the operation name childSupportEnforcementFiling is invoked. But
if I send: 


<?xml version = '1.0' encoding = 'UTF-8'?>


  <js:ChildSupportPackage xmlns:js="">

            <j:Case xmlns:j="">


I get the exception mentioned above. The same for if I send in something like: 


<?xml version = '1.0' encoding = 'UTF-8'?>

<ChildSupportEnforcementFiling xmlns=""
schemaLocation="" >

  <js:ChildSupportPackage xmlns:js="">

            <j:Case xmlns:j="">



Which is where I am trying to get to.



Also here is my services.xml: 


<service name="MTOMService">


        Web Service for receiving Child Support Enforcement filing(s) w/ 

        MTOM based binary data transfer.


    <parameter name="ServiceClass" locked="false">us.gaaoc.service.MTOMService</parameter>

    <operation name="childSupportEnforcementFiling">

        <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>








From: Michael Robinson [] 
Sent: Tuesday, March 14, 2006 10:42 AM
Subject: [Axis2] How to specifiy operation name


I am attempting to create both the service and client for a document centric web service with
each exchange based on a XML Schema instance.


I have taken the MTOM examples (mostly the imagetransfer example) and am trying to from the
client load an XML instance (instead of a jpeg) and then call the service passing the instance
as the SOAP body element. I have this working…. sortof. In the examples the root element
of the XML within the SOAP body matches the operation name so the client finds the operation
and everything is great! Is this the default behavior? It seems that some of the examples
declare a QName but then never use the variable to set the desired operation which increases
my confusion. 


How do I specify the remote operation? I have noticed some of the examples using objects of
AxisService and OperationClient. Is this what I am looking for? I didn’t see anything in
the documentation thus far that talks about specifying the remote operation from the client.
Did I miss it? 


Is there an example which deals with XML instances? Would it be correct to assume that a WSDL
to go with this type of exchange will need a lot of hand tuning from what the engine generates
by default? I have looked for examples that exchange xml instances w/ relevant schemas w/
more customized WSDL but have not been successful in finding any. 


Just in case it might help here are the relevant pieces of my project: (let me know if I forgot


Relevant Client code: 


public OMElement sendFile(String fileName) throws Exception {

                        OMElement payload = createEnvelope(fileName);


                        Options options = new Options();




                        // enabling MTOM in the client side

                        options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);




                        ServiceClient sender = new ServiceClient();


                        return sender.sendReceive(payload);



private OMElement createEnvelope(String fileName) throws Exception {


// create the parser 

                        XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new


                        // create the builder

                        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(),


                        OMElement xmlDocElement = builder.getDocumentElement();

                        return xmlDocElement;



Relevant Service code: 


            public OMElement childSupportEnforcementFiling(OMElement element) throws Exception


                        OMXMLParserWrapper builder = element.getBuilder();


                        QName soapHeaderQName = new QName("",

                        SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();

                        SOAPHeader soapHeader = envelope.getHeader();


                        Iterator headerIterator = soapHeader.getChildElements();


                        while (headerIterator.hasNext()) {

                                    SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock);

                                    System.out.println("soapHeaderBlock.getLocalName() = "
+ soapHeaderBlock.getLocalName());



                        System.out.println("Receiving Element.............................

                        System.out.println("Local Name = " + element.getLocalName().toString()
+ "\n");

                        Iterator iter = element.getChildElements();


                        int counter = 0;

                        while (iter.hasNext()) {

                                    System.out.println("Printing child number: " + counter
+ " \n");


                                    OMElement current = (OMElement);

                                    // System.out.println(current.toString());

                                    String currentText = current.getText();




                                    Iterator testing = current.getChildElements();

                                    while(testing.hasNext()) {

                                                OMElement foo = (OMElement);

                                                // System.out.println(current.toString());

                                                String fooText = foo.getText();








                        // Create a navigator





WSDL (I’m thinking it needs some work….): 


<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions name="DocumentServiceX"











                                    <xsd:element name="childSupportEnforcementFilingRequest">



                                                                        <xsd:element tns:name="element"
tns:type="xsd:anyType" />




                                    <xsd:element name="childSupportEnforcementFilingResponse">



                                                                        <xsd:element name="return"
type="xsd:anyType" />







            <wsdl:message name="childSupportEnforcementFilingResponseMessage">

                        <wsdl:part name="part1" element="tns:childSupportEnforcementFilingResponse"


            <wsdl:message name="childSupportEnforcementFilingRequestMessage">

                        <wsdl:part name="part1" element="tns:childSupportEnforcementFilingRequest"



            <wsdl:portType name="DocumentServiceXPort">

                        <wsdl:operation name="childSupportEnforcementFiling">

                                    <wsdl:input message="tns:childSupportEnforcementFilingRequestMessage"


                                    <wsdl:output message="tns:childSupportEnforcementFilingResponseMessage"





            <wsdl:binding name="DocumentServiceXBinding" type="tns:DocumentServiceXPort">

                        <soap:binding style="document" transport=""

                        <wsdl:operation name="childSupportEnforcementFiling">

                                    <soap:operation soapAction="childSupportEnforcementFiling"
style="document" />


                                                <soap:body use="literal" />



                                                <soap:body use="literal" />




            <wsdl:service name="DocumentServiceX">

                        <wsdl:port binding="tns:DocumentServiceXBinding" name="DocumentServiceXPortType">

                                    <soap:address location="http://localhost:8080/axis2/services/DocumentServiceX"






Example XML Instance:


XML Schema(s):








This e-mail and any files transmitted with it are intended solely
for the use of the entity or individual(s) to whom they are
addressed and not for reliance upon by unintended recipients. If
you are not the intended recipient or the person responsible for
delivering the e-mail to the intended recipient be advised that you
have received this e-mail in error and that any use, dissemination,
forwarding, printing, or copying of this e-mail and any files
transmitted are strictly prohibited. If you have received this
e-mail in error please delete the entire email and immediately
notify us by email to the sender or by telephone to the AOC main
office number, (404) 656-5171. Thank you.

View raw message