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

On 6/14/07, robert lazarski <[EMAIL PROTECTED]> wrote:
?
>
> Sorry, I thought you were using POJO's .

I guess I should be sorry, I must have confused you, I am using POJOS.
Here is exactly how I started down this bunny trail...

1) Got requirement for this small demo that we need to call a service
that takes an xml spec that the client can submit (any platform).

2) Being new to webservices, figured I'd try Axis2.

3) Saw the demo of where you create a POJO and then just supply a
services.xml file that exposes the class.

4) Deploy the service as deescribed in the docs which creates the wsdl
for me and everything 'seems' ok. ( I started with a simple method
that took a string - echo(String myEcho ) { return echo; }

5) Built the client stubs using wsdl2java and and ran the client and
all was well (with the echo test).

6) Then I figured I'd try the same thing as above by passing in XML as
the String and that's where things began to break down.

It looks like now I should be considering using AXIOM and do things
with a more manual approach if dealign with a byte[] or else look into
using one of the attachment protocols?

Right now I'll do whatever would be considered the 'easiest' which is
also easy for someone on the other end to create their client (ie .net
or java). Thanks again.

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


Go with WSDL is my advice. It might take you an extra day or two in order to
get started, but it will be time well spent - especially if dealing with
other languages. Get a WSDL validator like WST from eclipse, write a very
simple wsdl with an element like I showed, and that'd be about all you need.
Hint: use document / literal as the wsdl style.

Actually, I did a two minute hack on what you seem to need - you'll have to
google to understand it and be sure to follow the axis2 docs. Also - it
returns a message / code instead of exceptions / faults - its a personal
style that has kept me out of an area that's had trouble at times.

HTH,
Robert

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

<definitions name="ByteSenderService" targetNamespace="http://byteSenderNS";
xmlns:tns="http://byteSenderNS"; xmlns="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:ns2="http://byteSenderNS/types
">
 <types>
   <schema targetNamespace="http://byteSenderNS/types"; xmlns:tns="
http://byteSenderNS/types"; xmlns:soap11-enc="
http://schemas.xmlsoap.org/soap/encoding/"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"; xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/"; xmlns="http://www.w3.org/2001/XMLSchema";>
     <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
     <complexType name="ReturnWebBase">
       <sequence>
         <element name="errorMessage" type="xsd:string"/>
         <element name="successErrorCode" type="xsd:int"/>
       </sequence>
     </complexType>
     <element name="ByteSender">
       <complexType>
         <sequence>
           <element name="myBytes" type="xsd:base64Binary"/>
         </sequence>
       </complexType>
     </element>
     <element name="ReturnWebBaseResponse" type="ns2:ReturnWebBase"/>
</schema></types>
 <message name="ByteSenderEndpoint_ByteSender">
   <part name="parameters" element="ns2:ByteSender"/>
 </message>
 <message name="ByteSenderEndpoint_ByteSenderResponse">
   <part name="result" element="ns2:ReturnWebBaseResponse"/>
 </message>
 <portType name="ByteSenderEndpoint">
   <operation name="ByteSender">
     <input message="tns:ByteSenderEndpoint_ByteSender"
name="ByteSenderEndpoint_ByteSender"/>
     <output message="tns:ByteSenderEndpoint_ByteSenderResponse"
name="ByteSenderEndpoint_ByteSenderResponse"/>
   </operation>
 </portType>
 <binding name="ByteSenderEndpointBinding" type="tns:ByteSenderEndpoint">
   <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
style="document"/>
   <operation name="ByteSender">
     <soap:operation soapAction="ByteSender"/>
     <input name="ByteSenderEndpoint_ByteSender">
       <soap:body use="literal"/>
     </input>
     <output name="ByteSenderEndpoint_ByteSenderResponse">
       <soap:body use="literal"/>
     </output>
   </operation>
 </binding>
 <service name="ByteSenderService">
   <port name="ByteSenderEndpointPort"
binding="tns:ByteSenderEndpointBinding">
     <soap:address location="
http://localhost:8080/axis2/services/ByteSenderEndpoint
"/></port></service></definitions>

Reply via email to