Someone else may comment on the ADB API, but you may have missed that with
Axis2 you have a choice. The other alternatives are xmlbeans, jibx, and
perhaps jaxb - I'm not sure about the current state of jaxb in axis2. Also
I'm not sure that your example is a good comparison, as the .net example
uses a string and the adb example uses a file.

With xmlbeans for example, there is no DataHandler. To populate via a file,
you'd do:

GetReport getReport = GetReport.Factory.parse(new File("/home/rick

/projects/eds/testsrc/testresources/testspecs/pgm1.xml"));



There's an xmlbeans example, start to finish, here:

http://ws.apache.org/axis2/tools/1_2/CodegenToolReference.html#invoking

I also note in comparing java to the .net one is all you'd need to do is
xmlString.getBytes() . As previously shown, xml schema base64 maps directly
to a byte array.

HTH,
Robert

On 6/14/07, Rick Reumann <[EMAIL PROTECTED]> wrote:

In a previous email thread I've been working on sending xml to a
webservice. I've been working with coding the wsdl some by hand (with
Robert's help - thanks Robert - although still having some issues with
the one you sent), and also using a wsdl generating by Axis2 when
deployed in Tomcat, and also been using a wsdl generated by JBoss
using jboss-ws with web service annotations. Actually all three wsdls
seem quite similar.

What I'm finding interesting is the way Axis2 creates the client side
stubs compared to Visual Studio 2005. The Axis2 Stub generation seems
to always want to have me use a DataHandler (which is annoying since I
seem to have to then use a FileDataSource), yet the .NET stubs seems
much more to what I want - a way to simply assign a byte[] to the parm
and pass that to the webservice (where the server side code takes a
byte[] as an arg).

Axis2 stubs also seem to generate what appears to me, to be extra
un-needed wrappers.

Here's an example of the usage of the two different generated stubs:

.NET
-------------------
String xml = "<rick><test>foobar</test></rick>";
WebReference.StatServiceBeanService service = new
WebReference.StatServiceBeanService();
WebReference.getReport parms = new WebReference.getReport();
parms.arg0 = new ASCIIEncoding().GetBytes(xml); //byte[] which I want
WebReference.getReportResponse response = service.getReport(parms);
Console.WriteLine( repsonse.ToString() );

Axis2
----------------------
StatServiceBeanServiceStub stub = new StatServiceBeanServiceStub();
StatServiceBeanServiceStub.GetReport getReport = new
StatServiceBeanServiceStub.GetReport();
FileDataSource dataSource =
     new
FileDataSource("/home/rick/projects/eds/testsrc/testresources/testspecs/pgm1.xml");
DataHandler dataHandler = new DataHandler(dataSource);
getReport.setArg0(dataHandler);
StatServiceBeanServiceStub.GetReport1 getReport1 = new
StatServiceBeanServiceStub.GetReport1();
getReport1.setGetReport(getReport);
StatServiceBeanServiceStub.GetReportResponse0 response0 =
stub.getReport( getReport1 );
StatServiceBeanServiceStub.GetReportResponse response =
response0.getGetReportResponse();
System.out.println( response.get_return() );

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


Reply via email to