So I have a simple webservice that has an input of a userid and gets a flag from a sql database (initially set to '1').
However, when I query a user with the default value of the flag (which I set to 1 in SQL Server), I get the following response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<result xsi:type="ns1:getPWFlagResponse" xsi:nil="1" xmlns:ns1="<NamespaceURL>"/>
</soapenv:Body>
</soapenv:Envelope>
However, if I change the value of the flag, I Get the correct response for all other requests:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<result>
<result>1</result>
</result>
</soapenv:Body>
</soapenv:Envelope>
(Same for result of 0 ).
I thought that it could be that I didn't initialize something at first, however if I don't set an initial value on the PWResetFlag column in the table the webService comes back with the correct resp开发者_C百科onse.
Is this something with SQL server and setting default values or something on my end?
Thanks
Just wanted to update the question in case anyone else has had similar problems, but I have found the root source of my problem. I was using TOAD for sql server to do my table alterations, but when I went on to the actual server and into the database, the flag was set to NULL as a default value despite me altering it to not accept nulls and applying a default value of 1.
I did the alterations directly in SQL Server on the machine which correctly applied the default value and now my webservice is working perfectly!
Thanks
精彩评论