You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Deepak Sharma <de...@gmail.com> on 2006/08/03 14:23:47 UTC

User Guide: Code generation for client

Hi Guys,

This question has already been asked in the forum and I suppose I am the
third person to ask this question. But no response has come so far to
rectify this problem. Following is the problem:

I am facing some problem creating client for the example mentioned in the
user guide. *
http://ws.apache.org/axis2/1_0/userguide3.html#Writing_Web_Service_Clients_using_Code_Generation_with_Data_Binding_Support
* <http://ws.apache.org/axis2/1_0/userguide3.html>

WSDL2Java is not generating "Axis2SampleDocLitPortTypeStub.java" instead it
is generating "Axis2SampleDocLitServiceStub.java" and it's Callback Handler.

Following is the client which I have written but it is not getting compiled
as echoString method expects EchoStringParam not EchoStringParamDocument.



EchoStringReturnDocument resDoc = stub.echoString(reqDoc);


*

public* *class* Client {

*public* *static* *void* main(String[] args) {

*try* {

Axis2SampleDocLitServiceStub stub = *new* Axis2SampleDocLitServiceStub(

*null*,

"http://localhost:8080/axis2/services/Axis2SampleDocLitPortType");

EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory

.*newInstance*();

reqDoc.setEchoStringParam("Axis2 Echo");

EchoStringReturnDocument resDoc = stub.echoString(reqDoc);

System.*out*.println(resDoc.getEchoStringReturn());

} *catch* (Exception e) {

e.printStackTrace();

}

}
Looking forward for your response.

Thanks,
Deepak