Create a service in ColdFusion - web-services

I have created TestService.cfc and make this webservice with adding remote tag. location - D:\Git_Workplace\Apps\eRecruit\wwwroot
And created TestRuleAction.cfc location D:\Git_Workplace\Apps\eRecruit\jobOffice\sys\jo\core\test\plugin
In TestService.cfc
I am creating TestRuleAction.cfc object and calling method ProcessExecuteRuleActions() which is present in TestRuleAction.cfc with parameter TestExecutionID.
In TestRuleAction.cfc-
I have extended sys.jo.core.test.plugin.abstractTestPlugin that have executeProcess() method.
executeProcess() is responsible for executing rule and action.
I am passing TestExecutionID from TestService.cfc to TestRuleAction.cfc with method ProcessExecuteRuleActions(TestExecutionID).
Its coming into TestRuleAction.cfc -> ProcessExecuteRuleActions(TestExecutionID)
But when I am trying to pass TestExecutionID in
getTestFactory( ).getTestExecution( arguments.TestExecutionID )
to get testExecution object, its giving error.
I am hitting the URL from postmen
https://apracareers.localhost/testservice.cfc?method=ProcessExecuteRuleActions&TestExecutionID=924AACD4-7CC6-6D92-1112-A42A6F5C549A
Error- what I am getting-

Related

Method notesservicev1.exportNotes can not be reflected

We have consumed a third party web service and are trying to invoke it from an winform application. However when I instantiate the web service the following System.InvalidOperationException exception is thrown:
System.InvalidOperationException was unhandled
Method notesservicev1.exportNotes can not be reflected.
The XML element 'GetNotesInfoRequest' from namespace
'http://www.excelacom.com/century/cm/notes/service/webservice/request/v1'
references a method and a type.
Change the method's message name using WebMethodAttribute or change the
type's root element using the XmlRootAttribute.
I got a link:
Method 'XYZ' cannot be reflected
But I am not getting what exactly I should do ?
After checking the above link I get the solution.
GetNotesInfoRequest is used by two Web Service methods as there RequestElementName. That's why I was getting the ambiguity.
Thanks :)

Loopback 'err' Object

I am using a loopback remote method to parse data that I get from a REST endpoint . I am trying to understand the 'err' object that is passed to the callback . The second parameter is the response object - whatever I get from the response and the third is the context object - that contains the status code apart from the request object. When is the 'err' object set by loopback ? Suppose I get a non 200 code from the REST endpoint - err is still null. I check the status code from the context object and then set err on my own.
Can you provide an example of your remote method implementation?
Remote methods don't receive an error object so I'm thinking I'm not quite understanding your question and I would need a bit more information to be helpful.
Remote method strongloop docs here: https://docs.strongloop.com/display/public/LB/Remote+methods

AWS SWF - IllegalStateException: No context found. (method called outside the workflow definition)

I am writing an AWS SWF application using the flow framework. Getting an IllegalStateException: No context Found. It means that the method is called outside of the workflow definition code. while calling the following code:
private DecisionContextProvider contextProvider
= new DecisionContextProviderImpl();
private WorkflowClock clock
= contextProvider.getDecisionContext().getWorkflowClock();
Why am I getting this error and how to get rid of it?
This exception is thrown by getDecisionContext() when you call it outside of a workflow (it should only be called somewhere in the call hierarchy of your workflow implementation - ie, your WorkflowImpl ).
To avoid getting that error, you should only call getDecisionContext() while inside of a workflow or its constructor. The object only gets set in those circumstances (by the simple workflow framework), and doesn't exist outside of workflow execution, hence the IllegalStateException.

OTRS Webservice as Requestor Test

I'm new to OTRS (3.2) and also new to PERL but I have been given the task of setting up OTRS so that it will make a call to our remote webservice so a record can be created on our end when a ticket is set as "Closed".
I set up various dynamic fields so the customer service rep can fill in additional data that will be passed into the webservice call along with ticket details.
I couldn't get the webservice call to trigger when the ticket was "Closed" but I did get it to trigger when the "priority" was changed so I'm just using that now to test the webservice.
I'm just using the Test.pm and TestSimple.pm files that were included with OTRS.
When I look at the Debugger for the Webserice, I can see that the calls were being made:
$VAR1 = {
'TicketID' => '6'
};
My webservice currently just has one method "create" which just returns true for testing.
however I get the following from the Test.pm
"Got no TicketNumber (2014-09-02 09:20:42, error)"
and the following from the TestSimple.pm
"Error in SOAP call: 404 Not Found at /TARGET/SHARE/var/otrs/Kernel/GenericInterface/Transport/HTTP/SOAP.pm line 578 (2014-09-02 09:20:43, error)
I've spent countless hours on Google but couldn't find anything on this. All I could find is code for the Test.pm and TestSimple.pm but nothing really helpful to help me create a custom invoker for my needs and configure the webservice in OTRS to get it to work.
Does anyone have any sample invokers that I can look at to see how to set it up?
Basically I need to pass the ticket information along with my custom dynamic fields to my webservice. From there I can create the record on my end and do whatever processing.
I'm not sure how to setup the Invoker to pass the necessary ticket fields and dynamic fields and how to make it call a specific method in my remote webservice.
I guess getting the Test.pm and TestSimple.pm to work is the first step then I can modify those for my needs. I have not used PERL at all so any help is greatly appreciated.
I'm also struggling with similar set of requirements too. I've also never programmed in PERL, but I can tell you at least that the "Got no TicketNumber" in the Test.pm is right from the PrepareRequest method, there you can see this block of code:
# we need a TicketNumber
if ( !IsStringWithData( $Param{Data}->{TicketNumber} ) ) {
return $Self->{DebuggerObject}->Error( Summary => 'Got no TicketNumber' );
}
You should change all references to TicketNumber to TicketID, or remove the validation whatsoever (also there is mapping to ReturnedData variable).
Invoking specific methods on your WS interface is quite simple (but poorly documented). The Invoker name that you specify in the "OTRS as requester" section of web service configuration corresponds to the WS method that will be called. So if you have WS interface with a method called "create" just name the Invoker "create" too.
As far as the gathering of dynamic field goes, can't help you on that one yet, sorry.
Cheers

ldap_search function succeed.But ldap_count_entries gives Zero(0)?

i am using c++(not Vc++) for my project.
i want to access a AD using ldap functions.
it will succeed till ldap_search functions.but after that ldap_count_entries gives NULL(0).
what is the problem?
The search parameters:
base object
search scope
filter
returned no entries, or the access controls associated with the authorization state prevented any entries from being returned to the LDAP client.