XML data coming as blank in service on IS via HTTPS post

Hi All,
My vendor is trying to post a XML request string to my service on IS 6.5. We have exchanged the certificates and everything is fine. They come in and I see a hit on my IS, the input in the pipeline is string called as requestXML, nothing comes in it and it goes to catch block saying that xmldata cannot be null.

com.wm.app.b2b.server.ServiceException: [ISS.0086.9091] Parameters xmldata, $filestream and $filedata are all missing. One of these must not be null.

They say that they have set Content_type to text/xml and below is the snippet from thier client program:

post.addRequestHeader(“Authentication”, “XYZ:ABC”);
post.setRequestHeader(“Content-type”, “text/xml”);
HttpClient httpclient = new HttpClient();

There is an Execute ACL on my service and they have added the login credential for XYZ user in Authentication as above.
They get Access Denied error, so I have removed the Execute ACL and changed it to Anonymous.

Thats a different issue. First I have to crack why thier request is coming in as NULL or BLANK in my service.

Could anyone please help?

What is the service input set to in your receiving service end?

Normally it should be node (object) for handling XML via HTTP requests.

Test it out and xmlNodeToDocument should work fine:

HTH,
RMG

The service input is not a node, but a simple string called as requestXML. Again, its not a node but a string.
My first step in service is XMLStringToXMLNode.
So I am expecting a string and not a node.

There is another vendor that is using this same service and it works for them. I expect the XML string to come in requestXML string.

I know what the issue, this service was initially designed for one vendor, who posted a XML as string to the service. So the first step I have in my service is XMLStringToNode.
But this new vendor now post the XML as node to the service. I tested by disbaling the XMLStringToNode and having the XMLNodeToDocument as first step and its working fine.

Now how should the new client post, such that I get input as XML string and not as a node.
The old client is already in production and i dont want to touch the code. I have to ask the new client to change the way it send the XML.

Any thoughts?

If you still want to use the one gateway service Yes you should request TP to send it similar to other TP sends it…Other option is create a separate service to handle the new TP and so forth:

But in your initial setup did you ask TP’s to send requestXML string in the http request as argument?..thats why you are not seeing node object by default:

HTH,
RMG

Hi RMG,
Thanks for the reply. TP1(from whom i am getting XML in string"requestXML") is already in production.
TP2 is in test, so my preferable option is not to ask TP1 to chnage and ask TP2 to send the request as TP1(i.e in string “requestXML”, rather than in node).
Other wise I have to go for code change. i was looking for more option where TP2 would just post the XML and i would come in pipeline in “requestXML” string rather than “node” object.

I confirmed with TP2 and they said that they are posting XML as string and Content-Type as “text/xml”

What if they change the Content-Type to “text/plain”? Will the data posted to my service come in “requestXML” string?

What do i have to do?

What if they change the Content-Type to “text/plain”? Will the data posted to my service come in “requestXML” string?

Nope

First from TP1 did you check how they are sending as string “requestXML” named?

What ever TP2 is sending in right fashion and appropriate at receiving end:

If possible can TP2 send requestXML string as an argument if that works for you?

HTH,
RMG

I didnt check with TP1. Let me check how are they posting the XML and get back to this thread.

OK make sense:

I have checked with TP1 and they said that this is how they are posting the XML

HTTPRequest::https://XX.XX.XX.XX/invoke/Sample.Services:SampleService::GET::requestXML:<?xml version="1.0" encoding="UTF-8"?>

.
.
.

.
.
::

YES they are sending as argument with ? after

Pl check with your TP2 also and make sure they are OK with sending request same way:

HTH,
RMG

CAn some one please send a smaple JAVA code on how to send POST XML to HTTP URL using arguments(name-value pair)

So like in my case requestXML should be assigned the below XML:

requestXML:<?xml version="1.0" encoding="UTF-8"?>


.
.
.

.
.
.

::

BTW,You can test this via client:http service itself right? or you want to share JS with your TP and request the same?

There is no need to reinvent the wheel when out of box provided:

Pl do a google search for java code you might get help:

Name/value pair wouldn’t be via POST. It is a GET.

What is the insistence on getting the variable name “requestXML” to your service? The IS content handler does the XMLStringtoNode conversion for you automatically when the POSTed content type is text/xml or application/xml. What’s driving you to want the string?

He is getting node object from TP2 while content-type is text/xml and which is expected but sounds their request to TP1 to send requestXML per their initial design may be they support only GET who knows:)

you can check if “node” object is present in the service pipeline; if present then skip pub.xml:xmlStringToXMLNode service invoke step.

The issue is he is expecting requestXML string in the pipeline:) which is not the standard handling they are using:

got that. but to get XML String in pipeline, the partner must send the name-value pair with Content-Type text/plain (text/xml will get converted to “node” by IS contenthandler).
i’m just thinking to skip the XMLStringToNode step if the node is already available in pipeline, which will be the case for http post with content-type text/xml.

YES they are sending as an argument via GET from TP1 but TP2 via POST:

This would mean a change to the service already in Production, a quick n dirty solution is to whip up a 2 second wrapper service that merly converts from the xml node to xml string then invokes the Production service which is expecting the string.