Topic
5 replies Latest Post - ‏2012-11-14T19:39:16Z by swlinn
SystemAdmin
SystemAdmin
6772 Posts
ACCEPTED ANSWER

Pinned topic How to send a test message through the probe for SFTP FHS on MPG?

‏2012-11-13T17:05:10Z |
I have an MPG with an SFTP poller FSH. We need to force a test of a non xml message through the probe, and I can't figure out how to send a test message. We put the message body in the Request Body, but we don't know what to put in the URL, since we aren't actually hosting an FTP server for testing.

I get "XML Parse Error: A name was started with an invalid character. (line 1, column 9)", which makes perfect sense being it isn't an XML payload.

I've tried setting the Content-Type header to "text/plain", but that didn't solve it.

Any suggestions?
Updated on 2012-11-14T19:39:16Z at 2012-11-14T19:39:16Z by swlinn
  • swlinn
    swlinn
    1327 Posts
    ACCEPTED ANSWER

    Re: How to send a test message through the probe for SFTP FHS on MPG?

    ‏2012-11-13T19:00:27Z  in response to SystemAdmin
    So a SFTP poller is looking for a file with a certain pcre pattern to show up on the sftp server. To test this, you should only need to copy a file to that server that has a filename that matches the pattern. The SFTP Poller FSH will pull that file and present it to your MPGW service. The content of that file must match the MPGW's request type, so if the file is malformed XML or non-XML and you have the MPGW request type as XML or SOAP, you'll get a parse error. One thing you can do is to set the request type of the MPGW to non-XML, and if you want to see the data in the probe, go to the processing rule via the object menu and configure "enable non-XML processing" to true/on. Then in the probe you should see the file content, in a hex/ascii format, in the probe.

    Regards,
    Steve
    • SystemAdmin
      SystemAdmin
      6772 Posts
      ACCEPTED ANSWER

      Re: How to send a test message through the probe for SFTP FHS on MPG?

      ‏2012-11-13T21:19:35Z  in response to swlinn
      We just want to follow a message through the policy. We aren't sure where the problem is, so we've had the content of the message to otherwise be retrieved emailed to us. So, now we're just trying to force the message through the policy via the "Send Message" in the probe. Since it is otherwise an SFTP poller, and we're really not trying to poll for this test, it's got my brain all backwards.

      So I thought to change the FSH (for now) to an HTTP FSH and then just "push" the request as a Non-XML message into the MPG, but I'm still getting "XML Parse Error: A name was started with an invalid character. (line 1, column 9)", even though the request type is Non-XML.
      • kenhygh
        kenhygh
        792 Posts
        ACCEPTED ANSWER

        Re: How to send a test message through the probe for SFTP FHS on MPG?

        ‏2012-11-13T21:33:13Z  in response to SystemAdmin
        During development I pretty commonly add a HTTP FSH so I can have more control and easier access. You can always leave it out of the export when you promote it.

        If you're getting a parse error, you likely have a Transform action with INPUT as its input, which will automatically try to parse the message. Presumably you're just operating on metadata about the message like headers etc., so you could configure your transform with the Input as NULL instead of INPUT, and your parse error should go away.

        Ken
        • SystemAdmin
          SystemAdmin
          6772 Posts
          ACCEPTED ANSWER

          Re: How to send a test message through the probe for SFTP FHS on MPG?

          ‏2012-11-13T22:28:03Z  in response to kenhygh
          I'll just hit it with cURL at the HTTP FSH.
          • swlinn
            swlinn
            1327 Posts
            ACCEPTED ANSWER

            Re: How to send a test message through the probe for SFTP FHS on MPG?

            ‏2012-11-14T19:39:16Z  in response to SystemAdmin
            Your service (MPGW in this case) has a request type that may be specified as Non-XML, Passthru, XML, SOAP, etc. Assuming you have this properly configured as Non-XML since that is the message you are sending, you cannot reference the INPUT context unless you specify a binary transformation action. If you have a transformation action, the input is assumed to be XML and is parsed which would fail in your instance. There are some standard .ffd files you can reference in a binary transformation action in the store:/// directory where you can have an output context of NULL if you just want to see what the data looks like in the probe.

            Regards,
            Steve