Error code in Datapower - xslt

I'm using MPGW service which will hit the CICS service and return back the response.
This is my flow. UI --> DP MPGW gateway --> MPGW Service --> CICS service.
In case of "No data Found" response from CICS, I just want to set the error code as 100 and message as "No data found" and pass on to UI. But everytime datapower is return 500 Internal server error to UI.
I'm using errorHandler.xslt to check the fault code from CICS and setting the error code and error message.
Is there something I need to change the dp:response-header('x-dp-response-code')? If so how to do this?
Note: Process Backend error : 'On' in both the MPGW(gateway and service).

Try this:
If a response contains 500 not found error. Do a dp:reject at the response rule.This will take control to error rule. At error rule, configure an xslt and set below values:
<dp:set-variable name="'var://service/error-protocol-response'" value="'100'" />
<dp:set-variable name="'var://service/error-protocol-reason-phrase'" value="'No Data Found'" />

As per https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014432297 you want:
Within an Error Rule:
Within a Response Rule:
That should do the trick for an MPGW I believe.

Related

Media Tailor ad returning 504 error in AWS

I'm using AWS Media Tailor to test an ad inserting demo. The demo page is this one: https://github.com/aws-samples/aws-media-services-simple-vod-workflow/tree/master/12-AdMarkerInsertion.
When I place my manifest into a TheoPlayer I always get an 504 error. My manifes page is: https://ebf348c58b834d189af82777f4f742a6.mediatailor.us-west-2.amazonaws.com/v1/master/3c879a81c14534e13d0b39aac4479d6d57e7c462/MyTestCampaign/llama.m3u8.
I have also tried with: https://ebf348c58b834d189af82777f4f742a6.mediatailor.us-west-2.amazonaws.com/v1/master/3c879a81c14534e13d0b39aac4479d6d57e7c462/MyTestCampaign/llama_with_slates.m3u8.
The specific error is:
{"message":"failed to generate manifest: Unable to obtain template playlist. sessionId:[c915d529-3527-4e37-89e0-087e393e75de]"}
I have read about this error: https://docs.aws.amazon.com/mediatailor/latest/ug/playback-errors-examples.html
But don't know how to fix it.
Maybe I did something wrong or do I need a quote in AWS?
Any idea?
Thanks for the inquiry!
The following example shows the result when a timeout occurs between AWS Elemental MediaTailor and either the ad decision server (ADS) or the origin server.
An HTTP 504 error is known as a Gateway Timeout meaning that a resource was unresponsive and prevented the request from completing successfully. In this case since MediaTailor is returning an HTTP 504 this means that either the ADS or Origin failed to respond within the timeout period.
To troubleshoot this you will need to determine which dependency is failing to respond to MediaTailor and correct it. Typically the issue is the ADS failing to respond to a VAST request performed by MediaTailor which you can confirm by reviewing your CloudWatch logs.
https://docs.aws.amazon.com/mediatailor/latest/ug/monitor-cloudwatch-ads-logs.html
Make sure that your ADS follows the guidelines listed below for integrating with MediaTailor.
https://docs.aws.amazon.com/mediatailor/latest/ug/vast-integration.html

catching Talend error in web Application

I have created a Talend job and deployed it as a Axis Web Service.
I am calling this Web Service from my Web Application.
My application and web service are deployed over Tomcat server.
For Valid Inputs:
Runs Perfectly.
For Invalid Inputs:
It throws Error/exceptions in Tomcat Server.
I want this Errors into my application. I didn't get any error related information in the Response sent by web service.
Error message on Tomcat Server
XML response of Web service
If I understand your question you are not so much asking how to fix this error, but how to get feedback about your error. There are several ways but here is a simple method.
Add a tLogCatcher to your job, and point its output to a tSendMail component. You can run the output thru a tMap do things like adding HTML formatting. You can also create a joblet with these two components and use the joblet in every job so you do not have to recreate it every time.
The diagram below shows a real simple case where I add tLogCatcher and tSendMail directly to the job. When there is an error it will send me an email with the details. You can use any of the columns in row11, I am only using job and message in my example.
This error : For input string "fabrik"
is generated by the tFileInputExcel component when encountering a non valid field (expected : integer ; given : string). You can't directly catch this error with the tFileInputExcel component (it's just printed out on the console).
However, you can use a tSchemaComplianceCheck component after your tFileInputExcelComponent : it will throw an error if a data is not valid for your schema. This component has a reject link to catch the error.
tFileInputExcel->tSchemaComplianceCheck->tMap->tMSOutput
If you use tLogCatcher component to catch the error then, at the end of the flow, you can add a tBufferOutput component. Keep the fields with the information you want for.
component configuration
The result will be like this (note that they are shown in the same order):
result

Mapping Lambda output in API Gateway gives server error

I have an AWS API Gateway setup, served by a Python Lambda function. For successful responses the Lambda returns a response of the form:
"200:{\"somekey\": \"somevalue\"}"
By default, the Integration Response settings in the gateway console have just one rule configured with a Lambda Error Regex of .* mapping to a response status of 200. This works fine.
The problem is when I try to change that to 200.* (with a view to enabling more specific codes going forward). Now I get a
{"message": "Internal server error"}
every time I hit the gateway with any request (resulting in a 200 or not).
No error logs are written to CloudWatch.
I want to know how I can map Lambda outputs to HTTP status codes successfully in AWS API Gateway.
If you do a test run in API gateway, the test run log should show an error similar to:
Sat Nov 21 07:41:25 UTC 2015 : Execution failed due to configuration
error: No match for output mapping and no default output mapping
configured
The problem is there is no-longer a default mapping to catch a successful response. The intention of the error regex is to catch errors and map them to status codes. The error regex searches the errorMessage property of the failed json response. If you were to set the status code 400 to be the default (blank) - you would find your successful response always mapping to a status code of 400.
You'll be best off to leave 200 as a default (blank) regex. Then set specific regex values to check for your different error messages. For example, you can have multiple specific error regex status codes and a generic catch-all to result in 500's.
For those who tried everything put on this question and couldn't make this work (like me), check the thedevkit comment on this post (saved my day):
https://forums.aws.amazon.com/thread.jspa?threadID=192918
Reproducing it entirely below:
I've had issues with this myself, and I believe that the newline
characters are the culprit.
foo.* will match occurrences of "foo" followed by any characters
EXCEPT newline. Typically this is solved by adding the '/s' flag, i.e.
"foo.*/s", but the Lambda error regex doesn't seem to respect this.
As an alternative you can use something like: foo(.|\n)*

Mule 3.7 - CFX error consuming Web Service Consumer

I am consuming the webservice https://www.uat.p20.experian.nl/WS_SDPGateway/sdpgateway.asmx?wsdl.
I am getting an error:
ERROR
ERROR 2015-09-21 23:08:04,789 [[experian_spd_sandbox].HTTP_8044.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy:
Message : COULD_NOT_READ_XML_STREAM. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: byte[]
Type : org.mule.api.transport.DispatchException
Code : MULE_ERROR--2
Payload : [B#df32cd7
JavaDoc :
Exception stack is:
Unexpected character '>' (code 62) expected '='
at [row,col {unknown-source}]: [7,21] (com.ctc.wstx.exc.WstxUnexpectedCharException)
com.ctc.wstx.sr.StreamScanner:647 (null)
COULD_NOT_READ_XML_STREAM (org.apache.cxf.interceptor.Fault)
org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter:151 (null)
COULD_NOT_READ_XML_STREAM. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: byte[] (org.mule.api.transport.DispatchException)
org.mule.module.cxf.CxfOutboundMessageProcessor:163
My goal is just to fix the communication and ensure the webservice can be consumed properly from Mule.
"Failed to route event via endpoint" sounds more like a network then a parse error.
Can you try to curl the wsdl from the box that is executing the Mule flow?
Found it:
Afterall it was a mistake in the XML message itself. In addition I had to remove the metadata I had added during trouble shooting. So in case you run into the same just go back to basic and first validate the XML message ;-)
Thanks all for getting me there.

Error while testing BPEL project

Running Netbeans 6.5.1 with OpenESB (Glassfish-full-installer-windows2.1).
I'm using this tutorial (http://www.youtube.com/watch?v=a76RxkzB4Bg) as reference to orchestrate web services by calling a local WSDL that invokes an external WSDL (http://www.webservicex.net/CreditCard.asmx?WSDL). I have my BPEL ready
and my Composite Application created, it automatically binds a SOAP call from my local WSDL to the BPEL (Consumer to Producer), I had to drag and drop another SOAP object and configure it with the same interface as my local WSDL to receive the output from the invoke action (is that correct?).
When I run my test case selecting the operation from my local WSDL, I get the following SoapResponse:
<SOAP-ENV:Fault>
<faultcode xmlns="">SOAP-ENV:Server</faultcode>
<faultstring xmlns="">BPCOR-6135: A fault was not handled in the process scope; Fault Name is {http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling}systemFault; Fault Data is &a....Sending errors for the pending requests in the process scope before terminating the process instance</faultstring>
<faultactor xmlns="">sun-bpel-engine</faultactor>
<detail xmlns="">
<detailText>BPCOR-6135: A fault was not handled in the process scope; Fault Name is {http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling}systemFault; Fault Data is &a... Sending errors for the pending requests in the process scope before terminating the process instance
Caused by: BPCOR-6131: An Error status was received while doing an invoke (partnerLink=externalBPELImplementation, portType={http://www.webservicex.net}CCCheckerSoap, operation=ValidateCardNumber)
BPCOR-6129: Line Number is 37
BPCOR-6130: Activity Name is Invoke1
Caused by: HTTP Status-Code 404: Not Found - Not Found</detailText>
</detail>
I've created a separated project to test the external WSDL and it is validating credit card numbers as expected, there's something wrong with my BPEL or my Composite Application.
If I create another test case and select the local port that is created when I drag and drop the Soap object into the Comp. App. Design interface, I get a different error:
Dec 24, 2012 12:54:11 AM com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection call
SEVERE: SAAJ0006: Bad URL (endPoint instance of String)
java.net.MalformedURLException: no protocol:
any ideas?
Your process seams to be correct (at the first look).
It looks like your process can't find the service you ask:
BPCOR-6130: Activity Name is Invoke1 - Caused by: HTTP Status-Code 404: Not Found - Not Found
Is your "soap adress" in the wsdl you imported correct ?
Have you try to overload the url in the bpel mapping ? (Properties -> SOAP HTTP BC -> Outbound -> UR)
There is also something strnage in your CASA: If you are trying to consume "localCreditCard_WSDLPort" and expose in OpenESB "casaPort1", the SOAP Binding are inversed. The arrow should start from casaPort1 and finish at localCreditCard_WSDLPort.
I hope this could help you,
Simon
According to #brasseld from www.open-esb.net
In fact, you've made two mistake :
The first one, for your unit test, you have to use the good WSDL which come from the BPEL because you've created a concrete SOAP WSDL
(CreditCard_WSDL.wsdl).
Then, when you create a new port in your composite application for your plnk externalServiceCard_WSDL, you have to set the soap address
location by right-click > properties. By default, this one is set to
localhost:${HttpDefaultPort}/compositeapp/casaportX?wsdl that's why
you encounter your errors (404 or bad url error).
Based on his suggestions, I've decided to document the development process step-by-step, here's the result:
http://www.youtube.com/watch?v=-1W1xR3-iJQ