Send DIME Attachment from .Net Client(C#) to J2EE(AXIS Web Service2.0)

Mar 1 2006 7:30 AM
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:

 
<?xml version="1.0" encoding="UTF-8"?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body> 
         <soapenv:Fault>  
            <faultcode>soapenv:Server.userException</faultcode>  
            <faultstring>java.lang.NullPointerException</faultstring>  
            <detail>   
               <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">PCIIB16242</ns1:hostname>  
            </detail> 
         </soapenv:Fault>
      </soapenv:Body>
   </soapenv:Envelope>
 
.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:
 
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="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/">
<!--WSDL created by Apache Axis version: 1.2.1
Built on Jun 14, 2005 (09:15:57 EDT)-->
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ejb.poc.astrazeneca.com/GESService.wsdl" elementFormDefault="qualified">
   <element name="AttachmentPOCReturn" type="xsd:string"/>
   <element name="value" type="xsd:string"/>
   <element name="getAttachmentReturn" type="xsd:string"/>
  </schema>
 </wsdl:types>
 
   <wsdl:message name="getAttachmentRequest">
 
      <wsdl:part name="value" element="impl:value"/>
 
   </wsdl:message>
 
   <wsdl:message name="AttachmentPOCResponse">
 
      <wsdl:part name="AttachmentPOCReturn" element="impl:AttachmentPOCReturn"/>
 
   </wsdl:message>
 
   <wsdl:message name="getAttachmentResponse">
 
      <wsdl:part name="getAttachmentReturn" element="impl:getAttachmentReturn"/>
 
   </wsdl:message>
 
   <wsdl:message name="AttachmentPOCRequest">
 
   </wsdl:message>
 
   <wsdl:portType name="GESService">
 
      <wsdl:operation name="AttachmentPOC">
 
         <wsdl:input name="AttachmentPOCRequest" message="impl:AttachmentPOCRequest"/>
 
         <wsdl:output name="AttachmentPOCResponse" message="impl:AttachmentPOCResponse"/>
 
      </wsdl:operation>
 
      <wsdl:operation name="getAttachment" parameterOrder="value">
 
         <wsdl:input name="getAttachmentRequest" message="impl:getAttachmentRequest"/>
 
         <wsdl:output name="getAttachmentResponse" message="impl:getAttachmentResponse"/>
 
      </wsdl:operation>
 
   </wsdl:portType>
 
   <wsdl:binding name="GESServiceSoapBinding" type="impl:GESService">
 
      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
 
      <wsdl:operation name="AttachmentPOC">
 
         <wsdlsoap:operation soapAction=""/>
 
         <wsdl:input name="AttachmentPOCRequest">
 
            <wsdlsoap:body use="literal"/>
 
         </wsdl:input>
 
         <wsdl:output name="AttachmentPOCResponse">
 
            <wsdlsoap:body use="literal"/>
 
         </wsdl:output>
 
      </wsdl:operation>
 
      <wsdl:operation name="getAttachment">
 
         <wsdlsoap:operation soapAction=""/>
 
         <wsdl:input name="getAttachmentRequest">
 
            <wsdlsoap:body use="literal"/>
 
         </wsdl:input>
 
         <wsdl:output name="getAttachmentResponse">
 
            <wsdlsoap:body use="literal"/>
 
         </wsdl:output>
 
      </wsdl:operation>
 
   </wsdl:binding>
 
   <wsdl:service name="GESServiceService">
 
      <wsdl:port name="GESService" binding="impl:GESServiceSoapBinding">
 
         <wsdlsoap:address location="http://pciib16242:8888/axis/services/GESService"/>
 
      </wsdl:port>
 
   </wsdl:service>
 
</wsdl:definitions>
===========================================================

Could you please throw some light on this?