Sending XML through HTTPS Post

Hi All,

we have a requirement where I will get an IDOC and need to map the required fields to an xml document and post it to trading partner through https post.

Now, What I need is:

How to create the XML document. Do I need to create the xsd? If yes, How to create it.

I will be submitting the xml to TN console where based on the processing service. The Processing service will do the https post.

If possible, pls let me know how we can submit xml to trading https post.

Thanks,
David.

How to create the XML document. Do I need to create the xsd? If yes, How to create it —> You can create/build XML either XSD/DTD using XML editor tools (xmlspy or others) based on the mapping fields (meaning full names) and load/reference it to create IS Document Type or directly IS Document type (manual way) in the wM Developer.

I will be submitting the xml to TN console where based on the processing service. The Processing service will do the https post. --> You should create the document in the TNConsole reference the XML data file which you have created above and follow the comments below.

Routing service to TN:wm.tn.doc:routeXML (node)
Http service:pub.client:http (The Processing service wrapper should contain this service which posts the xmldata to your TP) …

Also review the Built-In-Services guide for more info on how to use the above mentioned services.

HTH,
RMG

I will try to create an XSD and will let you know if I find any problem. Thanks for your quick response.

If you’re posting the XML to a partner, the partner is likely to have an XSD you can use.

Yes Rob has raised a good point,contact your TP also and it saves time…

HTH,
RNG

Thanks Reamon and Rmg.

I will try to contact the TP for an XSD. It seems they dont have, but I will try once more.

Thanks,
David

They may not have an XSD. But strictly speaking, you don’t have to have one. It’s a good idea to have one (generally) but you can just define an IS document type directly that matches the layout/element names of the XML you need to process.

The TN doc type will only need to know how to identify the document. The root tag is usually sufficient. Will the XML document have sender and receiver information in it? If so, define the doc type to extract those so TN can determine the sender and receiver. If the XML document will not have this information, there are a couple of approaches you can use–post again if you need help on that.

Configure the delivery for the TN profile of the partner. Define a rule that indicates when TN gets such a document, deliver it to the partner.

Of course you’ll want to review the wM docs on all of this.

Hi Reamon and Rmg,

Thanks for posting your inputs. I have successfully created the schema and doc type.

I have created two documents. One is for the xml data and the other is the WrapperDoc.

Now, I have created the xmldata string and mapped it to a string in WrapperDoc.Now, i converted the wrapperdoc to node and submitted to TN.

doctoxmlstring
xmlstringtonode
wm.tn.receive

Now, in the TN, in transactions, content.

The actualdata doesn’t look correct. it looks like < etc

<?xml version="1.0"?> 1234 ?xml version="1.0"?>

Might I suggest eliminating the use of the wrapper doc? Instead, specify the sender and receiver in tn_parms.

If you want to continue using the wrapper doc, 2 things:

  • You’ll want to eliminate the second XML declaration.
  • Set encode to false in the documentToXMLString call.

In the Transaction Analysis page is the doctype/sender/receiver getting recognized or unknown upon submit?

Also just a side note use the wm.tn.doc.xml:routeXML instead of tn:receiver service for internal routing to TN.

HTH,
RMG

Hi Rmg,

Just as an example, I removed sender,receiver etc in my previous post. Yes, the sender and receiver are getting recognized. The processing rule is getting invoked and everything looks fine.

Just concerned about the load in the WrapperDoc. The load xmldata looks fine…but after mapping to WrapperDoc and converting it to node and submitting it to TN. The load doesn’t come properly…I mean the xml.

Thanks,
David.

Hi Rmg,

As in your previous reply. I have set the encoding to false when I was converting the WrapperDoc to xml and traced till there. The xmldata is appearing perfect and after converting it to node and submitting it to TN.

I am getting error saying. missing end tag.

This RealData field is the string field in WrapperDoc to which the actual xml load is mapped.

I am not able to submit to TN. If i Set encoding to true…I am able to submit it to TN.

Thanks,
David.

If i Set encoding to true…I am able to submit it to TN.–> This setting is must for you.

You need to have Sender/Receiver fields in your xmldata and set the extraction in the TN Document Type section or pass the info in the TN_Params of routeXML/tn:receive as Rob pointed above.

HTH
RMG

Can you post the exact XML being used? If needed, you can replace sensitive data but try to leave any non-alpha or non-numeric characters in place. I suspect that there is a character in the original XML that isn’t encoded but needs to be.

Hi rmg,

Yes, If I set encoding to true I can submit successfully to TN. But the content is not appearing perfect. I mean the actual xml load is not appearing properly.

But when I have set encoding to false, The WrapperDoc after converting to xml is appearing fine. The actual load which was mapped to WrapperDoc is also appearing perfect but cannot submit it to TN.

It says missing end tag.

Thanks,
David

Hi Reamon and Rmg,

I have solved the issue. There was > missing for one segment which is making the end tag missing.

Now, I can submit to TN even after setting the encoding to false. Thanks much for all your help and support.

Will get back to you guys if i need any help.

Thanks,
david.

Hi Rmg,

Just wanted to know that you mentioned to use

wm.tn.doc.xml:routeXML instead of tn:receiver service for internal routing to TN.

What is the reason? Could you explain…thanks for your help.

David.

Hi Reamon and Rmg,

Now, I have successfully posted the WrapperDoc xmldata to TN and the processing rule invoked the processing service.

Now, I have converted the bizdocToRecord and then documenttoxmlstring and then pub.client.http service.

Now, I am giving the inputs for url ( https://hhhhhhhh… still dont know the url). then

method = post
loadas = bytes
mapping the xmldata above to string field in data.
auth doc. type= BASIC
user and pass.

Is this enough to give these inputs or Do i need to give anyother inputs. Also, Will I get any confirmation back if the post is successful…for the error handling purpose.

Please let me know.
David.