I am trying to consume on WCF webservice in webmethods 7.1.2 environment and the invokes are failing with the error SOAP message is invalid.
I dig into the issue and found out that if i set the “Strip Whitespaces” to true in SOAP - UI client the invoke works fine, searched web and can see lot of people has faced the similar issue? IS anybody solved this in webmethods or have to write the custom java code to strip whitespaces?
Hmm. The article link doesn’t indicate an error occurred, just that the person wanted to retain the original formatting. Whitespace between elements is not significant for XML parsing. E.g. the following XML snippets are equivalent:
Thus if a web service call is failing simply because there is whitespace then that web service is not behaving correctly.
Additionally, whitespace within a tag is significant and must be preserved by a parser.
Thanks for responding to this post!
I agree to the fact the blank spaces within the spaces are relevent to data, but i double checked there is no blank spaces in request data but there are some whitespaces between the tags of SOAP data … like below and somehow its causing the issue.
 SOAP-ENV:Header</SOAP-ENV:Header> [0LF]
When i invoke the same service with SOAP-UI by setting strip whitespace setting. it works fine … any 'suggestions of this front.
Just to add… if i m not stripping the whitespaces… i am getting the below soap fault…
Soap message is invalid!
Soap[/URL] message is invalid!
The whitespace between tags is not significant. Any parser that it failing because of such space is incorrect. Whomever is hosting the web service you’re calling needs to open a ticket with MS because it is not behaving as it should.
I am in a kind of situation here, system which is hosting the webservice can’t fix the issue beacuse of unavoidable situations… (though there is a service pack from MS for this problem) … i was wondering if any idea comes to your mind for a workable soultion in webmethods … FYI, i created a soap handler service to strip the whitespaces from the soap data but it does not seems to be working…
WOuld be great if you can give me some pointers…
What I would do is add this issue to the partner’s list of “situations.” The question is one of how much pain do you want to endure for someone else’s problem?
One approach would be to handle the call completely with your own code (no WSD/connector). Build the XML directly and do the HTTP post yourself.
I liked that line for “situations”
Yep - i have already took the approach of Soap over http and seems working for me…
thanks anyways for your inputs!