Skip to content

Fix fault throwing#752

Closed
SEAPUNK wants to merge 1 commit into
vpulim:masterfrom
SEAPUNK:master
Closed

Fix fault throwing#752
SEAPUNK wants to merge 1 commit into
vpulim:masterfrom
SEAPUNK:master

Conversation

@SEAPUNK

@SEAPUNK SEAPUNK commented Oct 16, 2015

Copy link
Copy Markdown

This fixes #744

SOAP response is in #744 - I am experiencing the same issue with a different SOAP API (stamps.com SOAP API)

@herom

herom commented Oct 19, 2015

Copy link
Copy Markdown
Contributor

Thanks a lot for your contribution @SEAPUNK - we appreciate it a lot 👍

Please, in order to get your PR merged, follow our Guidelines on Submitting a Pull Request (see also the tags of this PR).

@SEAPUNK

SEAPUNK commented Oct 19, 2015

Copy link
Copy Markdown
Author

Agh, I'm having one hell of a time rebasing; this might take a bit.

@SEAPUNK SEAPUNK closed this Oct 19, 2015
and fix the travis tests by using the fix only as a fallback
@SEAPUNK SEAPUNK reopened this Oct 19, 2015
@SEAPUNK

SEAPUNK commented Oct 19, 2015

Copy link
Copy Markdown
Author

There we go; does this work?

@jsdevel

jsdevel commented Oct 19, 2015

Copy link
Copy Markdown
Collaborator

the rebase looks good. We need some request/response samples though in order to merge.

@SEAPUNK

SEAPUNK commented Oct 19, 2015

Copy link
Copy Markdown
Author

I cannot provide a request (as it includes sensitive data), but I do have a response (as well as a response shown in #744), although I need some time to dig that up as well.

@jsdevel

jsdevel commented Oct 19, 2015

Copy link
Copy Markdown
Collaborator

you can rename endpoints etc. so it isn't sensitive.

@SEAPUNK

SEAPUNK commented Oct 19, 2015

Copy link
Copy Markdown
Author

Request (stripped of sensitive data):

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:tns="http://stamps.com/xml/namespace/2015/01/swsim/swsimv42" xmlns:s1="http://microsoft.com/wsdl/types/">
    <soap:Body>
        <GetRates xmlns="http://stamps.com/xml/namespace/2015/01/swsim/swsimv42">
            <Credentials>
                <IntegrationID>xxxxxxxxxxxxxxxxxxxxxxxx</IntegrationID>
                <Username>xxxxxxxxxxxxxxxxxxxxxxx</Username>
                <Password>xxxxxxxxxxxxxxxxxxx</Password>
            </Credentials>
            <Rate>
                <FromZIPCode>xxxxx</FromZIPCode>
                <ToZIPCode>xxxxx</ToZIPCode>
                <ServiceType>xxxxx</ServiceType>
                <WeightLb>1000000.00</WeightLb>
                <PackageType>Package</PackageType>
                <Length>100000000000.00</Length>
                <Width>100000000000000.00</Width>
                <Height>1000000000000000.00</Height>
                <ShipDate>2015-10-20</ShipDate>
            </Rate>
        </GetRates>
    </soap:Body>
</soap:Envelope>

Response:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>Invalid SOAP message due to XML Schema validation failure. The 'http://stamps.com/xml/namespace/2015/01/swsim/swsimv42:Length' element is invalid - The value '100000000000.00' is invalid according to its datatype 'http://stamps.com/xml/namespace/2015/01/swsim/swsimv42:double-le-999' - The MaxInclusive constraint failed.</faultstring>
            <faultactor>http://swsim.stamps.com/swsim/swsimv42.asmx</faultactor>
            <detail>
                <stamps_exception code="00490102" xmlns="http://stamps.com/xml/namespace/2008/02/stamps/fault" />
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

throws an error:

Error: undefined: undefined

@jsdevel

jsdevel commented Oct 19, 2015

Copy link
Copy Markdown
Collaborator

Please include it in the commit.

@SEAPUNK

SEAPUNK commented Oct 19, 2015

Copy link
Copy Markdown
Author

As a test in test/client-test.js?

@jsdevel

jsdevel commented Oct 19, 2015

Copy link
Copy Markdown
Collaborator

test/request-response-samples.

@evantahler

Copy link
Copy Markdown
Contributor

Great catch! I'm having the same errors even when generating a Fault with this library, ie:

Fault: {
          faultcode: "soap:Client.BadArguments",
          faultstring: String(message.error)
        }

=> Error: undefined: undefined

@jguepin

jguepin commented Oct 30, 2015

Copy link
Copy Markdown

👍

@SEAPUNK

SEAPUNK commented Oct 30, 2015

Copy link
Copy Markdown
Author

I don't think I'll be able to create the test, but anyone is free to continue where I left off.

@SEAPUNK

SEAPUNK commented Nov 3, 2015

Copy link
Copy Markdown
Author

Closed since #771 is merged

@SEAPUNK SEAPUNK closed this Nov 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants