pub.file:getFile service

Hi there,
I am trying to access an xml file on the local file system on the client machine. The IS is present on a remote server. getFile service may not work in this case. Is there another approach to access this file without moving it to the server?

Regards,
Pete.

Pete,

Is you client ie. Developer connecting to that remote IS? or you are using IS server session local on your system? Other option is connect via FTP session to that remote IS and get the file.

HTH,
RMG

Hi Pete,
In this case, you can do many ways:
A> First way:
1> Add node as the input of the service and select the service that you want to test.
2> From the Test menu, select Send XML File.
3> In the Select Test Mode dialog box, specify whether you want the service to run in Trace mode or Step mode and click OK.
4> In the Select File dialog box, select the local XML file that you want to submit to this service and click OK. Developer submits the file to the server, which parses it into a node object and passes it to selected service.

B> Second way:
Add a string named say inXML in the input of your service. Open the local XML file and copy the content and run the service and paste the content to the variable inXML. In this case disable the getFile step.

C> Third way:

Use the Load from file option while running your service but in this case you have to have your local XML in slightly format.

HTH,
Bhawesh.

1 Like

Hi Pete,
You have to configure FTP server on your local machine and use webMethods built in ftp service to get the file.

Appreciate ur help.
I have used the ‘send xml file’ option to get the xml file, that is converted into a node. However, I am unable to view the attributes in the “xml node view” option when I invoke the ‘queryxmlnode’ service. How do I view this node to query attributes?

Regards,
Pete

Hi Pete,
Call the xmlNodeToDocument service and this will convert the node into the webMethods doc structure where you can view all the files in developer.

HTH,
Bhawesh.

Hi Pete,
There was a typo in my earlier post.
“where you can view all the files in developer.” should be treated as “where you can view all the fields using Developer.”

Pete,

If the ‘send xml file’ option to get the xml file,this option works for you (debug,testing purpose) which is converted into a node, as a first step for parsing the xml invoke
xmlNodeToDocument service (inputs set makeArrays=false,set documentTypeName(fully qualified name of the IS document that you are parsing the xml file) this gives output document(IDATA structure) further downstream do source to target mappings etc…or follow with your requirements.

HTH,
RMG

Thanks again.
I am able to access the xml file when I copy it into a string variable and call the necessary services. I would also like to try this out by sending the file via http using pub.client:http service. I specified the url of the service to be invoked and the string that stores the xml file. However, I cannot view any variable containing the file in the target service’s pipeline. Am I missing out on something here?

Thanks and regards,
Pete.

Also inputted other parameters like method, loadAs and content-type.

Hi Pete,
Using the service pub.client:http you will be able to post the file from the IS server machine to other machine, not from your local machine to the IS server.

Pete,

Did you set Header/content-type=“text/xml”?Please make sure have data/arg/string or bytes or stream with loadAs=bytes or stream

Then you should see in the target IS flow with node object in the pipeline.

HTH,
RMG

Hi RMG,
I have set the parameters as u suggested, but I still cannot see the node in the target service pipeline. Am I using the right service? as I am told earlier that I cannot use this service to transfer files from local machine to IS server.

Pete.

Is your http post hitting the target service? what is the url format that you have given is it like [URL=“http://localhost:5555/invoke/servicename”]http://localhost:5555/invoke/servicename[/URL]? What variables are you seeing in the pipeline?

For debugging in the target flow service use pub.flow.getTransportInfo and savepipelineToFile and later restorepipelineToFile and check the pipeline.

Please let us know your findings.

HTH,
RMG

Hi Pete,
In my earlier post I wrote:
“Using the service pub.client:http you will be able to post the file from the IS server machine to other machine, not from your local machine to the IS server.”

The above post is based on the assumption that you only have Developer on your local machine and no IS. You have IS on a remote machine and you are trying to transfer a XML file from your local machine to the remote machine (with IS) using http.

Can you pls. confirm that this is the situation? If not, pls. write in detail what are you trying to do?

  • Bhawesh.