List Info

Thread: Sending Attachments using WSIF




Sending Attachments using WSIF
user name
2006-11-30 10:45:47
Hi All
This is my second email concerning sending of attachments using WSIF and axis as service provider.I have used the same sample code specified on wsif website 
for sending attachments
 
the sample code looks like
 
           ;  final DataHandler dh = new DataHandler( "sample content ","text/plain" );
           ; final WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
           ; final WSIFService service = factory.getService( "http://my.wsdl",null, null, null, null );
           ; final WSIFOperation op = service.getPort().createOperation( "testAttachment" );
           ; final WSIFMessage in = op.createInputMessage();
           ; in.setObjectPart( "param1","myparam");
           ; in.setObjectPart( "attch", dh );
           ; op.executeInputOnlyOperation( in );
 
snippet of my wsdl ;file.
 
     <wsdl:binding>
 &nbsp; &nbsp; &nbsp; &nbsp;   ; <wsdl:operation name="testAttachment">
 &nbsp; &nbsp; &nbsp; &nbsp;   ; <wsdlsoap:operation soapAction=""/>
 &nbsp; &nbsp; &nbsp; &nbsp;   ; <wsdl:input name="testAttachmentRequest">;
 &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; <mime:multipartRelated>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; <mime:part>
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
 &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; namespace="http://xxx/Services/WSProvider" use="encoded"/>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; </mime:part>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; <mime:part>
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   <wsdlsoap:content part="attch" type="text/plain"/&gt;
 &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  </mime:part>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; </mime:multipartRelated>
  ; &nbsp; &nbsp; &nbsp; &nbsp;  </wsdl:input&gt;
 &nbsp;   ; &nbsp; &nbsp; &nbsp; <wsdl:output name="testAttachmentResponse"&gt;
 &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
 &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   namespace="http://xxxx/Services/WSProvider" use="encoded"/>
&nbsp;   ; &nbsp; &nbsp; &nbsp;  </wsdl:output>
 &nbsp; &nbsp; &nbsp;  </wsdl:operation&gt;
 &nbsp;  </wsdl:binding>;
 
 
Could anybody help me what i am missing as using this defintion and code above still i am not able to recieve attachments.I tried sending attachments using SOAP UI and it works perfectly.So it must be something that i missing over here.
 
Thanks in advance
Amey

 
Sending Attachments using WSIF
user name
2006-11-30 22:08:57
Amey Rokde wrote:
> Hi All
> This is my second email concerning sending of
attachments using WSIF
> and axis as service provider.I have used the same
sample code
> specified on wsif website 
> for sending attachments
>  
> the sample code looks like
>  
>              final DataHandler dh = new DataHandler(
"sample content
> ","text/plain" );
>             final WSIFServiceFactory factory =
> WSIFServiceFactory.newInstance();
>             final WSIFService service =
factory.getService(
> "http://my.wsdl
<http://my.wsdl/>",null, null, null, null );
>             final WSIFOperation op =
> service.getPort().createOperation(
"testAttachment" );
>             final WSIFMessage in =
op.createInputMessage();
>             in.setObjectPart(
"param1","myparam");
>             in.setObjectPart( "attch", dh );
>             op.executeInputOnlyOperation( in );
>  
> snippet of my wsdl file.
>  
>      <wsdl:binding>
>             <wsdl:operation
name="testAttachment">
>             <wsdlsoap:operation
soapAction=""/>
>             <wsdl:input
name="testAttachmentRequest">
>                 <mime:multipartRelated>
>                     <mime:part>
>                             <wsdlsoap:body
> encodingStyle="http:
//schemas.xmlsoap.org/soap/encoding/"
>                                           
> namespace="http://xxx/Servi
ces/WSProvider" use="encoded"/>
>                     </mime:part>
>                     <mime:part>
>                             <wsdlsoap:content
part="attch"
> type="text/plain"/>
>                     </mime:part>
>                 </mime:multipartRelated>
>             </wsdl:input>
>             <wsdl:output
name="testAttachmentResponse">
>                 <wsdlsoap:body
> encodingStyle="http:
//schemas.xmlsoap.org/soap/encoding/"
>                               
> namespace="http://xxxx/Ser
vices/WSProvider" use="encoded"/>
>             </wsdl:output>
>         </wsdl:operation>
>     </wsdl:binding>
>  
>  
> Could anybody help me what i am missing as using this
defintion and
> code above still i am not able to recieve attachments.I
tried sending
> attachments using SOAP UI and it works perfectly.So it
must be
> something that i missing over here
in general WSIF sits on top of WSIF provider such as axis or
apache soap
and can do only as much as provider can do. did  were you
able to send
attachments using the underlying provider (was it AXIS1?)
directly?
maybe you could try different version of soap toolkit? and
what exactly
version of WSIF did you try  - was it the latest?

best,

alek

-- 
The best way to predict the future is to invent it - Alan
Kay


------------------------------------------------------------
---------
To unsubscribe, e-mail: wsif-user-unsubscribews.apache.org
For additional commands, e-mail: wsif-user-helpws.apache.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )