0 Replies Latest reply: Jul 16, 2013 1:31 AM by user10070648 RSS

    How to print total SOAP message

    user10070648

      I have generated client stub using wsdl2java.sh.  And create the soap message to sent server. In fact, I can trace the message using TcpMON. So how can I log same message ?

       

      My code

       

      String url = "http://127.0.0.1:5555/CELCOM_RC/PaymentGateway?wsdl";

         

       

      ConfigurationContext myConfigContext =

               ConfigurationContextFactory.createConfigurationContextFromFileSystem(null , null);

      PaymentGatewayStub st = new PaymentGatewayStub(myConfigContext, url);

       

       

      st._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);

       

       

      ReconReport r = new ReconReport();

       

             

      r.setLogin("1234");

      r.setPass("xyx");

      r.setDesc("Testing");

      r.setFilename("20130716.TXT");

       

       

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

      DataHandler dataHandler = new DataHandler(ds);

      Base64Binary bs = new Base64Binary();

      bs.setBase64Binary(dataHandler);

      ContentType_type0 ct = new ContentType_type0();

      ct.setContentType_type0("text/plain");

      bs.setContentType(ct);

      r.setAttachment(bs);

       

         

      ReconReportResponse resp = st.reconReport(r);

         

      System.out.println("Response code "+resp.getRetCode());

       

       

       

      TcpMon Packet

       

      POST /CELCOM_RC/PaymentGateway?wsdl HTTP/1.1

      Content-Type: multipart/related; boundary="MIMEBoundary_e9ead16d54095a102981cc0463efe74e8b7faf698a39466b"; type="application/xop+xml"; start="<0.19ead16d54095a102981cc0463efe74e8b7faf698a39466b@apache.org>"; start-info="application/soap+xml"; action="urn:ReconReport"

      User-Agent: Axis2

      Host: 10.100.0.149:5555

      Transfer-Encoding: chunked

       

      777

      --MIMEBoundary_e9ead16d54095a102981cc0463efe74e8b7faf698a39466b

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

      Content-Transfer-Encoding: binary

      Content-ID: <0.19ead16d54095a102981cc0463efe74e8b7faf698a39466b@apache.org>

         <?xml version='1.0' encoding='UTF-8'?>

            <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">

               <soapenv:Body>

                  <ns2:ReconReport xmlns:ns2="http://paymentGateway.celcom.com">

                     <ns2:login>1234</ns2:login>

                     <ns2:pass>xyz</ns2:pass>

                     <ns2:filename>20130716.TXT</ns2:filename>

                     <ns2:desc>Testing </ns2:desc>

                     <ns2:attachment xmlns:ns1="http://www.w3.org/2005/05/xmlmime" ns1:contentType="text/plain">

                        <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:1.09ead16d54095a102981cc0463efe74e8b7faf698a39466b@apache.org" />

                     </ns2:attachment>

                  </ns2:ReconReport>

               </soapenv:Body>

            </soapenv:Envelope>--MIMEBoundary_e9ead16d54095a102981cc0463efe74e8b7faf698a39466bContent-Type: text/plainContent-Transfer-Encoding: binaryContent-ID:

            <1.09ead16d54095a102981cc0463efe74e8b7faf698a39466b@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||202|40637782|0135605893|2000|20091019151133||xxxxxxxxxxxx5442|123654|203|40637783|0135612393|1000|20091019151258||204|40637784|0135612393|2000|20091019151243||xxxxxxxxxxxx5442|123775|900|23482933|40637781|20091019141059|658|901|23482938|20091019141048|656|44084597|110|20091019141048|121|801|21337384|44084597|140|20091019141040|0193456678|Y|TOT. REC : 14--MIMEBoundary_e9ead16d54095a102981cc0463efe74e8b7faf698a39466b--0

       

       

      Thanks