ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Character String to XML Structure

Post new topic  Reply to topic
 Character String to XML Structure « View previous topic :: View next topic » 
Author Message
SANTYP
PostPosted: Wed Jul 14, 2010 3:48 am    Post subject: Character String to XML Structure Reply with quote

Centurion

Joined: 27 Mar 2007
Posts: 142

Hi Guys,

I am getting an soap request in character string format,
I need to convert that into XMLNSC format before hitting the service..
how can I achive this
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 14, 2010 4:05 am    Post subject: Re: Character String to XML Structure Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

SANTYP wrote:
how can I achive this


Using the method described in the documentation or frequently on this forum.

What have you tried so far (if anything)? What happened? Error messages? Unexpected document structure?

How is this request arriving? HTTP? WMQ? Winged monkeys?

Does the request have a WSDL?

The answers to these questions should provide you with food for thought.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
krypton
PostPosted: Wed Jul 14, 2010 6:40 am    Post subject: Reply with quote

Disciple

Joined: 14 Mar 2010
Posts: 186

Quote:
Using the method described in the documentation or frequently on this forum.

What have you tried so far (if anything)? What happened? Error messages? Unexpected document structure?

How is this request arriving? HTTP? WMQ? Winged monkeys?

Does the request have a WSDL?

The answers to these questions should provide you with food for thought.


Let me add more on behalf of my colleague, we are calling a webservice using HTTP Input node, to test it we are passing that request to HTTP INput node in the following manner.

Our Input is XML message wrapped in SOAP envelope and the way we tested it is
SOAPUI --> HTTPInput NOde -> HTTPRequest Node and we got a sucess response from the Webservice.

Now, in real scenrio our Input would be coming from another SOAP message, so what we are doing is

InputMessage(from another Webservice) --> HTTPINput Node--> SOAPExtractNode --> SOAPEnvelopeNode-->HTTPRequest.

But the above call got failed, then we used the debugger to compare the message before HTTPRequest node, and it was exactly same in both the cases(including SOAP envelope) etc.

We tried to compare the request of HTTPRequest node in both the cases using a dummy webservice and we found that the first request is sending a XML message in a proper formatted XML, whereas the second flow is sending the XML request to webservice in a single string line(with no format).

That is the only difference we could find, dont know whether that is the root cause and what we can do to fix this.

Thanks
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Jul 14, 2010 6:57 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Are you seeing XML in both cases but in one there are no line breaks at the end of tags?

AFAIK, both are equally valid XML. After all XML describes what is inside the tags and CR/LF's are usually ignored by most parsers.

I've use XML both with & without line breaks (CR/LF or whatever is the default on your Operating System) successfully.

There are times when putting all the XML on one line is the best way.
One such example is where you are reading the records from a file and each line is a complete message. You can have thousands of records/messages in a single file that are easily separated wheras if you had CR/LF after every close tag then you would have to build up a message in memory whilst you look for the root close tag before sending your message.
For example
Code:

<Message><One>All</One><Two>On</Two><Three>One</Three><Four>Line</Line></Message>

If you take the above messagr and open it in say RFHUTIL and set the format to XML you see it all nicely indented.


I'm sure that someone here may well be able to quote the section of the XML standard that sorts all this out.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 14, 2010 8:25 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

smdavies99 wrote:
I'm sure that someone here may well be able to quote the section of the XML standard that sorts all this out.


It's here I believe.

But it's true that both methods are valid XML, it's just a case of how they're display. RFHUtil (and XMLSpy if you ask it to) will pretty-print XML to put one tag on one line but it doesn't change the meaning nor how line line breaks and other white space appears (or not) in the WMB message tree.

To save someone else the trouble, I'll say it - don't use the debugger. Take a user trace.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jul 14, 2010 11:11 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
...the first request is sending a XML message in a proper formatted XML, whereas the second flow is sending the XML request to webservice in a single string line(with no format).
As others have already pointed out, both forms of XML are equally valid. I know what you mean, but 'proper formatted XML' is not the correct way to talk about it. The single-line version is just as commonly used, and just as correct.
Quote:
That is the only difference we could find, dont know whether that is the root cause and what we can do to fix this.
I would love to offer some advice at this point, but it's rather tricky to do that when I have no idea what the symptoms are. 'Root cause' of what, exactly? Could you at least quote an error message, or tell us what happened, or what didn't happen?
Back to top
View user's profile Send private message
SANTYP
PostPosted: Wed Jul 14, 2010 9:07 pm    Post subject: Reply with quote

Centurion

Joined: 27 Mar 2007
Posts: 142

[quote="kimbert"]
Quote:
'Root cause' of what, exactly? Could you at least quote an error message, or tell us what happened, or what didn't happen?

As previously mentioned.we are trying in 2 ways..
case1:
when we are directly hitting the service
flow structure; [http input --> http request --> http reply]

we are getting successful response
like below
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ug="some namespace">
<soapenv:Header/>
<soapenv:Body>
<ug:results>
Success
</ug:results>
</soapenv:Body>
</soapenv:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml;charset=utf-8
Content-Length: 435
Date: Thu, 15 Jul 2010 04:56:44 GMT
Server: Apache-Coyote/1.1

case2:
when we are using soap extract and saop envelope nodes
request itself comming in Response.
flow structure: [http input --> soap extract--> soapenvelop-->http request --> http reply]

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml;charset=utf-8
Content-Length: 4647
Date: Thu, 15 Jul 2010 04:55:46 GMT
Server: Apache-Coyote/1.1
Connection: close

case2 we need to implement..
I mentioned sample flow structure we need do manipulate message in b/w extract and envelope nodes.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jul 14, 2010 11:30 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
case2:
when we are using soap extract and saop envelope nodes
request itself comming in Response.
I presume this is wrong ( although you have not actually said so). That means that the response message is being constructed wrongly, or the wrong branch of your flow is being executed.
In other words, this is basic message flow debugging - what am I missing here? Have you tried stepping through the flow using the debugger? Have you taken a user trace?
Back to top
View user's profile Send private message
SANTYP
PostPosted: Thu Jul 15, 2010 1:44 am    Post subject: Reply with quote

Centurion

Joined: 27 Mar 2007
Posts: 142

Problem has been solved from service provider end..
Its an issue with their xml format handling
Thanks all the guys.. for your support.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Character String to XML Structure
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.