[ 
http://issues.apache.org/jira/browse/AXIS2-1268?page=comments#action_12439107 ] 
            
Xia Zhao commented on AXIS2-1268:
---------------------------------

Hi, 

I managed to build my service using nightly builds. This time I just builds an 
even simple service which read input job status and tell new status. And I got 
new problems. Can anyone help please? Thanks a lot.

As before, I will list my developing sequence and attach related files:

1. Develop java class. There are two classes:
package myExample;

public class Analysis {
        public Job traceJob(Job job){
                job.setStatus("received");
                return job;
        }
}

package myExample;

public class Job {
        private String status;
        public void setStatus(String status) {
                this.status = status;
        }
        public String getStatus() {
                return status;
        }
}

2. Create services.xml 

<service>
        <parameter name="ServiceClass" 
          locked="false">myExample.Analysis</parameter>
        <operation name="traceJob">
                <messageReceiver 
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
        </operation>    
</service>

3. Create Analysis.aar

4. Deploy Analysis.aar on the tomcat server.

5. Get WSDL file from: http://localhost:8080/axis2/services/Analysis?wsdl (see 
attcahment Analysis.xml)

6. Create client classes. There are two classes generated: 
org.apache.ws.axis2.AnalysisCallBackHandler and org.apache.ws.axis2.AnalysisStub

7. Create a test class:

package org.apache.ws.axis2;

public class Test {

        /**
         * @param args
         */
        public static void main(String[] args) throws Exception{
                // TODO Auto-generated method stub
                AnalysisStub as = new AnalysisStub();
                AnalysisStub.TraceJob tj = new AnalysisStub.TraceJob();
                AnalysisStub.Job j = new AnalysisStub.Job();
                j.setStatus("request");
                tj.setJob(j);
                AnalysisCallbackHandler callback = new 
AnalysisCallbackHandler(null){
                        public void receiveResulttraceJob(
                    org.apache.ws.axis2.AnalysisStub.TraceJobResponse param1) {
                                
System.out.println(param1.get_return().getStatus());
           }
                    public void receiveErrortraceJob(java.lang.Exception e) {
                        e.printStackTrace();
            }
                };
                as.starttraceJob(tj, callback);
                Thread.sleep(1000);
        }

}

Then I got the error trace. (see attachement errortrace)

Xia


> Unexpected subelement - problem of correctly invoking services
> --------------------------------------------------------------
>
>                 Key: AXIS2-1268
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1268
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Task
>    Affects Versions: 1.0
>         Environment: Java and WSDL files are created using code generator 
> Eclipse plugin under Eclipse 3.1. The archive file is created using service 
> archive generator Eclipse plugin 3.1 as well. Web Server: Tomcat 5.5.17. 
> Operation System: Windows XP professional 
>            Reporter: Xia Zhao
>         Attachments: Analysis.xml, AnalysisMethod.java, AnalysisMethod1.java, 
> AnalysisMethod1.xml, AnalysisMethod1Skeleton.java, errortrace.rtf, Invoking & 
> error.rtf, Job.java
>
>
> I was working with Axis1.4 before and just started to look at Axis2 as my 
> project requesting asynchronous web services. I built a simple asynchronous 
> web service then try to build a client to invoke the service, however, I got 
> the error of Unexpected subelement. Axis2 is deployed under Tomcat 5.5.17 and 
> WSDL was generated by code generator Eclipse plugin. I would like to know how 
> to correctly invoke this services. Or maybe there are some errors in the WSDL 
> file. Please give some hints.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to