Submission to TN as xml

Hi!

Is it possible to define in the trading networks the type of content the partner would be sending, or it is that it can always be XML.

The reason i am asking is, when XML document with UTF-16 is being send to TN it is not validating against the document type. What if i just take the input from partner as html and then parse to get the actual content. Is this a possible approach.

any thoughts would be appreciated.

regards,
sandip

You may find this thread of interest:

http://www.wmusers.com/wmusers/messages/117/12211.shtml

Take note of the comments about setting the content-type header.

Hi! Rob,

I did go thru that thread and really helped me to understand what is happening. It mentioned to set the content-type header.

When i add the Content-Type=text/html, it worked fine. But the XML which i am receiving is from the partner. And my partner is not ready to change in the XML.

Can i do anything at my end before TN starts processing.

I would appreciate ur help.

regards,
sandip

Rob,

I just did a wrong check before posting the previous message. I am sorry. If i add the content type in the first line of XML, still it doesnot work with UTF-16.

Where exactly should i add the content type.

Again, please let me know the options as to what needs to be done in the XML and what i can do at my Trading Networks end to accept UTF-16.

regards,
sandip

You set the content-type of the http header, not in the xml itself. How this is done depends on what is being used to do the post. A Google search should turn up good information about how to do this in Java, etc.

Hi! Rob,

What i am trying to understand is, my partner XML hits the Trading Networks at the first place. Do i have any opportunity to set the header. As the trading network itself doesnot recognizes when it gets the document.

I feel this would have been possible if the partner would have added the content-type.

Correct me if i am missing any point.

regards,
sandip

Have the partner submit to a custom service that you build, rather than wm.tn:receive. Then you have a chance to do any adjustments needed before passing on to wm.tn:receive within your service.

Forgot to mention that you’ll need to do some trial and error with this as I’m uncertain what the IS content handler will do to the data stream that comes in and how it will be presented in the pipeline.

Rob,

If i consider that i do the change such that partner calls my custom java service before i use tn:receive. Could you help me with some sample code which can help me capture the http request data and modify the encoding. Once i get the encoding converted, i take the output which i guess would be bytes[].

Rob,

I found one fix for 4.6 in the advantage site. I am just wondering has this been incorporated in 6.0.1. As i am facing the same thing in 6.0.1.

http://advantage.webmethods.com/servicepacks/known_issue-20020926-072142/IS_4-6_Fix66_README.txt

Hi! Rob,

I could rectify at the Developer end by using the XML spy to change the encoding of the document. It provides with a good feature to change the encoding. Previously, i was doing it manually which was not doing the encoding correctly resulting in rejection from Developer.

But i still see the Trading Networks is not recognizing the UTF-16 doc.

I am wondering, does TN also have a patch for UTF-16.

So the patch isn’t working for you? There wouldn’t be a patch for TN for this as this isn’t a TN issue–it’s an IS content handler issue.

Oh! the webMethods developer is working fine.

-i create a document type in the trading networks
-Choose the schema to validate from
-try to test the document types.
-select the same XML file with UTF-16
-It doesnot identifies the XML doc and says “no matched doc types”.

IS Content Handler is working fine, that is the reason, i am able to see in the developer. Right !!!

I’m not sure what the test facility does in terms of setting the content type. Can you try submitting a test doc to TN with a tool that allows you to specify the content-type?

I am using a simple HTML form with two fields URL and Text Area. The content is stored in the $xmldata.
I copy the UTF-16 XML content and paste it in this Text Area and i specify the URL for my service. On submit i call a javascript. In that i had written,

document.form.enctype = “text/xml”;

I am not been successful in this too.

Have you tried these:

document.form.enctype=“text/xml;charset=UTF-16”
document.form.enctype=“text/xml;charset=UTF16”
document.form.enctype=“text/xml;charset=UnicodeBig”
document.form.enctype=“text/xml;charset=UnicodeLittle”

Hi! Rob,

I added the following, and i am getting the result for UTF-8 and for UTF-16, i just get the first line of xml.

META HTTP-EQUIV=“Content-Type” CONTENT=“text/xml;charset=utf-16”

My results are similar to what skip mentioned in one of the threads.

http://www.wmusers.com/wmusers/messages/117/12211.shtml?1060215051

He says to set the content/type to html. Now i am trying to know how should i get the xml. What do i need to do in the flow service. I suppose the input to the flow service needs to be a node. do i need to write a java service to read it. any sample code would help me.

regards,

I just posted a message over in that over thread about how to use the text/html route. How are you submitting this XML? If you’re using an HTML page for testing, make sure you’re using a TEXTAREA in your HTML - if you use INPUT TYPE=text it won’t get the whole XML.

I am submitting the XML of UTF-16 which is calling my flow service. I have a HTML page with the text area. Full XML is been put in the text area, after copying and pasting in the text area.

And in the html page, i have written as,

META HTTP-EQUIV=“Content-Type” CONTENT=“text/xml;charset=utf-16”

This is written just after the javascript tag closure. I am submitting the page using Javascript.

When i try to submit and call my flow service, i get the output as just the top level xml tag. Though i have seen that developer accepts UTF-16 files if i test using the developer. Meaning Test----Send XML File in developer.

Please suggest.

regards,

I know nothing about submitting via Javascript, but it certainly sounds like your error is there. Maybe there’s another message board that focusses on Javascript/HTML that help you out with that.