axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thilina Gunarathne" <cset...@gmail.com>
Subject Re: Interop problems with .Net and Axis 2 using MTOM
Date Fri, 21 Mar 2008 00:10:41 GMT
If the error is coming from the server, you may want to check the following
and try using the axiom snapshots as mentioned.

https://issues.apache.org/jira/browse/AXIS2-3196

thanks,
Thilina

On Wed, Mar 19, 2008 at 12:11 PM, Paul Fremantle <pzfreo@gmail.com> wrote:

> Any chance of the TCPMON trace. It looks to me like there is a problem
> in the response from the server.
>
> Paul
>
> 2008/3/19 Amo23 <armaghan23@hotmail.com>:
> >
> >  Here is the C# WSDL
> >
> >  _____________________________________
> >
> >  <?xml version="1.0" encoding="utf-8"?>
> >  <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >  xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
> >  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> >  xmlns:tns="http://MyCerPrototype.com/"
> >  xmlns:s1="http://MyCerPrototype.com/AbstractTypes"
> >  xmlns:s="http://www.w3.org/2001/XMLSchema"
> >  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> >  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> >  targetNamespace="http://MyCerPrototype.com/"
> >  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> >   <wsdl:types>
> >     <s:schema elementFormDefault="qualified"
> >  targetNamespace="http://MyCerPrototype.com/">
> >       <s:element name="UploadDocument">
> >         <s:complexType>
> >           <s:sequence>
> >             <s:element minOccurs="0" maxOccurs="1" name="fileName"
> >  type="s:string" />
> >             <s:element minOccurs="0" maxOccurs="1" name="data"
> >  type="s:base64Binary" />
> >           </s:sequence>
> >         </s:complexType>
> >       </s:element>
> >       <s:element name="UploadDocumentResponse">
> >         <s:complexType />
> >       </s:element>
> >       <s:element name="receiveBinaryFile">
> >         <s:complexType>
> >           <s:sequence>
> >             <s:element minOccurs="0" maxOccurs="1" name="data"
> >  type="s:base64Binary" />
> >           </s:sequence>
> >         </s:complexType>
> >       </s:element>
> >       <s:element name="receiveBinaryFileResponse">
> >         <s:complexType />
> >       </s:element>
> >       <s:element name="HelloWorld">
> >         <s:complexType />
> >       </s:element>
> >       <s:element name="HelloWorldResponse">
> >         <s:complexType />
> >       </s:element>
> >     </s:schema>
> >     <s:schema targetNamespace="http://MyCerPrototype.com/AbstractTypes">
> >       <s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> >       <s:complexType name="StringArray">
> >         <s:complexContent mixed="false">
> >           <s:restriction base="soapenc:Array">
> >             <s:sequence>
> >               <s:element minOccurs="0" maxOccurs="unbounded"
> name="String"
> >  type="s:string" />
> >             </s:sequence>
> >           </s:restriction>
> >         </s:complexContent>
> >       </s:complexType>
> >     </s:schema>
> >   </wsdl:types>
> >   <wsdl:message name="UploadDocumentSoapIn">
> >     <wsdl:part name="parameters" element="tns:UploadDocument" />
> >   </wsdl:message>
> >   <wsdl:message name="UploadDocumentSoapOut">
> >     <wsdl:part name="parameters" element="tns:UploadDocumentResponse" />
> >   </wsdl:message>
> >   <wsdl:message name="receiveBinaryFileSoapIn">
> >     <wsdl:part name="parameters" element="tns:receiveBinaryFile" />
> >   </wsdl:message>
> >   <wsdl:message name="receiveBinaryFileSoapOut">
> >     <wsdl:part name="parameters" element="tns:receiveBinaryFileResponse"
> />
> >   </wsdl:message>
> >   <wsdl:message name="HelloWorldSoapIn">
> >     <wsdl:part name="parameters" element="tns:HelloWorld" />
> >   </wsdl:message>
> >   <wsdl:message name="HelloWorldSoapOut">
> >     <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
> >   </wsdl:message>
> >   <wsdl:message name="UploadDocumentHttpGetIn">
> >     <wsdl:part name="fileName" type="s:string" />
> >     <wsdl:part name="data" type="s1:StringArray" />
> >   </wsdl:message>
> >   <wsdl:message name="UploadDocumentHttpGetOut" />
> >   <wsdl:message name="receiveBinaryFileHttpGetIn">
> >     <wsdl:part name="data" type="s1:StringArray" />
> >   </wsdl:message>
> >   <wsdl:message name="receiveBinaryFileHttpGetOut" />
> >   <wsdl:message name="HelloWorldHttpGetIn" />
> >   <wsdl:message name="HelloWorldHttpGetOut" />
> >   <wsdl:message name="UploadDocumentHttpPostIn">
> >     <wsdl:part name="fileName" type="s:string" />
> >     <wsdl:part name="data" type="s1:StringArray" />
> >   </wsdl:message>
> >   <wsdl:message name="UploadDocumentHttpPostOut" />
> >   <wsdl:message name="receiveBinaryFileHttpPostIn">
> >     <wsdl:part name="data" type="s1:StringArray" />
> >   </wsdl:message>
> >   <wsdl:message name="receiveBinaryFileHttpPostOut" />
> >   <wsdl:message name="HelloWorldHttpPostIn" />
> >   <wsdl:message name="HelloWorldHttpPostOut" />
> >   <wsdl:portType name="StorePDFforArchivingSoap">
> >     <wsdl:operation name="UploadDocument">
> >       <wsdl:input message="tns:UploadDocumentSoapIn" />
> >       <wsdl:output message="tns:UploadDocumentSoapOut" />
> >     </wsdl:operation>
> >     <wsdl:operation name="receiveBinaryFile">
> >       <wsdl:input message="tns:receiveBinaryFileSoapIn" />
> >       <wsdl:output message="tns:receiveBinaryFileSoapOut" />
> >     </wsdl:operation>
> >     <wsdl:operation name="HelloWorld">
> >       <wsdl:input message="tns:HelloWorldSoapIn" />
> >       <wsdl:output message="tns:HelloWorldSoapOut" />
> >     </wsdl:operation>
> >   </wsdl:portType>
> >   <wsdl:portType name="StorePDFforArchivingHttpGet">
> >     <wsdl:operation name="UploadDocument">
> >       <wsdl:input message="tns:UploadDocumentHttpGetIn" />
> >       <wsdl:output message="tns:UploadDocumentHttpGetOut" />
> >     </wsdl:operation>
> >     <wsdl:operation name="receiveBinaryFile">
> >       <wsdl:input message="tns:receiveBinaryFileHttpGetIn" />
> >       <wsdl:output message="tns:receiveBinaryFileHttpGetOut" />
> >     </wsdl:operation>
> >     <wsdl:operation name="HelloWorld">
> >       <wsdl:input message="tns:HelloWorldHttpGetIn" />
> >       <wsdl:output message="tns:HelloWorldHttpGetOut" />
> >     </wsdl:operation>
> >   </wsdl:portType>
> >   <wsdl:portType name="StorePDFforArchivingHttpPost">
> >     <wsdl:operation name="UploadDocument">
> >       <wsdl:input message="tns:UploadDocumentHttpPostIn" />
> >       <wsdl:output message="tns:UploadDocumentHttpPostOut" />
> >     </wsdl:operation>
> >     <wsdl:operation name="receiveBinaryFile">
> >       <wsdl:input message="tns:receiveBinaryFileHttpPostIn" />
> >       <wsdl:output message="tns:receiveBinaryFileHttpPostOut" />
> >     </wsdl:operation>
> >     <wsdl:operation name="HelloWorld">
> >       <wsdl:input message="tns:HelloWorldHttpPostIn" />
> >       <wsdl:output message="tns:HelloWorldHttpPostOut" />
> >     </wsdl:operation>
> >   </wsdl:portType>
> >   <wsdl:binding name="StorePDFforArchivingSoap"
> >  type="tns:StorePDFforArchivingSoap">
> >     <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
> >     <wsdl:operation name="UploadDocument">
> >       <soap:operation soapAction="
> http://MyCerPrototype.com/UploadDocument"
> >  style="document" />
> >       <wsdl:input>
> >         <soap:body use="literal" />
> >       </wsdl:input>
> >       <wsdl:output>
> >         <soap:body use="literal" />
> >       </wsdl:output>
> >     </wsdl:operation>
> >     <wsdl:operation name="receiveBinaryFile">
> >       <soap:operation
> >  soapAction="http://MyCerPrototype.com/receiveBinaryFile"
> style="document" />
> >       <wsdl:input>
> >         <soap:body use="literal" />
> >       </wsdl:input>
> >       <wsdl:output>
> >         <soap:body use="literal" />
> >       </wsdl:output>
> >     </wsdl:operation>
> >     <wsdl:operation name="HelloWorld">
> >       <soap:operation soapAction="http://MyCerPrototype.com/HelloWorld"
> >  style="document" />
> >       <wsdl:input>
> >         <soap:body use="literal" />
> >       </wsdl:input>
> >       <wsdl:output>
> >         <soap:body use="literal" />
> >       </wsdl:output>
> >     </wsdl:operation>
> >   </wsdl:binding>
> >   <wsdl:binding name="StorePDFforArchivingSoap12"
> >  type="tns:StorePDFforArchivingSoap">
> >     <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
> >     <wsdl:operation name="UploadDocument">
> >       <soap12:operation
> >  soapAction="http://MyCerPrototype.com/UploadDocument" style="document"
> />
> >       <wsdl:input>
> >         <soap12:body use="literal" />
> >       </wsdl:input>
> >       <wsdl:output>
> >         <soap12:body use="literal" />
> >       </wsdl:output>
> >     </wsdl:operation>
> >     <wsdl:operation name="receiveBinaryFile">
> >       <soap12:operation
> >  soapAction="http://MyCerPrototype.com/receiveBinaryFile"
> style="document" />
> >       <wsdl:input>
> >         <soap12:body use="literal" />
> >       </wsdl:input>
> >       <wsdl:output>
> >         <soap12:body use="literal" />
> >       </wsdl:output>
> >     </wsdl:operation>
> >     <wsdl:operation name="HelloWorld">
> >       <soap12:operation soapAction="http://MyCerPrototype.com/HelloWorld
> "
> >  style="document" />
> >       <wsdl:input>
> >         <soap12:body use="literal" />
> >       </wsdl:input>
> >       <wsdl:output>
> >         <soap12:body use="literal" />
> >       </wsdl:output>
> >     </wsdl:operation>
> >   </wsdl:binding>
> >   <wsdl:binding name="StorePDFforArchivingHttpGet"
> >  type="tns:StorePDFforArchivingHttpGet">
> >     <http:binding verb="GET" />
> >     <wsdl:operation name="UploadDocument">
> >       <http:operation location="/UploadDocument" />
> >       <wsdl:input>
> >         <http:urlEncoded />
> >       </wsdl:input>
> >       <wsdl:output />
> >     </wsdl:operation>
> >     <wsdl:operation name="receiveBinaryFile">
> >       <http:operation location="/receiveBinaryFile" />
> >       <wsdl:input>
> >         <http:urlEncoded />
> >       </wsdl:input>
> >       <wsdl:output />
> >     </wsdl:operation>
> >     <wsdl:operation name="HelloWorld">
> >       <http:operation location="/HelloWorld" />
> >       <wsdl:input>
> >         <http:urlEncoded />
> >       </wsdl:input>
> >       <wsdl:output />
> >     </wsdl:operation>
> >   </wsdl:binding>
> >   <wsdl:binding name="StorePDFforArchivingHttpPost"
> >  type="tns:StorePDFforArchivingHttpPost">
> >     <http:binding verb="POST" />
> >     <wsdl:operation name="UploadDocument">
> >       <http:operation location="/UploadDocument" />
> >       <wsdl:input>
> >         <mime:content type="application/x-www-form-urlencoded" />
> >       </wsdl:input>
> >       <wsdl:output />
> >     </wsdl:operation>
> >     <wsdl:operation name="receiveBinaryFile">
> >       <http:operation location="/receiveBinaryFile" />
> >       <wsdl:input>
> >         <mime:content type="application/x-www-form-urlencoded" />
> >       </wsdl:input>
> >       <wsdl:output />
> >     </wsdl:operation>
> >     <wsdl:operation name="HelloWorld">
> >       <http:operation location="/HelloWorld" />
> >       <wsdl:input>
> >         <mime:content type="application/x-www-form-urlencoded" />
> >       </wsdl:input>
> >       <wsdl:output />
> >     </wsdl:operation>
> >   </wsdl:binding>
> >   <wsdl:service name="StorePDFforArchiving">
> >     <wsdl:port name="StorePDFforArchivingSoap"
> >  binding="tns:StorePDFforArchivingSoap">
> >       <soap:address
> >  location="http://192.168.1.173/Cer_Prototype/StorePDFforArchiving.asmx"
> />
> >     </wsdl:port>
> >     <wsdl:port name="StorePDFforArchivingSoap12"
> >  binding="tns:StorePDFforArchivingSoap12">
> >       <soap12:address
> >  location="http://192.168.1.173/Cer_Prototype/StorePDFforArchiving.asmx"
> />
> >     </wsdl:port>
> >     <wsdl:port name="StorePDFforArchivingHttpGet"
> >  binding="tns:StorePDFforArchivingHttpGet">
> >       <http:address
> >  location="http://192.168.1.173/Cer_Prototype/StorePDFforArchiving.asmx"
> />
> >     </wsdl:port>
> >     <wsdl:port name="StorePDFforArchivingHttpPost"
> >  binding="tns:StorePDFforArchivingHttpPost">
> >       <http:address
> >  location="http://192.168.1.173/Cer_Prototype/StorePDFforArchiving.asmx"
> />
> >     </wsdl:port>
> >   </wsdl:service>
> >  </wsdl:definitions>
> >
> >  ________________________________________
> >
> >
> >
> >  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-tp16097043p16145754.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
> >
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Thilina Gunarathne - http://thilinag.blogspot.com

Mime
View raw message