axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amo23 <armagha...@hotmail.com>
Subject Re: Interop problems with .Net and Axis 2 using MTOM
Date Wed, 19 Mar 2008 15:44:51 GMT

Hi Thilina, Thanks for the response to the post. I'll clarify my post a bit
more.    The service is written by our client in C#. I used WSDL2Java to
convert the C# WSDL to java code.Once i had the auto generated files, i
created a client to connect to it. The client uses the methods from the
autogenerated files to set up everything.  The snippet is the error log that
i get everytime i try to connect to it using the Client i created. Thanks
once again for looking into it. I really apprecite your help.


Amo23 wrote:
> 
> I used Axis 2 to create an MTOM enabled client and a service that sends a
> PDF as a byte[].
> 
> I then took the clients C# WSDL and generated the necessary files using
> WSDL2Java and created a client just like i did in Java.
> 
> I keep getting the following error.
> 
> The client code has been added after the error.
> 
> Can someone point out what im doing wrong here or guide me as to what i
> have to do ?
> 
> Thanks,
> 
> 
> _______________________________________________________________________________
> Exception in thread "main" org.apache.axis2.AxisFault
>     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
>     at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:89)
>     at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:326)
>     at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
>     at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
>     at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>     at
> com.myceridianprototype.StorePDFforArchivingStub.UploadDocument(StorePDFforArchivingStub.java:196)
>     at com.myceridianprototype.LocalClient.main(LocalClient.java:47)
> Caused by: java.lang.NullPointerException
>     at
> org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:156)
>     at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:111)
>     at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:87)
>     ... 6 more
> ________________________________________________________________________________
> import javax.activation.FileDataSource;
> import org.apache.axiom.om.OMAbstractFactory;
> import org.apache.axiom.om.OMElement;
> import org.apache.axiom.om.OMFactory;
> import org.apache.axiom.om.OMNamespace;
> import org.apache.axiom.om.OMText;
> import org.apache.axis2.Constants;
> 
> import com.amo.service.TestServiceStub;
> import com.amo.service.TestServiceStub.WritetoFileSystem;
> 
> public class ExihibitAClient {
> 
> 	private static final String EPR =
> "http://localhost/services/TestService/Test.asmx";
> 
> 	private static final String INPUT_FILE = "C:\\HOLD\\small.pdf";
> 
> 	public static void main(String[] args) throws Exception
> 
> 	{
> 			System.out.println("In the TestClient Main Method");
> 			System.out.println("EPR: "+EPR);
> 			System.out.println("Input File Name: "+INPUT_FILE);
> 			TestServiceStub stub = new TestServiceStub(EPR);
> 		
> stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_TRUE);
> 			stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(10000);
> 
> 			
> 			javax.activation.DataHandler dataHandler = new
> javax.activation.DataHandler(new FileDataSource(INPUT_FILE));
> 			
> 			WritetoFileSystem write = new WritetoFileSystem();
> 			write.setFilename("outputfile.pdf");
> 			write.setArray(dataHandler);
> 	
> 			stub.writetoFileSystem(write);
> 			System.out.println("done calling service...");
> 
> 	}
> 
> 	
> 	
> }
> _______________________________________________________________________________
> 

-- 
View this message in context: http://www.nabble.com/Interop-problems-with-.Net-and-Axis-2-using-MTOM-tp16097043p16145139.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message