Hi
 
I am trying to send a DIME attachment from .Net Client(C#) to Java(Axis Web Service).
I am getting the following error message:

"An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in system.web.services.dll
Additional information: java.lang.NullPointerException"
 
Could you tell me what could be the reason for this.

I have attached below all the necessary information:

===========================================================
.Net Code is as follows:

//Create a proxy class for the web service
GESAttachment.GESServiceServiceWse ws = new GESAttachment.GESServiceServiceWse();

//Convert the file to a Memory Stream
FileInfo fi = new FileInfo(FileName);
FileStream fs = fi.OpenRead();
byte [] bytes = new byte[fs.Length];
int numRead = fs.Read(bytes, 0, (int)fs.Length);
fs.Close();
MemoryStream ms =
new MemoryStream(bytes);

//Create and Add the Attachment to the SOAPContext
DimeAttachment dimeAttach = new DimeAttachment("text/plain",TypeFormat.MediaType,ms);
ws.RequestSoapContext.Attachments.Add(dimeAttach);

//Call the Web service method
string strReturn = ws.processAttachments();
===========================================================

===========================================================
The TCPMONITOR exceptions is as follows:

 

   http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       
           
            soapenv:Server.userException  
            java.lang.NullPointerException  
               
               PCIIB16242http://xml.apache.org/axis/">PCIIB16242>  
           
 
        

     

  
 
.NET CODE SNIPPET
 
===========================================================
JAVA WEB SERVICE CODE:
 
My java web service code is as follows:
 
// Getting the messageContext instance
MessageContext messageContext = MessageContext.getCurrentContext();
Message msg = messageContext.getRequestMessage();
Attachments attachments = msg.getAttachmentsImpl();
===========================================================
   
My WSDL as follows:
 

http://ejb.poc.astrazeneca.com/GESService.wsdl" xmlns:impl="http://ejb.poc.astrazeneca.com/GESService.wsdl" xmlns:intf="http://ejb.poc.astrazeneca.com/GESService.wsdl" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

 
  http://www.w3.org/2001/XMLSchema" targetNamespace="http://ejb.poc.astrazeneca.com/GESService.wsdl" elementFormDefault="qualified">
  
  
  
 

 
 
  
 
     
 
  
 
  
 
     
 
  
 
  
 
     
 
  
 
  
 
  
 
  
 
     
 
        
 
        
 
     
 
     
 
        
 
        
 
     
 
  
 
  
 
      http://schemas.xmlsoap.org/soap/http"/>
 
     
 
        
 
        
 
           
 
        
 
        
 
           
 
        
 
     
 
     
 
        
 
        
 
           
 
        
 
        
 
           
 
        
 
     
 
  
 
  
 
     
 
         http://pciib16242:8888/axis/services/GESService"/>
 
     
 
  
 

===========================================================

Could you please throw some light on this?