I'd be happy to submit any patches if (and probably when) I get to the
point of needing to fix a bug or add an enhancement. In the interim, in
case it is helpful, here is working client and server code (filled in
service skeleton and client stub) for the Userguide Axis2SampleDocLit
example. I see that at least one other user asked for this.
Thanks for creating this package -- so far it looks like it has
everything I need to create a high-performance distributed
cross-platform messaging infrastructure!
Chuck
Eran Chinthaka <[EMAIL PROTECTED]> wrote on 01/12/2006 01:35:22 AM:
> BTW, if you are willing to contribute you can send us patches, and I'm
> more than happy to incorporate them. :-)
>
> Thanks,
> Chinthaka
>
/**
* Axis2SampleDocLitPortTypeSkeleton.java
*
* This file was auto-generated from WSDL
* by the Apache Axis2 version: 0.94 Jan 11, 2006 (08:58:28 HST)
*/
package org.apache.axis2.userguide;
import org.apache.axis2.userguide.xsd.*;
/**
* Axis2SampleDocLitPortTypeSkeleton java skeleton for the axisService
*/
public class Axis2SampleDocLitPortTypeSkeleton {
/**
* Echo a string array parameter
* @param param the incoming document
* @return a new document contain the same payload
*/
public EchoStringArrayReturn echoStringArray (EchoStringArrayParam param) {
EchoStringArrayReturn retdoc = new EchoStringArrayReturn();
ArrayOfstring_literal in = param.getEchoStringArrayParam();
ArrayOfstring_literal ret = new ArrayOfstring_literal();
ret.setString(in.getString());
retdoc.setEchoStringArrayReturn(ret);
return retdoc;
}
/**
* Echo a struct parameter
* @param param the incoming document
* @return a new document containing the same payload
*/
public EchoStructReturn echoStruct (EchoStructParam param) {
EchoStructReturn retdoc = new EchoStructReturn();
SOAPStruct in = param.getEchoStructParam();
SOAPStruct ret = new SOAPStruct();
ret.setVarFloat(in.getVarFloat());
ret.setVarInt(in.getVarInt());
ret.setVarString(in.getVarString());
retdoc.setEchoStructReturn(ret);
return retdoc;
}
/**
* Echo a string parameter
* @param param the incoming document
* @return a new document containing the same payload
*/
public EchoStringReturn echoString (EchoStringParam param) {
EchoStringReturn retdoc = new EchoStringReturn();
retdoc.setEchoStringReturn(param.getEchoStringParam());
return retdoc;
}
}
/*
* EchoAllStandardAxis2Sample.java
*
* Created on January 11, 2006, 11:35 PM
*
* Copyright 2005 MetaLINCS, Corp. All Rights Reserved.
* Confidential Information. Subject matter of trade secrets and/or patents.
*/
package axis2sampleclient;
import org.apache.axis2.userguide.Axis2SampleDocLitPortTypeStub;
/**
*
* @author chuck
*/
public class EchoAllStandardAxis2Sample {
/** Creates a new instance of EchoAllStandardAxis2Sample */
public static void test() {
try {
Axis2SampleDocLitPortTypeStub stub = new Axis2SampleDocLitPortTypeStub("http://localhost:8084/axis2/services/Axis2Sample");
Axis2SampleDocLitPortTypeStub.EchoStringParam reqStringDoc = new Axis2SampleDocLitPortTypeStub.EchoStringParam();
reqStringDoc.setEchoStringParam("Echo String!");
Axis2SampleDocLitPortTypeStub.EchoStringReturn retStringDoc = stub.echoString(reqStringDoc);
System.out.println(retStringDoc.getEchoStringReturn());
stub = new Axis2SampleDocLitPortTypeStub("http://localhost:8084/axis2/services/Axis2Sample");
Axis2SampleDocLitPortTypeStub.EchoStringArrayParam reqStringArrayDoc = new Axis2SampleDocLitPortTypeStub.EchoStringArrayParam();
Axis2SampleDocLitPortTypeStub.ArrayOfstring_literal reqStringArray = new Axis2SampleDocLitPortTypeStub.ArrayOfstring_literal();
reqStringArray.setString(new String[]{"Echo", "String", "Array!!!"});
reqStringArrayDoc.setEchoStringArrayParam(reqStringArray);
Axis2SampleDocLitPortTypeStub.EchoStringArrayReturn retStringArrayDoc = stub.echoStringArray(reqStringArrayDoc);
String[] retStringArray = retStringArrayDoc.getEchoStringArrayReturn().getString();
for (int i=0; i<retStringArray.length; i++)
System.out.println(retStringArray[i]);
stub = new Axis2SampleDocLitPortTypeStub("http://localhost:8084/axis2/services/Axis2Sample");
Axis2SampleDocLitPortTypeStub.EchoStructParam reqStructDoc = new Axis2SampleDocLitPortTypeStub.EchoStructParam();
Axis2SampleDocLitPortTypeStub.SOAPStruct reqStruct = new Axis2SampleDocLitPortTypeStub.SOAPStruct();
reqStruct.setVarFloat(3.14159f);
reqStruct.setVarInt(2);
reqStruct.setVarString("Echo!!!");
reqStructDoc.setEchoStructParam(reqStruct);
Axis2SampleDocLitPortTypeStub.EchoStructReturn retStructDoc = stub.echoStruct(reqStructDoc);
Axis2SampleDocLitPortTypeStub.SOAPStruct retStruct = retStructDoc.getEchoStructReturn();
System.out.println(retStruct.getVarFloat());
System.out.println(retStruct.getVarInt());
System.out.println(retStruct.getVarString());
}
catch (Exception e) {
e.printStackTrace();
}
}
}