Hi friends,
My partner needs to post a XML data to a URL.I have successfully created a url and given to him.I have also written a flow service that accepts that xml data by creating a node and the calling XMLNodeToDocument flow service.To test it i myself am posting a xml string via http post to the URL which i have created(Content-Type=text/xml) and everything works fine i can see the xml data gettin populated in the database which my flow service does.
Now the problem is my partner is trying to post via an IE browser…i know that we cannot do that he says he gets a “page cannot be displayed” error also he tried to post it via IIBM,but still not successful.I am not able to figure it out how to do that .I have even set the execute ACL for my flow service as Anonymous.Please help with some suggestion how do i tell them to send the xml?
The URL which i have created is http://servername:portnumber/invoke/foldername.subfoldername1.subfoldername2:flowservicename
You can’t use a web browser alone (IE, Firefox, Opera, etc.) to post XML data directly to a Flow service.
You can write a DSP page that allows you to paste an XML document into a text box and then invoke a Flow service or you could write a real application on the sending end that understands how to do an HTTP post (this is very, very basic stuff in most languages these days).
Your Flow service does not have a built-in user interface. You can either create one or write a program to post the XML.
You could create a web page like the one you pasted, but the content-type should be “text/xml”.
And, of course, the browser is now loading a page that invokes the service and not invoking the service directly which was the point of my original post.
Also, since “Hello World” is not an XML document, the IS content handler would throw an exception, if that content were not replaced before the submit button were clicked.
Here I cannot use “text/xml” as contentype because then the default content handler converts the input to “node”… and my input is not a valid xml
What will happen if there is no customized page created for this service… what i mean to say is i have just developed a flow service and trying to call it from a simple html page.
due to which i am using text/plain or application/x-wmflatfile as content type…
In the dev environment it is showing “This page cannot be displayed” but in test environment my partner is not getting any error…
If i write java client and try to invoke the service … it works just fine…
Even I used built in client:http service which also works fine.
The problem is not bothering me now… but i am just curious why there is such a difference in response from IS.
I think the basic point is that it is not possible to post a document to a flow service by typing an URL into a browser address box. It is absolutely possible to do as you have done and create an HTML interface to acquire the document and set up the HTTP post. As far as why you’re seeing different behavior in different environments, I can’t tell enough about the differences in the two environments to comment usefully.
In the flow service I am doin XML string to XMLnode and then node to document and then doing the necessary processing needed.When I do a test by goin to Test->Send XML it works perfectly fine.Also when I post the data through internet explorer by givin the following URL it works perfectly fine.the URL I m givin in IE browser is
And this is creating a problem ,he doesn’t see any errors at his end but the field values are not getting populated at my end.he says that he has to use IBM tool and nothin else…what shld I incoporate in order to make this work
How are they invoking your service via URL in http post??? In any case they when they invoke your service they should send XML with content-type=text/xml inorder to receive *node object in the pipeline to make work at your end.Is that IBM tool not capable to send the content type info??
they are posting it via URL and the content type is set to text/xml but i noticed something the the encoding is GZIP,DEFLAT.The way the are posting is something like this
I have a few things to add to the original conversation:
One really easy way to post XML to a flow service from an HTML form (without using JavaScript or anything) is to give the TEXTAREA (or whatever will hold your XML in the form) the name $xmldata. From GEAR’s XML Services Developer’s Guide:
[FONT=PalatinoLinotype][SIZE=2]
This URL when “executed” will send the following XML to the postTest:receiveXml service:
Data
A bigger challenge, however, is that the length of the URL is usually limited by the browser, so this practice would most likely not work for large XML documents.
Now, dhimate, if all you want to do is to post plain text data to a flow service, then how about creating a flow service that takes a String variable as input, call it flatFileData, for example. Then, create an HTML form where the TEXTAREA name is the same as your variable name and the action is the URL to your service. Example:
When you submit the form, your input variable will be assigned the text from the TEXTAREA.
Hi Friends,
I have created a service that is expecting an xml post. The client is setting the content-type to text/xml and the service is correctly receiving the xml post as a node object I then convert the node to document etc… the service seems to work fine.Now the client wants a response to the XML post which he has done.How do i do that??
Hi Ppl,
When my partner sends me an XML data through HTTP post,he gets a 403 error.I dont understand.He has all the username and password which I have provided.
Please help
I’ve written a small .net (2.0) app that will do a HTTP post to a flow service, Private Message me with your email address if you’d like a copy. I’ve used this in conjunction with YATT to trace and debug requests/responses to services.