Service to accept data with FTP

Can anyone tell me what is the exact syntax for calling a service via the ftp port (it is setup in my IS)? I under stand you have to navigate to the specific service on the ftp server (the IS)? I have done so. I want to send something to the wm.tn:receive service. If my xml filename that I want to send is called testXML.xml, what would be an example of such a ftp call?

I have: put testXML.xml xmlIn.xml; text:xml
But I get “553 ‘xmlIn.xml;’: cannot write”.

what is the idea behind the xmlIn.xml file?
Thanks in advance!

DJ,

You can create a flat-file wrapper service:

Input signature: ffdata = object (inputstream)
Output signature: ffreturn = object (outputstream)

Flow steps:

  1. ffdata -> pub.io:steamToBytes
  2. pub.string:bytesToString
  3. pub.xml:xmlStringToXMLNode
  4. wm.tn:receive

Trading Networks does its thing…
If you have configured your processing rule to launch a service asynchronously (best practice imho), you can just return a message to the ftp client like:
“Document submitted to Trading Networks”.

Put response meessage in a string and return it to FTP client in “inputfilename.out”.

  1. pub.string:stringToBytes
  2. pub.io.bytesToStream -> ffreturn

If you decide to do authentication (set up ACLs) for the flat-file wrapper service (best practice imho), you can call wm.tn.doc.xml:routeXml instead of wm.tn:receive.

DJ,

Before you put that file to a IS service using ftp port then the syntax is login to that IS port wiht username/password then do a
cd on packages/ns/yourpackagename/folder/subfolder(if exists)/servicename
check with pwd and make sure the path is right
put text:xml

Finally make sure put is success.

And rest follow the Mark’s instructions above.

HTH,
RMG.

DJ,

Seems the flowservice input is not getting the XML data that you are ftping.

Make sure the receiving service input is $xmldata this will extrac the data that you are ftping text.xml and further down when parsing use XMLStringToNode or StringToDocument and XMLNodeToDocument or documentToRecord etc…for parsing the XML.

For debugging purpose use the pub.flow:getTransportInfo service and this way you can identify what exactly going on in the pipeline.

HTH,
RMG.

Hi,
I still don’t get anything in my Service. My saved pipeline is empty. What is the command for sending (put) to the WM ftp server? What is the definition of the different parameters?

I did the following:
put testXML.xml xmlIn.xml ;text:xml

Where testXML.xml is the file I want to send. What is the idea behind the second parameter (xmlIn.xml).
The fact that this line appears:
ftp: 174 bytes sent in 0.01Seconds 17.40Kbytes/sec.
means I am sending the correct file, but it just doesn’t send it to my pipeline varaible. (I am in the correct directory …folder\servicename…)

Thanks

DJ,

When you do cd on the /ns/folder/servicename (make sure it is forward slash) and then use put testXML.xml xmlIntxt;text:xml.

Then you should see the node in the pipeline.

HTH,
RMG

You can also register txt/plain content handler as:

ServerAPI.registerContentHandler(“text/plain”, new HandlerFactory_txt());

to allow you to ftp plain txt files:

cd ns/absolutepathtoyourservice
put yourfilename

~tS

Hi,
I am hitting an XML to a WebService using webMethods Connectors, I am getting the following exceptionthe WebService is supposed to be with the maximum load)
<error>[ISS.0086.9091] Parameters xmldata, $filestream and $filedata are all missing. One of these must not be null.</error> <errortype>com.wm.app.b2b.server.ServiceException</errortype> <errordump>com.wm.app.b2b.server.ServiceException: [ISS.0086.9091] Parameters xmldata, $filestream and $filedata are all missing. One of these must not be null. at pub.xml.xmlStringToXMLNode(xml.java:523) at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code)) at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java(Compiled Code)) at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java(Compiled Code)) at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java(Compiled Code)) at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java(Compiled Code)) at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java(Compiled Code)) at com.wm.app.b2b.server.ACLManager.process(ACLManager.java(Compiled Code)) at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java(Compiled Code)) at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java(Compiled Code)) at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java(Compiled Code)) at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java(Inlined Compiled Code)) at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java(Inlined Compiled Code)) at com.wm.app.b2b.server.BaseService.invoke(BaseService.java(Compiled Code)) at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java(Compiled Code)) at com.wm.lang.flow.FlowMapInvoke.invokeService(FlowMapInvoke.java(Compiled Code)) at com.wm.lang.flow.FlowMap.invoke(FlowMap.java(Compiled Code)) at com.wm.lang.flow.FlowMap.invoke(FlowMap.java(Compiled Code)) at com.wm.lang.flow.FlowState.invokeNode(FlowState.java(Compiled Code)) at com.wm.lang.flow.FlowState.step(FlowState.java(Compiled Code)) at com.wm.lang.flow.FlowState.invoke(FlowState.java(Compiled Code))

I am not able to get more information about the soap packet I am getting back, Since I am not able to reproduce the case.Help me if some one is familier with the exception.

thanks in advance
Vivekanand

Vivek,

Please make sure XMLStringToNode is having enough input information to parse the document when you receive the XML from webservice.

HTH,
RMG

Hi, I am facing a similar problem…my input is a .pap file which is basically an ebXML file.My receiving service has node as input and the first 2 steps are streamToBytes and bytesToString. The service encounters a ClassCastException at streamToBytes. The lastError/pipeline/ffdata contains wm.server.net.FTPInputStream. I have a hunch that the input is coming as FTPInputStream (i post data to the service using ftp put)whereas streamToBytes expects java.io.InputStream. The server log shows the error “2006-09-22 13:46:17 CEST [MON.0119.0055E] Error retrieving combo list: com.wm.app.b2b.server.ServiceException: Missing input from pipeline: instanceID”… Can anyone please help ?

Arnab,

“My receiving service has node as input”
put XMLNodeToDocument step (replace streamToBytes and bytesToString services).It should work.

HTH,
RMG

Your service may have declared a node as an input but apparently that is not what it is getting. For a node to be passed to your service, the FTP client must specify the content type as text/xml. It would appear they are not doing that? Calling streamToBytes and bytesToString would be the wrong thing to be doing with a node.

As you point out, the ffdata variable is present. FTPInputStream is derived from InputStream. Pass ffdata to streamToBytes, not node.

Of course, if you get the client to specify the content type, then your service will get a node and you can skip the streamToBytes/bytesToString/stringToXmlNode steps–they will have already been done for you.