Project and Portfolio Management Practitioners Forum
cancel

Web services - create request

Highlighted
kev marks
Super Contributor.

Web services - create request

I’ve just tried creating a request from the demand management web service using the createRequest operation. I have passed in only the required fields for the request, and the web service returns the following exception:
An error occured when creating a request

One of the tokens in the validation was unparseable. This can be caused by an invalid token name or missing data from the field the token represents. (KNTA-10073)

I have checked over the data and everything looks fine. Even when passing in the exact same data from an existing request returns the exception.
14 REPLIES
Tim Brandish
Honored Contributor.

Re: Web services - create request

show us your code. it's probably just a typo.
kev marks
Super Contributor.

Re: Web services - create request






Maintenance/Repeatable

REQ.PRIORITY_NAME
High


REQ.VP.BUSINESS_UNIT
GTS


REQ.VP.DOW_APPLICATION
Mercury ITG


REQ.DESCRIPTION
Test the web service


REQ.VP.LONG_DESCRIPTION
Testing Web Services


REQ.DEPARTMENT_NAME
GTS - All


REQD.VP.TYPE_OF_WORK
Other


REQ.CREATED_BY
Admin user


REQ.REQUESTOR
Admin user


Admin user
2008-07-02T14:47:44Z
Created by a web service






Tim Brandish
Honored Contributor.

Re: Web services - create request

Reading your original post again, the exception specifically, I'm thinking that one of the fields you are trying to populate has a validation that requires one of the other fields in the request type to be populated before the validation will work. If you know which one it is of hand, you can address it, otherwise, I would start pulling out simplefields from your soap call until you don't get the error.
kev marks
Super Contributor.

Re: Web services - create request

Thanks for the suggestion.

We reordered the code so that the fields that are dependant come after the fields they are dependant on.
i.e. The Business Unit selected will generate a list of Departments. So Business Unit should come before Department in the code.

We are still encountering the same error.

We have gone through the process of pulling out all simplefields but we just run into the same exact error message.

Other info,
-the file we are using is the one we exported using web service, so I would guess it should be pretty close to what we need to create a request
-we have the generic OOTB Bug request being created, so it appears to be a problem with this specific custom request.

Thanks
Kevin
Tim Brandish
Honored Contributor.

Re: Web services - create request

I created a request type with one field (REQD.P.TEST1) that has a validation (autocomplete) that has the REQ.DEPARTMENT_NAME in the sql of the validation. I created a soap call to the web service to create the test request type. I called it once with only REQD.P.TEST1 being populated and then again with REQD.P.TEST1 and REQ.DEPARTMENT_NAME being populated. I even put REQ.DEPARTMENT_NAME after REQD.P.TEST1. The first test failed with the same error you have. The second test was successful. (See attached output for both)
kev marks
Super Contributor.

Re: Web services - create request

Tim , I understand what you are saying in your last post, however taking your suggestion we still can't get it to run correctly.

Iâ ve created a new request type, adding in one field at a time from the old request type. From process of elimination, the fields that cause the errors are all custom SQL validations (there are 3 problematic fields).

Here are the SQL validations.

select Distinct P.project_id, P.project_name, UD.DATUM9_VISIBLE, replace(UD.DATUM1_VISIBLE,'#@#', ', ')
from PM_PROJECTS P, PM_WORKPLAN_TEMPLATES WP_T, PM_WORK_PLANS WP, PM_PROJECT_TYPES PTy, WP_TASKS T, WP_USER_DATA UD
where P.project_id=PTy.project_id
AND PTy.workplan_template_id=WP_T.workplan_template_id and WP_T.WORKPLAN_TEMPLATE_NAME = 'Asset Project Template' AND wp.PROJECT_ID=P.PROJECT_ID
AND wp.IS_ACTIVE_FLAG='Y'
and (UD.DATUM8_CODE='[REQ.P.BUSINESS_UNIT]'
or UD.DATUM9_CODE = '[REQ.DEPARTMENT_CODE]')
AND WP.root_task_id = T.task_id
AND T.task_userdata_id = UD.user_data_id
and ((UPPER(project_name) like UPPER('?' || '%')
AND (project_name like upper(substr('?',1,2)) || '%'
OR project_name like lower(substr('?',1,1)) || upper(substr('?',2,1)) || '%'
OR project_name like upper(substr('?',1,1)) || lower(substr('?',2,1)) || '%'
OR project_name like lower(substr('?',1,2)) || '%')))
order by project_name


select lookup_code, meaning
from knta_lookups
where lookup_type = 'APPLICATION'
and enabled_flag = 'Y'
and UPPER(meaning) like UPPER('?%') and (meaning like upper(substr('?',1,1)) || '%' or meaning like lower(substr('?',1,1)) || '%')
and user_data2 = '[REQ.DEPARTMENT_CODE]'
order by seq


select lookup_code, meaning
from knta_lookups
where lookup_type = 'DOW - Type of Work'
and (user_data1 = '[REQ.DEPARTMENT_CODE]' or lookup_code = 'OTHER')
and enabled_flag='Y'
and ((UPPER(meaning) like UPPER('?' || '%')
AND (meaning like upper(substr('?',1,2)) || '%'
OR meaning like lower(substr('?',1,1)) || upper(substr('?',2,1)) || '%'
OR meaning like upper(substr('?',1,1)) || lower(substr('?',2,1)) || '%'
OR meaning like lower(substr('?',1,2)) || '%')))



Creating the request works when the fields are removed or their validations changed. However, it does not work with these validations, even when parameters like REQ.P.BUSINESS_UNIT and REQ.DEPARTMENT_CODE are passed in too.

Any suggestions on why this isn't working / how to get it to work with the custom fields?
Tim Brandish
Honored Contributor.

Re: Web services - create request

the next thing I would do is create that request type from the web services and ONLY send in the REQ.DEPARTMENT_CODE and see if the value is populated in your request.
kev marks
Super Contributor.

Re: Web services - create request

Doing what you said gives us the same error. Iâ ve even tried passing in more fields after to see if there was a dependency problem, but it still errors.

I do appreciate the help you've provided.

thanks for taking the time to help.
Tim Brandish
Honored Contributor.

Re: Web services - create request

if you cannot create the request only passing in the department code, then we need to look at the validation for your department code field.
kev marks
Super Contributor.

Re: Web services - create request

here is the Department Field SQL validation

select distinct dept.lookup_code dept, dept.meaning deptmeaning
from knta_security_groups grp, KNTA_USER_SECURITY usrsec, knta_lookups dept
where usrsec.user_id = '[SYS.USER_ID]'
and usrsec.security_group_id = grp.security_group_id
and grp.user_data2 = 'DEMAND_REQUESTOR'
and dept.lookup_type = 'DEPT'
and dept.lookup_code = grp.user_data1
and dept.user_data1 = '[REQ.P.BUSINESS_UNIT]'
and ((UPPER(dept.meaning) like UPPER('?' || '%')
AND (dept.meaning like upper(substr('?',1,2)) || '%'
OR dept.meaning like lower(substr('?',1,1)) || upper(substr('?',2,1)) || '%'
OR dept.meaning like upper(substr('?',1,1)) || lower(substr('?',2,1)) || '%'
OR dept.meaning like lower(substr('?',1,2)) || '%')))
order by deptmeaning
Tim Brandish
Honored Contributor.

Re: Web services - create request

Ok, so Department depends on Business Unit and the current user who is sending the createRequest. What about the Business Unit validation? What does it depend on?
kev marks
Super Contributor.

Re: Web services - create request

Here is the validation for Business Unit...

select distinct dept.user_data1 bu, dept.visible_user_data1 bumeaning
from knta_security_groups grp, KNTA_USER_SECURITY usrsec, knta_lookups dept
where usrsec.user_id = '[SYS.USER_ID]'
and usrsec.security_group_id = grp.security_group_id
and grp.user_data2 = 'DEMAND_REQUESTOR'
and dept.lookup_type = 'DEPT'


it looks at Who Created, and some userdata on the Deparment lookup
santhoshkumar
Contributor.

Re: Web services - create request

Hi Kev Marks,

I have problem creating requests through Web services. You have given SOAP message in this thread. Can you give me the instructions on how to create soap messages
and what are the prerequisites to implement web services. I have WSDL kit with me.


Thanks
Santoshkumar
jyotir_2
Valued Contributor.

Re: Web services - create request

Hi kev marks,

I would like to bring one point in focus here that when ever we use Webservice API to create/Send request we have to follow all the dependencies which exist while creating from the GUI.

So please make sure that values you are passing intokens do exist in the validation used for that field in ITG request.

Secondly the User have the access to create request.

In addtion to this if there in field dependencies in the ITG request then please try to pass the values in the same order, Some time it also casue the issue.

It should work if you are able to pass the right values as per the accepted by the PPM.

Regards,
Jyotir