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/> 
http://schemas.xmlsoap.org/soap/encoding/";
                                           namespace="  
<http://xxx/Services/WSProvider> http://xxx/Services/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/> 
http://schemas.xmlsoap.org/soap/encoding/";
                               namespace="  <http://xxxx/Services/WSProvider> 
http://xxxx/Services/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.
 
Thanks in advance
Amey


 

Reply via email to