Web Service returning definition of response with initial value set - sql

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 response.
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

Related

How to validate part of message in WSOESB and choose first?

Here is how it works.
I do have dss service that returns message of format
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dss="https://rmis33.r-mis.ru/services/dss">
<soapenv:Header/>
<soapenv:Body>
<dss:Requests>
<dss:Request>...</dss:Request>
<dss:Request>...</dss:Request>
<dss:Request>...</dss:Request>
....
<dss:Request>...</dss:Request>
</dss:Requests>
</soapenv:Body>
</soapenv:Envelope>
I have to split message on Request element and validate it, then choose first that pass validation over XSD.
It is hard to do on database level because it has a lot of elements(sub-elements) and XSD was already provided.
You can use validate mediator to validate XML messages against XML schema.There is a complete sample which demonstrates validating messages.

SQL Query pulling extra data

I am using this query in SOAPUI against our SOAP API.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:del="http://tempuri.org/Deltek.Vision.WebServiceAPI.Server/DeltekVisionOpenAPIWebService">
<soapenv:Header/>
<soapenv:Body>
<del:GetProjectsByQuery>
<!--Optional:-->
<del:ConnInfoXML><![CDATA[<VisionConnInfo>
<databaseDescription>Description</databaseDescription>
<userName>USERNAME</userName>
<userPassword>PASSWORD</userPassword>
<integratedSecurity>Y</integratedSecurity>
</VisionConnInfo>]]></del:ConnInfoXML>
<!--Optional:-->
<del:Query>SELECT WBS1,Name,Principal FROM PR WHERE PR.WBS1='H15032.00'</del:Query>
<!--Optional:-->
<del:RecordDetail>'Project'</del:RecordDetail>
</del:GetProjectsByQuery>
</soapenv:Body>
</soapenv:Envelope>
The request goes through and gives me a response, however it gives me additional fields also. I just want to pull the column specified in query itself like WBS1, Name, and Principal fields only.
<WBS1>H15032.00</WBS1>
<Name>Name</Name>
<Principal>Principal Name</Principal>
<custLetterofIntent>Y</custLetterofIntent>
<custIssued>2015-06-03T00:00:00.000</c‌​ustIssued>
<CreateUser>KGOODENOW</CreateUser>
<CreateDate>2015-06-03T15:51:20.913</‌​CreateDate>
<ModUser>KGOODENOW</ModUser>
<ModDate>2015-06-03T15:52:29.227</ModDate>‌​
<CustContractStatus>LOI</CustContractStatus>
</ROW>
</Projects_ConsultantAgreements‌​>
</REC>
</RECS>]]>
</GetProjectsByQueryResult>
Am I missing something?

Error registering Yodlee user, can't getWrappedExceptions

I'm getting the following error (see Response) while attempting to register a user. The code was working fine before but it seems something changed.
Request:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:ns3="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://userregistration.usermanagement.core.soap.yodlee.com"
xmlns:ns1="http://common.soap.yodlee.com"
xmlns:ns2="http://login.ext.soap.yodlee.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns3:Body>
<ns0:register3>
<cobrandContext xsi:type="ns1:CobrandContext">
<cobrandId>8910005960</cobrandId>
<channelId>-1</channelId>
<locale>
<country>US</country>
<language>en</language>
</locale>
<tncVersion>2</tncVersion>
<applicationId>58EEA306454D869DFF721D0D00B82D00</applicationId>
<cobrandConversationCredentials xsi:type="ns2:SessionCredentials">
<sessionToken>05292013_0:718a0b8d870c13b5be2d2fb14bfd53b3796c5c97b401d68d34fe4594fdefeab3a3e5d6d8ee14696a6e03f53f0da613b781f1be0c8c06e70b883bb9abe232ba9f</sessionToken>
</cobrandConversationCredentials>
<preferenceInfo>
<currencyCode>USD</currencyCode>
<timeZone>PST</timeZone>
<dateFormat>MM/dd/yyyy</dateFormat>
<currencyNotationType>SYMBOL_NOTATION</currencyNotationType>
<numberFormat>
<decimalSeparator>.</decimalSeparator>
<groupingSeparator>,</groupingSeparator>
<groupPattern>###,##0.##</groupPattern>
</numberFormat>
</preferenceInfo>
<currencyCode>USD</currencyCode>
<timeZone>PST</timeZone>
<dateFormat>MM/dd/yyyy</dateFormat>
<currencyNotationType>SYMBOL_NOTATION</currencyNotationType>
<numberFormat>
<decimalSeparator>.</decimalSeparator>
<groupingSeparator>,</groupingSeparator>
<groupPattern>###,##0.##</groupPattern>
</numberFormat>
</preferenceInfo>
<fetchAllLocaleData>false</fetchAllLocaleData>
</cobrandContext>
<userCredentials xsi:type="ns2:PasswordCredentials">
<loginName>someyodleeuser#somedomain.com</loginName>
<password>yodleepasswordtest</password>
</userCredentials>
<userProfile>
<values>
<table>
<key xsi:type="xsd:string">EMAIL_ADDRESS</key>
<value xsi:type="xsd:string">someyodleeuser#somedomain.com</value>
</table>
</values>
</userProfile>
</ns0:register3>
</ns3:Body>
</SOAP-ENV:Envelope>
Response:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>IllegalArgumentValueExceptionFaultMessage</faultstring>
<detail>
<ns4:IllegalArgumentValueExceptionFault xmlns:ns4="http://core.soap.yodlee.com">
<faultText>com.yodlee.core.IllegalArgumentValueException: Multiple exceptions encapsulated within: invoke getWrappedExceptions for details</faultText>
</ns4:IllegalArgumentValueExceptionFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Problem is, I'm not getting back any details on the exception to debug the issue (Even when doing as suggested).
Your password is not in the right format and hence you are getting this error.
Below are the restrictions on username and password which you should follow -
UserName
>= 3 characters <= 150 characters
pNo Whitespace
No Control Characters
Contains at least one Letter
Password
>= 6 characters
<= 50 characters
No Whitespace
No Control Characters
Contains at least one Number
Contains at least one Letter
Does not contain the same letter/number three or more times in a row. (e.g. aaa123 would fail for three \"a\"'s in a row, but a1a2a3 would pass)"); Does not equal username

Inuit TimeActivity Create: The request sent by the client was syntactically incorrect

I am trying to test my ability to import TimeActivity records and even when using the sample Create Request XML for TimeActivity I get an error:
Apache Tomcat/7.0.23 - Error report HTTP Status 400 - type Status reportmessage description The request sent by the client was syntactically incorrect ().Apache Tomcat/7.0.23
below is my sample xml create request (pulled from https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/timeactivity)
<?xml version="1.0" encoding="utf-8"?>
<TimeActivity xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2">
<TxnDate>2011-08-03-07:00</TxnDate>
<NameOf>Vendor</NameOf>
<Vendor>
<VendorIdidDomain="QBO">3793</VendorId>
</Vendor>
<CustomerId>3794</CustomerId>
<ItemId>3</ItemId>
<ClassId>1</ClassId>
<StartTime>2011-08-30T11:45:00-07:00</StartTime>
<EndTime>2011-08-30T13:15:00-07:00</EndTime>
<Taxable>true</Taxable>
<HourlyRate>10.5</HourlyRate>
<BillableStatus>Billable</BillableStatus>
<Hours>10</Hours>
<Minutes>5</Minutes>
<Description>This is a Description</Description>
</TimeActivity>
What am I doing wrong here?
Sharing a sample TimeActivity create request. Please check other reference attributes like Vendor, Class etc. It should work.
<?xml version="1.0" encoding="utf-8"?>
<TimeActivity xmlns='http://www.intuit.com/sb/cdm/v2'>
<TxnDate>2012-08-30-07:00</TxnDate>
<NameOf>Employee</NameOf>
<Employee>
<EmployeeId>11</EmployeeId>
</Employee>
<CustomerId>2</CustomerId>
<JobId>4</JobId>
<BillableStatus>Billable</BillableStatus>
<HourlyRate>50.0</HourlyRate>
<StartTime>2012-08-30T11:45:00-07:00</StartTime>
<EndTime>2012-08-30T13:15:00-07:00</EndTime>
<Description/>
</TimeActivity>
There should be couple of small changes in the sample request ( We will update the doc )
<?xml version="1.0" encoding="utf-8"?>
<TimeActivity xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2">
<NameOf>Vendor</NameOf>
<Vendor>
<VendorId idDomain="QBO">5</VendorId>
</Vendor>
<CustomerId>2</CustomerId>
<ItemId>3</ItemId>
<Taxable>true</Taxable>
<HourlyRate>10.5</HourlyRate>
<BillableStatus>Billable</BillableStatus>
<Hours>10</Hours>
<Minutes>5</Minutes>
<Description>This is a Description</Description>
</TimeActivity>
First replace all the reference values with the same of your test data.
For ex - VendorId, Class, Item and Customer
There are two bugs in the sample request.
1. There should be a space between 'VendorId' and 'idDomain' ( Ref -5th line of the req )
2. According to the doc, " Either method of indicating duration can be entered, but not both. Hours/Minutes OR StartTime/EndTime is required."
So plz remove any one of these. ( I've removed StartTime/EndTime )
Otherwise you'll get the error which you have mentioned above.
That is - Response code 400, Error msg - TIME_ACTIVITY_MULTIPLE_DURATION_TYPES_PRESENT
Please let us know if the above changes work for you.
I tried the same XML in Api Explorer. It worked fine for me. PFB snapshot. Please check if you are facing any encoding issue.
Please let me know if it works for you.

eBay API: GetOrders call returning no orders

I have placed test orders in the sandbox eBay account.
I am not able to get the orders listing from the GetOrders API call.
It retruns the success message but no orders are fetched.
Below are the API call details :
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns="urn:ebay:apis:eBLBaseComponents" ><soap:Header><RequesterCredentials><eBayAuthToken>...</eBayAuthToken><Credentials><AppId>Clarion89-2b36-4da6-b073-00dafbcff12</AppId><DevId>f79169c1-f95b-4d23-9fe2-547504ffb827</DevId><AuthCert>...</AuthCert></Credentials></RequesterCredentials></soap:Header><soap:Body><GetOrdersRequest><DetailLevel>ReturnAll</DetailLevel><Version>527</Version><CreateTimeFrom>2012-04-02T09:52:27.000Z</CreateTimeFrom><CreateTimeTo>2012-05-03T09:52:27.000Z</CreateTimeTo><OrderRole>Seller</OrderRole><OrderStatus>Active</OrderStatus><ListingType>FixedPriceItem</ListingType></GetOrdersRequest></soap:Body></soap:Envelope>
Response returned as below
<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>
<GetOrdersResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2012-05-03T09:54:03.650Z</Timestamp>
<Ack>Success</Ack>
<Version>771</Version>
<Build>E771_CORE_BUNDLED_14795207_R1</Build>
<PaginationResult>
<TotalNumberOfPages>0</TotalNumberOfPages>
<TotalNumberOfEntries>0</TotalNumberOfEntries>
</PaginationResult>
<HasMoreOrders>false</HasMoreOrders>
<OrderArray/>
<OrdersPerPage>100</OrdersPerPage>
<PageNumber>1</PageNumber>
<ReturnedOrderCountActual>0</ReturnedOrderCountActual>
</GetOrdersResponse>
</soapenv:Body>
</soapenv:Envelope>
Please tell me why i am not getting order details
first of all i would use an higher version (i'm actually using 771 as compatibility level)
I used to have a similar problem at the very benning when i started coded for api, then i switched CreatedTime filter to NumberOfDays wich are the days to look back from today.
What language are you using to make the call?
Check your request parameters against your orders that are stored on ebay. It may happen that there are no orders matching the parameters you are entering in your call. Try entering the most basic request parameters like
<?xml version="1.0" encoding="utf-8"?>
<GetOrdersRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>[your authentication token]</eBayAuthToken>
</RequesterCredentials>
<CreateTimeFrom>2012-05-10T00:00:00.000Z</CreateTimeFrom>
<CreateTimeTo>2012-05-15T00:00:00.000Z</CreateTimeTo>
</GetOrdersRequest>
You can enter the dates as per your requirement but make sure you use the date format accepted by ebay.