Dan, thanks for the answer. I'd like to use the "schema elements" option as a
backup since it makes the API look kinda ugly in some places. ;-) Any dates
on 1.2.6?

Thanks again for your response,
  Sef


Dan Diephouse wrote:
> 
> Hiya Sef,
> 
> Yeah this is currently a bug in XFire.  It currently doesn't work as a
> direct parameter to your service - only within other schema elements.
> We're
> taking a look at fixing it for 1.2.6 though. Sorry for the problems this
> has
> caused!
> 
> - Dan
> 
> On 4/18/07, sef <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi,
>>
>> reading my question over again made me post some code snippets for
>> clarification of my problem. The sample WSDL I'm using is appended on the
>> bottom of my message.
>>
>> What I'd like is WsGen to generate the stubs for my service in such a way
>> that the method signature will be
>>
>>     public String sayHello(
>>         @WebParam(name = "firstName", targetNamespace =
>> "http://example.com/myService";)
>>         String name,
>>         DataSource content);
>>
>> instead of
>>
>>     public String sayHello(
>>         @WebParam(name = "firstName", targetNamespace =
>> "http://example.com/myService";)
>>         MyContent firstName);
>>
>> If I avoid additional complex types and just modify the message part of
>> the
>> WSDL as follows:
>>
>>    <message name="SayHelloRequest">
>>       <part name="firstName" type="tns:myContent"/>
>>       <part name="name" type="xsd:string"/>
>>       <part name="content" type="xsd:base64Binary"
>>
>> xmime:expectedContentTypes="application/octet-stream"
>>
>> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"/>
>>    </message>
>>
>> then my method looks as follows:
>>
>>     public String sayHello(
>>         @WebParam(name = "firstName", targetNamespace =
>> "http://example.com/myService";)
>>         MyContent firstName,
>>         @WebParam(name = "name", targetNamespace =
>> "http://example.com/myService";)
>>         String name,
>>         @WebParam(name = "content", targetNamespace =
>> "http://example.com/myService";)
>>         byte[] content);
>>
>> Which still leaves me only with a byte[] or with an overhead of creating
>> dummy classes. Is there a way for me to get the desired method signature?
>> Or
>> am I screwing something up big time in my WSDL?
>>
>> Thanks,
>>   sef
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <definitions name="HelloService"
>>    targetNamespace="http://example.com/myService";
>>    xmlns="http://schemas.xmlsoap.org/wsdl/";
>>    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
>>    xmlns:tns="http://example.com/myService";
>>    xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>>
>>         <types>
>>                 <xsd:schema xmlns=""
>>                                         xmlns:xsd="
>> http://www.w3.org/2001/XMLSchema";
>>                                         targetNamespace="
>> http://example.com/myService";>
>>
>>                 <xsd:element name="myContent">
>>                         <xsd:complexType>
>>                                 <xsd:all>
>>                                         <xsd:element name="name"
>> type="xsd:string"/>
>>                                         <xsd:element name="content"
>> type="xsd:base64Binary"
>>
>> xmime:expectedContentTypes="application/octet-stream"
>>
>> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"/>
>>                                 </xsd:all>
>>                         </xsd:complexType>
>>                 </xsd:element>
>>                 </xsd:schema>
>>         </types>
>>
>>    <message name="SayHelloRequest">
>>       <part name="firstName" type="tns:myContent"/>
>>    </message>
>>    <message name="SayHelloResponse">
>>       <part name="greeting" type="xsd:string"/>
>>    </message>
>>
>>    <portType name="Hello_PortType">
>>       <operation name="sayHello">
>>          <input message="tns:SayHelloRequest"/>
>>          <output message="tns:SayHelloResponse"/>
>>       </operation>
>>    </portType>
>>
>>    <binding name="Hello_Binding" type="tns:Hello_PortType">
>>       <soap:binding style="rpc"
>>          transport="http://schemas.xmlsoap.org/soap/http"/>
>>       <operation name="sayHello">
>>          <soap:operation soapAction="sayHello"/>
>>          <input>
>>             <soap:body
>>                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
>>                namespace="urn:examples:helloservice"
>>                use="encoded"/>
>>          </input>
>>          <output>
>>             <soap:body
>>                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
>>                namespace="urn:examples:helloservice"
>>                use="encoded"/>
>>          </output>
>>       </operation>
>>    </binding>
>>
>>    <service name="Hello_Service">
>>       <documentation>WSDL File for HelloService</documentation>
>>       <port binding="tns:Hello_Binding" name="Hello_Port">
>>          <soap:address
>>             location="http://localhost:8080/soap/servlet/rpcrouter"/>
>>       </port>
>>    </service>
>> </definitions>
>>
>>
>>
>> sef wrote:
>> >
>> > Hello,
>> >
>> > I'm using a WSDL first approach to develop my services. I'd like to use
>> > MTOM
>> > in one of my services. This hasn't been a problem until I realized that
>> > reading all the data into a byte[] and sending it over to my service
>> isn't
>> > the best option to go with. Xfire supports streaming with DataSource
>> but
>> I
>> > cannot nail down my WSDL in such a way that the WsGenTask would
>> generate
>> > me
>> > appropriate stubs and interfaces to support DataSource as a parameter.
>> The
>> > solution suggested here (
>> >
>> http://article.gmane.org/gmane.comp.java.xfire.user/3534/match=mtom+wsdl
>> )
>> > didn't quite work for me.
>> >
>> > Defining an element like this <xs:element name="teset"
>> > type="xs:base64Binary"
>> > xmime:expectedContentTypes="application/octet-stream"
>> > xmlns:xmime="http://www.w3.org/2005/05/xmlmime"/> still gives me
>> >
>> >     public String myOperation(
>> >         @WebParam(name = "teset", targetNamespace = "
>> > http://example.com/myservice";)
>> >         byte[] teset);
>> >
>> > Even if I set "image/jpeg" as the expectedContentTypes I still end up
>> with
>> > a
>> > byte[].
>> >
>> > Any help or suggestions appreciated!
>> >
>> > Thanks,
>> >   sefanovic
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Generating-service-stubs-for-MTOM-tf3596173.html#a10057056
>> Sent from the XFire - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
> 
> 
> -- 
> Dan Diephouse
> Envoi Solutions
> http://envoisolutions.com | http://netzooid.com/blog
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Generating-service-stubs-for-MTOM-tf3596173.html#a10073739
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to