Problem to receive an XML order

Hi,

I created a new flow CecaCustomerX:receiveFile with Permissions Execute ACL to Anonymus

The customer will send the order to it using
http://serverAddress:serverPort/invoke/CecaCustomerX/receiveFile?duns=X&sharedsecret=X

The customer is not able to use username/password or certificate. It is the reason why I was trying to go in that direction.

The flow is doing the following thing
map (TN_parms/$contentType = text/xml)
pub.xml:xmlStringToXMLNode
wm.tn:receive

The problem is that I have an error in TN.
Processing Status: ABORTED
Class: Recognition
Brief Message: Transform Failed
Error message:
Transform for ReceiverID of doctype cXML 1.2 OrderRequest failed to produce a value. The transform function was FN_PARTNER_LOOKUP, the first original value was 99999.

When I take the same XML order and I post to http://serverAddress:serverPort/invoke/wm.tn:receive (with my username/password), it works.

What do I have to do to make it works?

Thank you

lb,

Place a pub.flow:tracePipeline statement in your Flow. That will show you what variables are being passed into your service. My hunch is that you are not receiveing the posted data in the variable you are referencing in your MAP statement.

Mark

Ok,

I’ve done what you suggested. Here are the informations that I’ve got on the screen with the savepipeline and the ExitFlow.

duns 99999
dunsList 99999

sharedsecret XXXXX
sharedsecretList XXXXX

targetURL http://serverAddress:serverPort/invoke/CecaCustomerLear/receiveFile?duns=99999&sharedsecret=XXXXX
targetURLList http://serverAddress:serverPort/invoke/CecaCustomerLear/receiveFile?duns=99999&sharedsecret=XXXXX

$xmldata TheContentOfTheOrder
$xmldataList TheContentOfTheOrder

node DOCUMENT System ID: null Public ID: null

Littlebird,

One thing that I noticed is that in your receive service, you’re invoking wm.tn:receive. One of the steps that wm.tn:receive takes is to do a security check on the document sender vs. the logged in partner. If you invoke wm.tn:receive from a flow that was invoked Anonymously, I don’t believe it would work as expected.

Normally, when you create your own receive service, you bypass the wm.tn:receive service completely. You do that by simply invoking wm.tn.doc.xml:routeXml or by invoking wm.tn.doc:recognize and wm.tn.route:routeBizdoc separately (in case you want to do something between those two steps.)

Also, I noticed that you are invoking xmlStringToNode. If they are sending their XML as a stream with content-type of text/xml to being with, you do not have to do this. The IS content handler will convert the XML string to a node automatically. If they are sending their XML from an HTML form, however, you can ask them to name the form field $xmldata. This tells the IS to treat the data as XML and it will also automatically convert your XML string to a node.

Last thing, any reason why you’re including your shared secret in the HTTP URL? You should understand that once you put that value in your URL, it’s not so much a secret anymore (unless you’re encrypting it somehow.) :slight_smile:

  • Percio

Everything is working.

I use wm.tndoc:recognize and wm.tn.route:routeBizdoc separately.

I also remove the parameter SharedSecret (I was not using it).

Thank you for your help.
littlebird