Friends,
I am getting the following error, while invoking "AccountCheckOut" web service
as
response = client_eap.service.AccountCheckOut(userId, accountNumber, requestSource)
suds.WebFault: Server raised fault: 'Validation: XML schema validation of SOAPBody
failed
(OPERATION=AccountCheckOut, DETAILS=XML Document has Error:cvc-complex-type.2.4.a:
Invalid content was found starting with element 'UserID'. One of
'{"urn:bearstearns.com:bsc.ais.Account:1.0":UserID}' is expected.)'
On printing my wsdl client, I see that the target service is defined as:
AccountCheckOut(xs:token UserID, xs:token AccountNumber, ns2:RequestSourceType
RequestSource, )
The AccountCheckOut.xsd defines the UserId as a ref=acct:UserId and the namespace is
defined as
xmlns:acct="urn:bearstearns.com:bsc.ais.Account:1.0" inside
AccountCheckOut.xsd
So the correct suds service request should have gone out with the following:
<ns1:Body>
<ns0:AccountCheckOut>
<UserID
xmlns="urn:bearstearns.com:bsc.ais.Account:1.0">XXXXXX</UserID>
<AccountNumber
xmlns="urn:bearstearns.com:bsc.ais.Account:1.0">55750172</AccountNumber>
<RequestSource
xmlns="urn:bearstearns.com:bsc.ais.Account:1.0">XXX</RequestSource>
</ns0:AccountCheckOut>
</ns1:Body>
But it went out with the incorrect xmlns as shown below:
<ns1:Body>
<ns0:AccountCheckOut>
<UserID
xmlns="urn:bearstearns.com:bsc.eap.AccountCheckOut:1.0">XXXXXX</UserID>
<AccountNumber
xmlns="urn:bearstearns.com:bsc.eap.AccountCheckOut:1.0">55750172</AccountNumber>
<RequestSource
xmlns="urn:bearstearns.com:bsc.eap.AccountCheckOut:1.0">XXX</RequestSource>
</ns0:AccountCheckOut>
</ns1:Body>
Please see the content of the AccountCheckOut.xsd below:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:bearstearns.com:bsc.eap.AccountCheckOut:1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:pend="urn:bearstearns.com:bsc.ais.PendingAccount:1.0"
xmlns:acct="urn:bearstearns.com:bsc.ais.Account:1.0"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import
namespace="urn:bearstearns.com:bsc.ais.Account:1.0"
schemaLocation="./ais/Account.xsd"/>
<xs:import
namespace="urn:bearstearns.com:bsc.ais.PendingAccount:1.0"
schemaLocation="./ais/PendingAccount.xsd"/>
<xs:element name="AccountCheckOut">
<xs:annotation>
<xs:documentation>Comment describing
your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element
ref="acct:UserID"/>
<xs:element
ref="acct:AccountNumber"/>
<xs:element
ref="acct:RequestSource"/>
</xs:sequence>
</xs:complexType>
</xs:element>
....
...
</xs:schema>
I want to know how can I correct this and make the xmlns =
urn:bearstearns.com:bsc.ais.Account:1.0 instead instead of
urn:bearstearns.com:bsc.eap.AccountCheckOut:1.0 in my service request
Thanks.
Sanku