0 Replies Latest reply: Jul 10, 2013 2:04 AM by user10070648 RSS

    Getting different SOAP message contains

    user10070648

      I'm trying to send a text file using SOAP based message, And following the server specification. But when I get network trace using wireshark , it's different with what server is accepting

       

      Trace packet (My application is sending)

       

      -------------

       

      First boundary: ------=_Part_0_260449011.1373434153274\r\n

          Encapsulated multipart part:  (text/xml)

              Content-Type: text/xml; charset=UTF-8\r\n

              Content-Transfer-Encoding: binary\r\n

              Content-Id: <0CE9020452DAC00F8F40ECE98D8E2764>\r\n\r\n

              eXtensible Markup Language

                  <?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>

                          <ReconReport

                              xmlns="http://paymentGateway.celcom.com">

                              <login>

                                  123

                                  </login>

                              <pass>

                                  123

                                  </pass>

                              <filename>

                                  BSN.TXT

                                  </filename>

                              <desc>

                                  Celcom

                                  </desc>

                              </ReconReport>

                          </soapenv:Body>

                      </soapenv:Envelope>

          Boundary: \r\n------=_Part_0_260449011.1373434153274\r\n

          Encapsulated multipart part:  (text/plain)

              Content-Type: text/plain\r\n

              Content-Transfer-Encoding: binary\r\n

              Content-Id: <test.txt>\r\n\r\n

              Line-based text data: text/plain

                  1|40637781|44084597|110|20091019141048|121|\n

                  2|77371568|44084597|120|20091019141050|126|162727|MBB|\n

                  3|66432343|44084597|130|20091019141059|56|4111111111111111|0313|123456|\n

                  101|21339684|0192234567|140|0|0|20091019141038|\n

                  102|21339685|0192234567|140|0|0|20091019145013|\n

                  103|21339686|0192234567|140|0|0|20091019146043|\n

                  104|21339687|21339686|2009101914703|\n

                  201|40637781|0135605893|1000|20091019151058||\n

                  202|40637782|0135605893|2000|20091019151133||xxxxxxxxxxxx5442|123654|\n

                  203|40637783|0135612393|1000|20091019151258||\n

                  204|40637784|0135612393|2000|20091019151243||xxxxxxxxxxxx5442|123775|\n

                  900|23482933|40637781|20091019141059|658|\n

                  901|23482938|20091019141048|656|44084597|110|20091019141048|121|\n

                  801|21337384|44084597|140|20091019141040|0193456678|Y|\n

                  TOT. REC : 14\n

                  \n

          Last boundary: \r\n------=_Part_0_260449011.1373434153274--\r\n

       

      -------------

       

       

       

      Server accepting

       

       

      ---------------------

      --MIMEBoundary_9aca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e

      Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml"

      Content-Transfer-Encoding: binary

      Content-ID: <0.8aca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e@apache.org>

       

      <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns1:ReconReport xmlns:ns1="http://paymentGateway.celcom.com"><ns1:login>xxxxxxx</ns1:login><ns1:pass>xxxxxxx</ns1:pass><ns1:filename>20120213.txt</ns1:filename><ns1:desc>xxxxxxx Recon Report</ns1:desc><ns1:attachment xmlns:ns2="http://www.w3.org/2005/05/xmlmime" ns2:contentType="text/plain"><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:1.baca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e@apache.org" /></ns1:attachment></ns1:ReconReport></soapenv:Body></soapenv:Envelope>

      --MIMEBoundary_9aca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e

      Content-Type: text/plain

      Content-Transfer-Encoding: binary

      Content-ID: <1.baca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e@apache.org>

       

      1|40637781|44084597|110|20091019141048|121|

      2|77371568|44084597|120|20091019141050|126|162727|MBB|

      3|66432343|44084597|130|20091019141059|56|4111111111111111|0313|123456|

      101|21339684|0192234567|140|0|0|20091019141038|

      102|21339685|0192234567|140|0|0|20091019145013|

      103|21339686|0192234567|140|0|0|20091019146043|

      104|21339687|21339686|2009101914703|

      201|40637781|0135605893|1000|20091019151058|102310-ABCDEF|

      202|40637781|0135605893|2000|20091019151133|102310-ABCDEF|xxxxxxxxxxxx5442|123654|

      900|23482933|40637781|20091019141059|658|

      801|21337384|44084597|140|20091019141040|0193456678|Y|

      TOT. REC : 10

       

      --MIMEBoundary_9aca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e--

       

       

       

      --------------------

       

       

       

       

      My code as bellow,

       

       

       

      ------------------------

       

         public int reconReport(java.lang.String login, java.lang.String pass, java.lang.String filename, java.lang.String desc, byte[]       attachment) throws java.rmi.RemoteException {

              if (super.cachedEndpoint == null) {

                  throw new org.apache.axis.NoEndPointException();

              }

              org.apache.axis.client.Call _call = createCall();

              _call.setOperation(_operations[2]);

              _call.setUseSOAPAction(true);

              _call.setSOAPActionURI("urn:ReconReport");

              _call.setEncodingStyle(null);

              _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);

              _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);

              _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);

              _call.setOperationName(new javax.xml.namespace.QName("http://paymentGateway.celcom.com", "ReconReport"));

       

         

             

       

             

       

              DataSource ds = new FileDataSource(new File("test.txt"));

              DataHandler dh = new DataHandler(ds);

              org.apache.axis.attachments.AttachmentPart ap = new org.apache.axis.attachments.AttachmentPart(dh);

              ap.setContentType("text/plain");

              ap.setContentId("test.txt");

             

              Hashtable chunkedTable = new Hashtable();

              chunkedTable.put(HTTPConstants.HEADER_TRANSFER_ENCODING, HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED);

              chunkedTable.put(HTTPConstants.HEADER_CONTENT_TYPE, HTTPConstants.HEADER_ACCEPT_APPLICATION_DIME);

             

              _call.setProperty(_call.ATTACHMENT_ENCAPSULATION_FORMAT, _call.ATTACHMENT_ENCAPSULATION_FORMAT_MTOM);

              _call.setProperty(MessageContext.HTTP_TRANSPORT_VERSION, HTTPConstants.HEADER_PROTOCOL_V11);

              _call.setProperty(HTTPConstants.REQUEST_HEADERS,chunkedTable);

             

              _call.addAttachmentPart(ap);

             

       

             

              java.lang.Object _resp = _call.invoke(new java.lang.Object[] {login, pass, filename, desc,null});

       

       

           System.out.println("Request : "+_call.getMessageContext().getRequestMessage().getSOAPPartAsString());

                    

           System.out.println("Response :"+_call.getMessageContext().getResponseMessage().getSOAPPartAsString());

         

       

       

      -----------------------

       

       

      Please let me know why it's different and where is the place Im doing wrong ?

       

      Thanks