HTTP POST error

Not Yet Reviewed

I get below error when i post a http request to http://dlelxv109.itg.ti.com:2010/agent .

The payload key xml version is unrecognized. Only the following payload keys are allowed: message, transactionid, mapdata.

Any idea what this means.

this comes when i use the standard example from integration document

0

Comments

16 comments
Date Votes

Please sign in to leave a comment.

  • dlelxv109 is our test integration server...

    0
  • The "agent" gateway (on port 2010 by default) expects to receive an http post or get containing information that will be formatted by the IA into an APXML message. The message parameters are each identified by a "mapdata" separator. This type of message must be preceded by a transactionid flag. Alternatively, you can post a pre-formatted APXML message to this gateway. So this explains the references to "message", mapdata", and "transactionid" payload keys in your error message.

    0
  • So for example, if you use apclient.bin to send a test message to the apclient gateway:
    apclient.bin --map-data ping bsmith "something terrible has happened, Bob" 192.168.170.168 incident_123-4567 xmatters

    ....this is how the content will appear when it is received by the integration agent:
    transactionid=1&mapdata=ping&mapdata=bsmith&mapdata=something+terrible+has+happened%2C+Bob&mapdata=192%2E168%2E170%2E168&mapdata=incident%5F123-4567&mapdata=xmatters

    0
  • If you supply the data you are posting to the IA, and information about the integration you are posting to (including the integration version) we can provide more specific help. The Integration Agent guide (https://support.xmatters.com/hc/en-us/article_attachments/202270895/xm515_integrationagent_guide.pdf) is a good resource. See the "Input APXML Interface" section for specific information about using the apclient gateway.

    0
  • Jeremy, i am trying to send a http post request to the integration gateway.

    Below is the xml code i am trying to input into the request body.
    this xml code is from the 5.1.5 document
    *----------------------------------------------
    <?xml version="1.0"?>
    <transaction id='99'>
    <header>
    <method>Add</method>
    <subclass>Event</subclass>
    </header>
    <data>
    <agent_client_id>ping</agent_client_id>
    <recipients>bsmith</recipients>
    <situation>Server down.</situation>
    <device>localhost</device>
    <incident_id>TICKET-0100-0302</incident_id>
    </data>
    </transaction>
    *------------------------------------------
    the version of integration agent is 5.1.5

    i have a http adapter which i am using to target the request body which is an xml code to http://dlelxv109.itg.ti.com:2010/agent

    when i do so i get errors in the alarmpoint.txt log file

    i have attached the log , error messages and screenshots.

    i am not using apclient.bin to do this.

    what could be wrong here..
    is there a sepearte format i need to follow to make this work

    thanks

    0
  • Sorry, i didnt know how to upload files in here..

    0
  • here is the log message

    2015-06-16 07:50:29,215 [httpConnector.receiver.68] INFO - Component APClientGateway has received the following request from endpoint http://localhost:2010/agent?transformers=HttpToAPXMLMessage&responseTransformers=UMOMessageToAPXMLMessage and source /172.24.145.35:50800: <?xml version="1.0"?>
    <transaction id='99'>
    <header>
    <method>Add</method>
    <subclass>Event</subclass>
    </header>
    <data>
    <agent_client_id>ping</agent_client_id>
    <recipients>bsmith</recipients>
    <situation>Server down.</situation>
    <device>localhost</device>
    <incident_id>TICKET-0100-0302</incident_id>
    </data>
    </transaction>
    2015-06-16 07:50:29,215 [httpConnector.receiver.68] ERROR - An exception occurred while processing the APClient submission.
    org.mule.umo.ComponentException: Failed to invoke com.alarmpoint.integrationagent.APClientGatewayImpl. Component that caused exception is: APClientGateway. Message payload is of type: byte[]
    at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:200)
    at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
    at org.mule.interceptors.InterceptorStack$Invoc.execute(InterceptorStack.java:73)
    at com.alarmpoint.integrationagent.interceptors.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:106)
    at org.mule.interceptors.InterceptorStack$Invoc.execute(InterceptorStack.java:68)
    at org.mule.interceptors.EnvelopeInterceptor.intercept(EnvelopeInterceptor.java:44)
    at org.mule.interceptors.InterceptorStack$Invoc.execute(InterceptorStack.java:68)
    at org.mule.interceptors.InterceptorStack.intercept(InterceptorStack.java:48)
    at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
    at org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:258)
    at org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:393)
    at org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:418)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.java:349)
    at org.mule.routing.inbound.InboundRouterCollection.send(InboundRouterCollection.java:197)
    at org.mule.routing.inbound.InboundRouterCollection.route(InboundRouterCollection.java:163)
    at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:581)
    at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:322)
    at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:269)
    at org.mule.providers.http.HttpMessageReceiver$HttpWorker.doGetOrPost(HttpMessageReceiver.java:248)
    at org.mule.providers.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:186)
    at org.mule.providers.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:159)
    at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
    at java.lang.Thread.run(Thread.java:744)
    Caused by: org.mule.umo.transformer.TransformerException: java.lang.IllegalArgumentException: The payload key xml version is unrecognized. Only the following payload keys are allowed: message, transactionid, mapdata. (com.alarmpoint.integrationagent.exceptions.APClientSubmissionException)
    at com.alarmpoint.integrationagent.apclient.HttpToAPXMLMessage.doTransform(HttpToAPXMLMessage.java:171)
    at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:250)
    at org.mule.impl.MuleEvent.getTransformedMessage(MuleEvent.java:342)
    at org.mule.impl.MuleEventContext.getTransformedMessage(MuleEventContext.java:93)
    at org.mule.impl.model.resolvers.DynamicEntryPoint.invoke(DynamicEntryPoint.java:179)
    at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:194)
    ... 24 more
    Caused by: com.alarmpoint.integrationagent.exceptions.APClientSubmissionException: java.lang.IllegalArgumentException: The payload key xml version is unrecognized. Only the following payload keys are allowed: message, transactionid, mapdata.
    at com.alarmpoint.integrationagent.apclient.HttpToAPXMLMessage.parseSubmission(HttpToAPXMLMessage.java:246)
    at com.alarmpoint.integrationagent.apclient.HttpToAPXMLMessage.doTransform(HttpToAPXMLMessage.java:152)
    ... 29 more
    Caused by: java.lang.IllegalArgumentException: The payload key xml version is unrecognized. Only the following payload keys are allowed: message, transactionid, mapdata.
    at com.alarmpoint.integrationagent.apclient.HttpToAPXMLMessage.verifyKeys(HttpToAPXMLMessage.java:262)
    at com.alarmpoint.integrationagent.apclient.HttpToAPXMLMessage.parseSubmission(HttpToAPXMLMessage.java:240)
    ... 30 more
    2015-06-16 07:51:59,328 [httpConnector.receiver.69] INFO - Component APClientGateway has received the following request from endpoint http://localhost:2010/agent?transformers=HttpToAPXMLMessage&responseTransformers=UMOMessageToAPXMLMessage and source /172.24.145.35:50806: <?xml version="1.0"?>
    <transaction id='99'>
    <message>
    <data>
    <agent_client_id>ping</agent_client_id>
    <recipients>bsmith</recipients>
    <situation>Server down.</situation>
    <device>localhost</device>
    <incident_id>TICKET-0100-0302</incident_id>
    </data>
    </message>
    </transaction>

    0
  • Thanks for providing the additional details. The cause of this problem is, the IA's apclient gateway is expecting either a) a text-only message that is formatted using "mapdata" separators, or b) an encoded message preceded by the "message=" key.

    Using the info from the Integration Agent document I successfully used the map-data key to send an html post to the ping integration via curl.exe:
    curl.exe -X POST -d "transactionid=99&mapdata=ping&mapdata=bsmith&mapdata=Server+down%2E&mapdata=localhost&mapdata=TICKET-0100-0302" http://127.0.0.1:2010/agent

    I wasn't able to use curl to send the example data from the Integration Agent using the other method (the "message" key.) I'll work with the engineering team and the documentation team to have this information corrected.

    0
  • Jeremy, thanks.

    yes, i was able to see that the below works fine
    http://localhost:2010/agent?transactionid=99
    &mapdata=ping
    &mapdata=bsmith
    &mapdata=Server+down%2E
    &mapdata=localhost
    &mapdata=TICKET-0100-0302

    but , http post to integration agent was not working...

    0
  • I found a typo in the integration document which prevented http get / post using the "message" key.

    .
    In the document, there is an extra "%", so
    %3Eping%%3C%2Fagent%5F
    should be
    %3Eping%3C%2Fagent%5F
    .
    I'll get this fixed for the next release of the IA document.
    .
    Once this was corrected, I was able to use the Wiztools RESTClient to send the following message, using the GET and the POST methods:
    http://10.2.0.121:2010/agent?message=%3C%3Fxml+version%3D%271%2E0%27%3F%3E%3Ctransaction+id%3D%2799%27%3E%3Cheader%3E%3Cmethod%3EAdd%3C%2Fmethod%3E%3Csubclass%3EEvent%3C%2Fsubclass%3E%3C%2Fheader%3E%3Cdata%3E%3Cagent%5Fclient%5Fid%3Eping%3C%2Fagent%5Fclient%5Fid%3E%3Crecipients%3Ebsmith%3C%2Frecipients%3E%3Csituation%3EServer+down%2E%3C%2Fsituation%3E%3Cdevice%3Elocalhost%3C%2Fdevice%3E%3Cincident%5Fid%3ETICKET-0100-0302%3C%2Fincident%5Fid%3E%3C%2Fdata%3E%3C%2Ftransaction%3E

    0
  • Jeremy, Excellent. I removed the extra % and was able to send the message from the http tool. i could see it showing up on reports.

    i had one question on this.

    instead of using the %3E codes , i usually use the XML code to dump in the request body.
    will xml code in request body work ? or it has to be in %3E format's.
    Should xml code be converted to %3E formats ?

    xml code from the 5.1.5 document. - This does not work
    <?xml version="1.0"?>
    <transaction id='99'>
    <header>
    <method>Add</method>
    <subclass>Event</subclass>
    </header>
    <data>
    <agent_client_id>ping</agent_client_id>
    <recipients>bsmith</recipients>
    <situation>Server down.</situation>
    <device>localhost</device>
    <incident_id>TICKET-0100-0302</incident_id>
    </data>
    </transaction>

    %3D codes from 5.1.5 document - This works
    http://localhost:2010/agent?message=%3C%3Fxml+version%3D%271%2E0%27%3F%3E
    %3Ctransaction+id%3D%2799%27%3E
    %3Cheader%3E
    %3Cmethod%3EAdd%3C%2Fmethod%3E
    %3Csubclass%3EEvent%3C%2Fsubclass%3E
    %3C%2Fheader%3E
    %3Cdata%3E
    %3Cagent%5Fclient%5Fid%3Eping%%3C%2Fagent%5Fclient%5Fid%3E
    %3Crecipients%3Ebsmith%3C%2Frecipients%3E
    %3Csituation%3EServer+down%2E%3C%2Fsituation%3E
    %3Cdevice%3Elocalhost%3C%2Fdevice%3E
    %3Cincident%5Fid%3ETICKET-0100-0302%3C%2Fincident%5Fid%3E
    %3C%2Fdata%3E
    %3C%2Ftransaction%3E

    0
  • John, glad it is working for you.
    .
    Yes, it's correct that submissions using the "message" key must have non-alphanumeric characters encoded in the "%nn" format.

    0
  • Jermey, ok understood. So to confirm, these are the only 2 ways of submissions i can use , correct..

    0
  • i mean, message and mapdata

    0
  • Hi John,
    Yes, that's correct: according to the IA document,
    "A single HTTP GET/POST is allowed to use only one of the submission modes (message or mapped data)"
    .
    The /http endpoint (on port 8081) gives more freedom, if you are wanting to use http posts to submit messages to the IA. For an example of how integrations use the /http endpoint, you could download the HP OMi integration or the BMC Remedy integration.

    0
  • Jeremey, Understood, thank you .

    john.

    0

Didn't find what you were looking for?

New post