Observing Missing Timestamp exception when doing creation via rest client

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Observing Missing Timestamp exception when doing creation via rest client

Thivya Mahenthirarasa
Hi Dev,

When I invoke POST method to create resource in a legacy(SOAP) backend. (Backe end is secured)in my API of a WUM updated ESB500 pack from a rest client, I'm observing exception as follows from the Backend soap service. The Other Methods (DELETE/GET) are working fine.


<faultcode>wsse:InvalidSecurity</faultcode>
 <faultstring>Missing Timestamp</faultstring>


The resource of the API

<resource methods="POST" uri-template="/postCMedi">
      <inSequence>
         <property name="messageType" value="text/xml" scope="axis2" type="STRING"/>
         <property name="ContentType" value="text/xml" scope="axis2" type="STRING"/>
         <header name="SOAPAction" scope="transport" value="urn:postCMedi"/>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                  <soapenv:header>
                     <some value></some value>
                  </soapenv:header>
                  <soapenv:Body>
                     <ser:postCMedi xmlns:ser="http://service.sample.central.com">
                        <ser:patient>
                           <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:insurerEmail>?</xsd:insurerEmail>
                              <xsd:insurerName>?</xsd:insurerName>
                              <xsd:insurerPhone>?</xsd:insurerPhone>
                           </xsd:insurer>
                           <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:condition>?</xsd:condition>
                              <xsd:treatment>?</xsd:treatment>
                           </xsd:medical>
                           <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:guardianEmail>?</xsd:guardianEmail>
                              <xsd:guardianName>?</xsd:guardianName>
                              <xsd:guardianPhone>?</xsd:guardianPhone>
                           </xsd:parentGuardian>
                           <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:address>?</xsd:address>
                              <xsd:email>?</xsd:email>
                              <xsd:phone>?</xsd:phone>
                           </xsd:patientContact>
                           <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
                           <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
                           <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:physicianEmail>?</xsd:physicianEmail>
                              <xsd:physicianName>?</xsd:physicianName>
                              <xsd:physicianPhone>?</xsd:physicianPhone>
                           </xsd:physician>
                        </ser:patient>
                     </ser:postCMedi>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args/>
         </payloadFactory>
         <property name="Authorization" value="Basic dGhpdnlhOnRoaXZ5YTEyMw==" scope="transport"/>
         <log level="full"/>
         <send>
            <endpoint>
               <address uri="https://192.168.55.160:9443/services/CentralPatientService" format="soap11"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
         <send/>
      </outSequence>
   </resource>


Could you please help to resolve this?



--
Thivya Mahenthirarasa
Software Engineer -Support Team | WSO2

Email: [hidden email]
Mobile: +94766461966
Web: http://wso2.com

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Observing Missing Timestamp exception when doing creation via rest client

Irham Iqbal
Hi Thuvya,

You can enable the wire log and check the response headers and status code to narrow down this. follow the blog[1] to know about wire logs. 


Thanks,
Iqbal

On Tue, Nov 14, 2017 at 8:10 PM, Thivya Mahenthirarasa <[hidden email]> wrote:
Hi Dev,

When I invoke POST method to create resource in a legacy(SOAP) backend. (Backe end is secured)in my API of a WUM updated ESB500 pack from a rest client, I'm observing exception as follows from the Backend soap service. The Other Methods (DELETE/GET) are working fine.


<faultcode>wsse:InvalidSecurity</faultcode>
 <faultstring>Missing Timestamp</faultstring>


The resource of the API

<resource methods="POST" uri-template="/postCMedi">
      <inSequence>
         <property name="messageType" value="text/xml" scope="axis2" type="STRING"/>
         <property name="ContentType" value="text/xml" scope="axis2" type="STRING"/>
         <header name="SOAPAction" scope="transport" value="urn:postCMedi"/>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                  <soapenv:header>
                     <some value></some value>
                  </soapenv:header>
                  <soapenv:Body>
                     <ser:postCMedi xmlns:ser="http://service.sample.central.com">
                        <ser:patient>
                           <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:insurerEmail>?</xsd:insurerEmail>
                              <xsd:insurerName>?</xsd:insurerName>
                              <xsd:insurerPhone>?</xsd:insurerPhone>
                           </xsd:insurer>
                           <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:condition>?</xsd:condition>
                              <xsd:treatment>?</xsd:treatment>
                           </xsd:medical>
                           <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:guardianEmail>?</xsd:guardianEmail>
                              <xsd:guardianName>?</xsd:guardianName>
                              <xsd:guardianPhone>?</xsd:guardianPhone>
                           </xsd:parentGuardian>
                           <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:address>?</xsd:address>
                              <xsd:email>?</xsd:email>
                              <xsd:phone>?</xsd:phone>
                           </xsd:patientContact>
                           <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
                           <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
                           <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:physicianEmail>?</xsd:physicianEmail>
                              <xsd:physicianName>?</xsd:physicianName>
                              <xsd:physicianPhone>?</xsd:physicianPhone>
                           </xsd:physician>
                        </ser:patient>
                     </ser:postCMedi>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args/>
         </payloadFactory>
         <property name="Authorization" value="Basic dGhpdnlhOnRoaXZ5YTEyMw==" scope="transport"/>
         <log level="full"/>
         <send>
            <endpoint>
               <address uri="https://192.168.55.160:9443/services/CentralPatientService" format="soap11"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
         <send/>
      </outSequence>
   </resource>


Could you please help to resolve this?



--
Thivya Mahenthirarasa
Software Engineer -Support Team | WSO2

Email: [hidden email]
Mobile: <a href="tel:+94%2076%20646%201966" value="+94766461966" target="_blank">+94766461966
Web: http://wso2.com

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Irham Iqbal
Software Engineer
WSO2


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Observing Missing Timestamp exception when doing creation via rest client

Mushthaq Rumy
Hi Thivya,

As Irham have suggested better to enable wire logs and check. Furthermore, seems like it is checking for a time stamp in the header tag.

Thanks & Regards,
Mushthaq

On Wed, Nov 15, 2017 at 5:21 AM, Irham Iqbal <[hidden email]> wrote:
Hi Thuvya,

You can enable the wire log and check the response headers and status code to narrow down this. follow the blog[1] to know about wire logs. 


Thanks,
Iqbal

On Tue, Nov 14, 2017 at 8:10 PM, Thivya Mahenthirarasa <[hidden email]> wrote:
Hi Dev,

When I invoke POST method to create resource in a legacy(SOAP) backend. (Backe end is secured)in my API of a WUM updated ESB500 pack from a rest client, I'm observing exception as follows from the Backend soap service. The Other Methods (DELETE/GET) are working fine.


<faultcode>wsse:InvalidSecurity</faultcode>
 <faultstring>Missing Timestamp</faultstring>


The resource of the API

<resource methods="POST" uri-template="/postCMedi">
      <inSequence>
         <property name="messageType" value="text/xml" scope="axis2" type="STRING"/>
         <property name="ContentType" value="text/xml" scope="axis2" type="STRING"/>
         <header name="SOAPAction" scope="transport" value="urn:postCMedi"/>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                  <soapenv:header>
                     <some value></some value>
                  </soapenv:header>
                  <soapenv:Body>
                     <ser:postCMedi xmlns:ser="http://service.sample.central.com">
                        <ser:patient>
                           <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:insurerEmail>?</xsd:insurerEmail>
                              <xsd:insurerName>?</xsd:insurerName>
                              <xsd:insurerPhone>?</xsd:insurerPhone>
                           </xsd:insurer>
                           <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:condition>?</xsd:condition>
                              <xsd:treatment>?</xsd:treatment>
                           </xsd:medical>
                           <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:guardianEmail>?</xsd:guardianEmail>
                              <xsd:guardianName>?</xsd:guardianName>
                              <xsd:guardianPhone>?</xsd:guardianPhone>
                           </xsd:parentGuardian>
                           <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:address>?</xsd:address>
                              <xsd:email>?</xsd:email>
                              <xsd:phone>?</xsd:phone>
                           </xsd:patientContact>
                           <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
                           <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
                           <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:physicianEmail>?</xsd:physicianEmail>
                              <xsd:physicianName>?</xsd:physicianName>
                              <xsd:physicianPhone>?</xsd:physicianPhone>
                           </xsd:physician>
                        </ser:patient>
                     </ser:postCMedi>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args/>
         </payloadFactory>
         <property name="Authorization" value="Basic dGhpdnlhOnRoaXZ5YTEyMw==" scope="transport"/>
         <log level="full"/>
         <send>
            <endpoint>
               <address uri="https://192.168.55.160:9443/services/CentralPatientService" format="soap11"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
         <send/>
      </outSequence>
   </resource>


Could you please help to resolve this?



--
Thivya Mahenthirarasa
Software Engineer -Support Team | WSO2

Email: [hidden email]
Mobile: <a href="tel:+94%2076%20646%201966" value="+94766461966" target="_blank">+94766461966
Web: http://wso2.com

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Irham Iqbal
Software Engineer
WSO2


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Mushthaq Rumy
Software Engineer
Mobile : <a href="tel:%2B94%20%280%29%20773%20451194" value="+94773451194" target="_blank">+94 (0) 779 492140
Email : [hidden email]
WSO2, Inc.; http://wso2.com/
lean . enterprise . middleware.


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Observing Missing Timestamp exception when doing creation via rest client

Thivya Mahenthirarasa
Hi Mushtaq/Irham,

I have enabled the wire logs,

The request which comes to ESB is as follows, which could able to produce the actual creation in the backend.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <some xmlns="http://ws.apache.org/ns/synapse" />
   </soapenv:Header>
   <soapenv:Body>
      <ser:postCMedi xmlns:ser="http://service.sample.central.com">
         <ser:patient>
            <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:insurerEmail>?</xsd:insurerEmail>
               <xsd:insurerName>?</xsd:insurerName>
               <xsd:insurerPhone>?</xsd:insurerPhone>
            </xsd:insurer>
            <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:condition>?</xsd:condition>
               <xsd:treatment>?</xsd:treatment>
            </xsd:medical>
            <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:guardianEmail>?</xsd:guardianEmail>
               <xsd:guardianName>?</xsd:guardianName>
               <xsd:guardianPhone>?</xsd:guardianPhone>
            </xsd:parentGuardian>
            <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:address>?</xsd:address>
               <xsd:email>?</xsd:email>
               <xsd:phone>?</xsd:phone>
            </xsd:patientContact>
            <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
            <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
            <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:physicianEmail>?</xsd:physicianEmail>
               <xsd:physicianName>?</xsd:physicianName>
               <xsd:physicianPhone>?</xsd:physicianPhone>
            </xsd:physician>
         </ser:patient>
      </ser:postCMedi>
   </soapenv:Body>
</soapenv:Envelope>



The request which goes from the ESB is as follows,due to which Backend is producing the mentioned timestamp error.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <some xmlns="http://ws.apache.org/ns/synapse" />
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
   </soapenv:Header>
   <soapenv:Body>
      <ser:postCMedi xmlns:ser="http://service.sample.central.com">
         <ser:patient>
            <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:insurerEmail>?</xsd:insurerEmail>
               <xsd:insurerName>?</xsd:insurerName>
               <xsd:insurerPhone>?</xsd:insurerPhone>
            </xsd:insurer>
            <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:condition>?</xsd:condition>
               <xsd:treatment>?</xsd:treatment>
            </xsd:medical>
            <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:guardianEmail>?</xsd:guardianEmail>
               <xsd:guardianName>?</xsd:guardianName>
               <xsd:guardianPhone>?</xsd:guardianPhone>
            </xsd:parentGuardian>
            <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:address>?</xsd:address>
               <xsd:email>?</xsd:email>
               <xsd:phone>?</xsd:phone>
            </xsd:patientContact>
            <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
            <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
            <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:physicianEmail>?</xsd:physicianEmail>
               <xsd:physicianName>?</xsd:physicianName>
               <xsd:physicianPhone>?</xsd:physicianPhone>
            </xsd:physician>
         </ser:patient>
      </ser:postCMedi>
   </soapenv:Body>
</soapenv:Envelope>

The response is as follows.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
         <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-5318">
            <wsu:Created>2017-11-15T04:45:28.638Z</wsu:Created>
            <wsu:Expires>2017-11-15T04:50:28.638Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <soapenv:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <faultcode>wsse:InvalidSecurity</faultcode>
         <faultstring>Missing Timestamp</faultstring>
         <detail />
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

What is the root cause for wsse:Security got added in the Soap Header. And How can i overcome this issue.

Thank you for the responses.

Regards,
Thivya


 


On Wed, Nov 15, 2017 at 5:54 AM, Mushthaq Rumy <[hidden email]> wrote:
Hi Thivya,

As Irham have suggested better to enable wire logs and check. Furthermore, seems like it is checking for a time stamp in the header tag.

Thanks & Regards,
Mushthaq

On Wed, Nov 15, 2017 at 5:21 AM, Irham Iqbal <[hidden email]> wrote:
Hi Thuvya,

You can enable the wire log and check the response headers and status code to narrow down this. follow the blog[1] to know about wire logs. 


Thanks,
Iqbal

On Tue, Nov 14, 2017 at 8:10 PM, Thivya Mahenthirarasa <[hidden email]> wrote:
Hi Dev,

When I invoke POST method to create resource in a legacy(SOAP) backend. (Backe end is secured)in my API of a WUM updated ESB500 pack from a rest client, I'm observing exception as follows from the Backend soap service. The Other Methods (DELETE/GET) are working fine.


<faultcode>wsse:InvalidSecurity</faultcode>
 <faultstring>Missing Timestamp</faultstring>


The resource of the API

<resource methods="POST" uri-template="/postCMedi">
      <inSequence>
         <property name="messageType" value="text/xml" scope="axis2" type="STRING"/>
         <property name="ContentType" value="text/xml" scope="axis2" type="STRING"/>
         <header name="SOAPAction" scope="transport" value="urn:postCMedi"/>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                  <soapenv:header>
                     <some value></some value>
                  </soapenv:header>
                  <soapenv:Body>
                     <ser:postCMedi xmlns:ser="http://service.sample.central.com">
                        <ser:patient>
                           <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:insurerEmail>?</xsd:insurerEmail>
                              <xsd:insurerName>?</xsd:insurerName>
                              <xsd:insurerPhone>?</xsd:insurerPhone>
                           </xsd:insurer>
                           <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:condition>?</xsd:condition>
                              <xsd:treatment>?</xsd:treatment>
                           </xsd:medical>
                           <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:guardianEmail>?</xsd:guardianEmail>
                              <xsd:guardianName>?</xsd:guardianName>
                              <xsd:guardianPhone>?</xsd:guardianPhone>
                           </xsd:parentGuardian>
                           <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:address>?</xsd:address>
                              <xsd:email>?</xsd:email>
                              <xsd:phone>?</xsd:phone>
                           </xsd:patientContact>
                           <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
                           <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
                           <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:physicianEmail>?</xsd:physicianEmail>
                              <xsd:physicianName>?</xsd:physicianName>
                              <xsd:physicianPhone>?</xsd:physicianPhone>
                           </xsd:physician>
                        </ser:patient>
                     </ser:postCMedi>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args/>
         </payloadFactory>
         <property name="Authorization" value="Basic dGhpdnlhOnRoaXZ5YTEyMw==" scope="transport"/>
         <log level="full"/>
         <send>
            <endpoint>
               <address uri="https://192.168.55.160:9443/services/CentralPatientService" format="soap11"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
         <send/>
      </outSequence>
   </resource>


Could you please help to resolve this?



--
Thivya Mahenthirarasa
Software Engineer -Support Team | WSO2

Email: [hidden email]
Mobile: <a href="tel:+94%2076%20646%201966" value="+94766461966" target="_blank">+94766461966
Web: http://wso2.com

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Irham Iqbal
Software Engineer
WSO2


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Mushthaq Rumy
Software Engineer
Mobile : <a href="tel:%2B94%20%280%29%20773%20451194" value="+94773451194" target="_blank">+94 (0) 779 492140
Email : [hidden email]
WSO2, Inc.; http://wso2.com/
lean . enterprise . middleware.




--
Thivya Mahenthirarasa
Software Engineer -Support Team | WSO2

Email: [hidden email]
Mobile: +94766461966
Web: http://wso2.com

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Observing Missing Timestamp exception when doing creation via rest client

Piriya Sivalingam
Hi all,

I am also facing the same error. The only difference is I am using a Proxy service in ESB 5.0.0 whereas Thivya mentioned it for API. 

Can you please suggest how to overcome this issue? 

Thanks,
Piriya

On Wed, Nov 15, 2017 at 10:35 AM, Thivya Mahenthirarasa <[hidden email]> wrote:
Hi Mushtaq/Irham,

I have enabled the wire logs,

The request which comes to ESB is as follows, which could able to produce the actual creation in the backend.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <some xmlns="http://ws.apache.org/ns/synapse" />
   </soapenv:Header>

   <soapenv:Body>
      <ser:postCMedi xmlns:ser="http://service.sample.central.com">
         <ser:patient>
            <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:insurerEmail>?</xsd:insurerEmail>
               <xsd:insurerName>?</xsd:insurerName>
               <xsd:insurerPhone>?</xsd:insurerPhone>
            </xsd:insurer>
            <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:condition>?</xsd:condition>
               <xsd:treatment>?</xsd:treatment>
            </xsd:medical>
            <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:guardianEmail>?</xsd:guardianEmail>
               <xsd:guardianName>?</xsd:guardianName>
               <xsd:guardianPhone>?</xsd:guardianPhone>
            </xsd:parentGuardian>
            <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:address>?</xsd:address>
               <xsd:email>?</xsd:email>
               <xsd:phone>?</xsd:phone>
            </xsd:patientContact>
            <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
            <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
            <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:physicianEmail>?</xsd:physicianEmail>
               <xsd:physicianName>?</xsd:physicianName>
               <xsd:physicianPhone>?</xsd:physicianPhone>
            </xsd:physician>
         </ser:patient>
      </ser:postCMedi>
   </soapenv:Body>
</soapenv:Envelope>



The request which goes from the ESB is as follows,due to which Backend is producing the mentioned timestamp error.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <some xmlns="http://ws.apache.org/ns/synapse" />
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
   </soapenv:Header>

   <soapenv:Body>
      <ser:postCMedi xmlns:ser="http://service.sample.central.com">
         <ser:patient>
            <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:insurerEmail>?</xsd:insurerEmail>
               <xsd:insurerName>?</xsd:insurerName>
               <xsd:insurerPhone>?</xsd:insurerPhone>
            </xsd:insurer>
            <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:condition>?</xsd:condition>
               <xsd:treatment>?</xsd:treatment>
            </xsd:medical>
            <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:guardianEmail>?</xsd:guardianEmail>
               <xsd:guardianName>?</xsd:guardianName>
               <xsd:guardianPhone>?</xsd:guardianPhone>
            </xsd:parentGuardian>
            <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:address>?</xsd:address>
               <xsd:email>?</xsd:email>
               <xsd:phone>?</xsd:phone>
            </xsd:patientContact>
            <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
            <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
            <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
               <xsd:physicianEmail>?</xsd:physicianEmail>
               <xsd:physicianName>?</xsd:physicianName>
               <xsd:physicianPhone>?</xsd:physicianPhone>
            </xsd:physician>
         </ser:patient>
      </ser:postCMedi>
   </soapenv:Body>
</soapenv:Envelope>

The response is as follows.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
         <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-5318">
            <wsu:Created>2017-11-15T04:45:28.638Z</wsu:Created>
            <wsu:Expires>2017-11-15T04:50:28.638Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <soapenv:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <faultcode>wsse:InvalidSecurity</faultcode>
         <faultstring>Missing Timestamp</faultstring>
         <detail />
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

What is the root cause for wsse:Security got added in the Soap Header. And How can i overcome this issue.

Thank you for the responses.

Regards,
Thivya


 


On Wed, Nov 15, 2017 at 5:54 AM, Mushthaq Rumy <[hidden email]> wrote:
Hi Thivya,

As Irham have suggested better to enable wire logs and check. Furthermore, seems like it is checking for a time stamp in the header tag.

Thanks & Regards,
Mushthaq

On Wed, Nov 15, 2017 at 5:21 AM, Irham Iqbal <[hidden email]> wrote:
Hi Thuvya,

You can enable the wire log and check the response headers and status code to narrow down this. follow the blog[1] to know about wire logs. 


Thanks,
Iqbal

On Tue, Nov 14, 2017 at 8:10 PM, Thivya Mahenthirarasa <[hidden email]> wrote:
Hi Dev,

When I invoke POST method to create resource in a legacy(SOAP) backend. (Backe end is secured)in my API of a WUM updated ESB500 pack from a rest client, I'm observing exception as follows from the Backend soap service. The Other Methods (DELETE/GET) are working fine.


<faultcode>wsse:InvalidSecurity</faultcode>
 <faultstring>Missing Timestamp</faultstring>


The resource of the API

<resource methods="POST" uri-template="/postCMedi">
      <inSequence>
         <property name="messageType" value="text/xml" scope="axis2" type="STRING"/>
         <property name="ContentType" value="text/xml" scope="axis2" type="STRING"/>
         <header name="SOAPAction" scope="transport" value="urn:postCMedi"/>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                  <soapenv:header>
                     <some value></some value>
                  </soapenv:header>
                  <soapenv:Body>
                     <ser:postCMedi xmlns:ser="http://service.sample.central.com">
                        <ser:patient>
                           <xsd:insurer xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:insurerEmail>?</xsd:insurerEmail>
                              <xsd:insurerName>?</xsd:insurerName>
                              <xsd:insurerPhone>?</xsd:insurerPhone>
                           </xsd:insurer>
                           <xsd:medical xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:condition>?</xsd:condition>
                              <xsd:treatment>?</xsd:treatment>
                           </xsd:medical>
                           <xsd:parentGuardian xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:guardianEmail>?</xsd:guardianEmail>
                              <xsd:guardianName>?</xsd:guardianName>
                              <xsd:guardianPhone>?</xsd:guardianPhone>
                           </xsd:parentGuardian>
                           <xsd:patientContact xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:address>?</xsd:address>
                              <xsd:email>?</xsd:email>
                              <xsd:phone>?</xsd:phone>
                           </xsd:patientContact>
                           <xsd:patientFullName xmlns:xsd="http://dto.service.sample.central.com/xsd">?</xsd:patientFullName>
                           <xsd:patientId xmlns:xsd="http://dto.service.sample.central.com/xsd">105665</xsd:patientId>
                           <xsd:physician xmlns:xsd="http://dto.service.sample.central.com/xsd">
                              <xsd:physicianEmail>?</xsd:physicianEmail>
                              <xsd:physicianName>?</xsd:physicianName>
                              <xsd:physicianPhone>?</xsd:physicianPhone>
                           </xsd:physician>
                        </ser:patient>
                     </ser:postCMedi>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args/>
         </payloadFactory>
         <property name="Authorization" value="Basic dGhpdnlhOnRoaXZ5YTEyMw==" scope="transport"/>
         <log level="full"/>
         <send>
            <endpoint>
               <address uri="https://192.168.55.160:9443/services/CentralPatientService" format="soap11"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
         <send/>
      </outSequence>
   </resource>


Could you please help to resolve this?



--
Thivya Mahenthirarasa
Software Engineer -Support Team | WSO2

Email: [hidden email]
Mobile: <a href="tel:+94%2076%20646%201966" value="+94766461966" target="_blank">+94766461966
Web: http://wso2.com

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Irham Iqbal
Software Engineer
WSO2


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Mushthaq Rumy
Software Engineer
Mobile : <a href="tel:%2B94%20%280%29%20773%20451194" value="+94773451194" target="_blank">+94 (0) 779 492140
Email : [hidden email]
WSO2, Inc.; http://wso2.com/
lean . enterprise . middleware.




--
Thivya Mahenthirarasa
Software Engineer -Support Team | WSO2

Email: [hidden email]
Mobile: <a href="tel:+94%2076%20646%201966" value="+94766461966" target="_blank">+94766461966
Web: http://wso2.com

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : +94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev