Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strong-Soap appears to modify the time portion of a date in UTC format #325

Open
mgmpskywalker07 opened this issue Jul 22, 2021 · 1 comment
Labels

Comments

@mgmpskywalker07
Copy link

mgmpskywalker07 commented Jul 22, 2021

I am hoping I can ask this question without needing a sandbox because I cannot set one up.

The SOAP endpoints are proprietary and used by my company.

Here is part of the response I get back when I send a soap request from Postman:

<hc:TimeSpan>
    <hc:StartDate>2021-07-21T00:00:00</hc:StartDate>
    <hc:EndDate>2021-07-23T00:00:00</hc:EndDate>
</hc:TimeSpan>

Notice the time portion (after the 'T') are all 0's.

If I run the same request using Strong Soap and listen for the client Event 'response' (see code below), it gives me the same results as above (all '0's after the 'T').

client.on("response",(response:any)=>{
    console.log(response);

    // Prints
    //
    // <hc:TimeSpan>
    //     <hc:StartDate>2021-07-21T00:00:00</hc:StartDate>
    //     <hc:EndDate>2021-07-23T00:00:00</hc:EndDate>
    // </hc:TimeSpan>
});

However, when I use the client to call the same method as in the above two cases (see below code)

 this.soapClient.method(methodRequestBody,
      (err: string, result: MyResult, envelope: any, soapHeader: string) => {
          console.log(result);                // Print the contents (see below) after calling the SOAP method
      }, undefined, headers);

Here is the JSON I get back in 'result':

"TimeSpan": {
    "StartDate": "2021-07-21T07:00:00.000Z",
    "EndDate": "2021-07-23T07:00:00.000Z"
},

Notice that now after the 'T', instead of all '0's, the time starts at '07'.

As a result of this discrepancy, our tests are breaking and we don't just want to hard code the correct time.

I read over the strong soap documentation and do not see any configurations to setup a time zone. Other than what I have listed above, we are doing nothing to make the time portion change.

Any thoughts why strong soap seems to be changing the time when converting from XML to JSON?

@mgmpskywalker07 mgmpskywalker07 changed the title Strong-Soap appears to modify the time time portion of a date in UTC format Strong-Soap appears to modify the time portion of a date in UTC format Jul 22, 2021
@artkarki
Copy link

Same problem here. It seems that this affects to my document signature process. If I send the created xml via SoapUI then the response is valid from the third party WebService. If I send the document via strong-soap, then the response is "Invalid XML signature". I compared the created XML and client.lastRequest and only differences in those two documents are in timestamp fields.

@achrinza achrinza added the bug label Aug 25, 2021
@stale stale bot added the stale label Oct 24, 2021
@loopbackio loopbackio deleted a comment from stale bot Oct 24, 2021
@stale stale bot removed the stale label Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants