SOAP response without proper prefix?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SOAP response without proper prefix?

Robin Diederen
SOAP response without proper prefix?

Hello all,

 

I'm using a pipeline which performs a SOAP call. The SOAP response is (of course) an XML document, which looks like this:


<QueryResponse xmlns:ns1="http://www.somenamespace/parameters" SNIP SNAP xmlns="http://www.someothernamespace/services">
<total>10</total>
</QueryResponse>

Now I want to use the result from this SOAP call on my form. How should I handle this name space collision? On my form I have defined "xmlns="http://www.w3.org/1999/xhtml"" (it wouldn't be very pretty to change this, would it).

 

Can I somehow force a certain namespace / prefix on my SOAP response?

 

Best, Robin



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: SOAP response without proper prefix?

Steve Bayliss
Message
Hi Robin
 
You can use the xslt processor in your pipeline to process the results before they get back to your form - you can reformat the results into whatever format's most convenient for your form.
 
(by the way it's not actually a namespace collision - <total xmlns="http://www.someothernamespace/services">10</total> is identical - eg from an xpath point of view - to <xyz:total xmlns:xyz="http://www.someothernamespace/services">10</xyz:total>, so alternatively just use the appropriate syntax with your own namespace prefix definition within your xform.  It doesn't matter what the actual namespace prefix so long as it is declared correctly to match the - in this case - default namespace in your SOAP response)
 
Regards
Steve
 
-----Original Message-----
From: Robin Diederen [mailto:[hidden email]]
Sent: 02 February 2010 22:25
To: [hidden email]
Subject: [ops-users] SOAP response without proper prefix?

Hello all,

 

I'm using a pipeline which performs a SOAP call. The SOAP response is (of course) an XML document, which looks like this:


<QueryResponse xmlns:ns1="http://www.somenamespace/parameters" SNIP SNAP xmlns="http://www.someothernamespace/services">
<total>10</total>
</QueryResponse>

Now I want to use the result from this SOAP call on my form. How should I handle this name space collision? On my form I have defined "xmlns="http://www.w3.org/1999/xhtml"" (it wouldn't be very pretty to change this, would it).

 

Can I somehow force a certain namespace / prefix on my SOAP response?

 

Best, Robin



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: SOAP response without proper prefix?

Robin Diederen
[ops-users] RE: SOAP response without proper prefix?

Hello Steve,

 

Thanks for the tips!
 

Regarding your first solution: I did find some hints about that, but if possible, I'd like to avoid such a construction, as this would imply my application being harder to maintain. I like to keep things simple :-) (of course, if it has to be done, it has to be done)

 

Your second solution sounds quite interesting, but I don't think I'm getting exactly what you mean. How would I use my own namespace prefix on the form for this SOAP response? Would I have to add this namespace to my xforms:instance tag and adress the elements (prefixed with the namespace) on the form?

 

Best, Robin
 

-----Original message-----
From: Steve Bayliss <[hidden email]>
Sent: Wed 03-02-2010 07:09
To: [hidden email];
Subject: [ops-users] RE: SOAP response without proper prefix?

Hi Robin
 
You can use the xslt processor in your pipeline to process the results before they get back to your form - you can reformat the results into whatever format's most convenient for your form.
 
(by the way it's not actually a namespace collision - <total xmlns="http://www.someothernamespace/services">10</total> is identical - eg from an xpath point of view - to <xyz:total xmlns:xyz="http://www.someothernamespace/services">10</xyz:total>, so alternatively just use the appropriate syntax with your own namespace prefix definition within your xform.  It doesn't matter what the actual namespace prefix so long as it is declared correctly to match the - in this case - default namespace in your SOAP response)
 
Regards
Steve
 
 
-----Original Message-----
From: Robin Diederen [mailto:[hidden email]]
Sent: 02 February 2010 22:25
To: [hidden email]
Subject: [ops-users] SOAP response without proper prefix?

Hello all,

 

I'm using a pipeline which performs a SOAP call. The SOAP response is (of course) an XML document, which looks like this:


<QueryResponse xmlns:ns1="http://www.somenamespace/parameters" SNIP SNAP xmlns="http://www.someothernamespace/services">
<total>10</total>
</QueryResponse>

Now I want to use the result from this SOAP call on my form. How should I handle this name space collision? On my form I have defined "xmlns="http://www.w3.org/1999/xhtml"" (it wouldn't be very pretty to change this, would it).

 

Can I somehow force a certain namespace / prefix on my SOAP response?

 

Best, Robin



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: RE: SOAP response without proper prefix?

Steve Bayliss
Message
Hi Robin
 
You'd use your namespace prefix wherever you want to refer to an element in that namespace.
 
So if you had an xforms:input, you'd have something like
<xforms:input xmlns:xyz="http://www.someothernamespace/services" ref="/xyz:total" .... >
 
Think of it as in the background, the namespace prefix gets expanded to whatever you have declared it as - so it doesn;t matter if the prefixes do not match, so long as the resulting namespaces do.
 
Of course you could declare your namespace prefix anywhere so long as it's in scope where you use it.  So you could define it at the top level of your form if you wanted.
 
Steve
 
-----Original Message-----
From: Robin Diederen [mailto:[hidden email]]
Sent: 03 February 2010 06:49
To: [hidden email]
Subject: [ops-users] RE: SOAP response without proper prefix?

Hello Steve,

 

Thanks for the tips!
 

Regarding your first solution: I did find some hints about that, but if possible, I'd like to avoid such a construction, as this would imply my application being harder to maintain. I like to keep things simple :-) (of course, if it has to be done, it has to be done)

 

Your second solution sounds quite interesting, but I don't think I'm getting exactly what you mean. How would I use my own namespace prefix on the form for this SOAP response? Would I have to add this namespace to my xforms:instance tag and adress the elements (prefixed with the namespace) on the form?

 

Best, Robin
 

-----Original message-----
From: Steve Bayliss <[hidden email]>
Sent: Wed 03-02-2010 07:09
To: [hidden email];
Subject: [ops-users] RE: SOAP response without proper prefix?

Hi Robin
 
You can use the xslt processor in your pipeline to process the results before they get back to your form - you can reformat the results into whatever format's most convenient for your form.
 
(by the way it's not actually a namespace collision - <total xmlns="http://www.someothernamespace/services">10</total> is identical - eg from an xpath point of view - to <xyz:total xmlns:xyz="http://www.someothernamespace/services">10</xyz:total>, so alternatively just use the appropriate syntax with your own namespace prefix definition within your xform.  It doesn't matter what the actual namespace prefix so long as it is declared correctly to match the - in this case - default namespace in your SOAP response)
 
Regards
Steve
 
 
-----Original Message-----
From: Robin Diederen [mailto:[hidden email]]
Sent: 02 February 2010 22:25
To: [hidden email]
Subject: [ops-users] SOAP response without proper prefix?

Hello all,

 

I'm using a pipeline which performs a SOAP call. The SOAP response is (of course) an XML document, which looks like this:


<QueryResponse xmlns:ns1="http://www.somenamespace/parameters" SNIP SNAP xmlns="http://www.someothernamespace/services">
<total>10</total>
</QueryResponse>

Now I want to use the result from this SOAP call on my form. How should I handle this name space collision? On my form I have defined "xmlns="http://www.w3.org/1999/xhtml"" (it wouldn't be very pretty to change this, would it).

 

Can I somehow force a certain namespace / prefix on my SOAP response?

 

Best, Robin



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: RE: SOAP response without proper prefix?

Steve Bayliss
In reply to this post by Robin Diederen
Message
Just to add to that - the first solution should actually make your application easier to maintain in the future.  Consider if the output of your service changes format - you only have to change the xslt once, rather than amending every form you develop that uses the data.
 
 
-----Original Message-----
From: Steve Bayliss [mailto:[hidden email]]
Sent: 03 February 2010 07:02
To: '[hidden email]'
Subject: RE: [ops-users] RE: SOAP response without proper prefix?

Hi Robin
 
You'd use your namespace prefix wherever you want to refer to an element in that namespace.
 
So if you had an xforms:input, you'd have something like
<xforms:input xmlns:xyz="http://www.someothernamespace/services" ref="/xyz:total" .... >
 
Think of it as in the background, the namespace prefix gets expanded to whatever you have declared it as - so it doesn;t matter if the prefixes do not match, so long as the resulting namespaces do.
 
Of course you could declare your namespace prefix anywhere so long as it's in scope where you use it.  So you could define it at the top level of your form if you wanted.
 
Steve
 
-----Original Message-----
From: Robin Diederen [mailto:[hidden email]]
Sent: 03 February 2010 06:49
To: [hidden email]
Subject: [ops-users] RE: SOAP response without proper prefix?

Hello Steve,

 

Thanks for the tips!
 

Regarding your first solution: I did find some hints about that, but if possible, I'd like to avoid such a construction, as this would imply my application being harder to maintain. I like to keep things simple :-) (of course, if it has to be done, it has to be done)

 

Your second solution sounds quite interesting, but I don't think I'm getting exactly what you mean. How would I use my own namespace prefix on the form for this SOAP response? Would I have to add this namespace to my xforms:instance tag and adress the elements (prefixed with the namespace) on the form?

 

Best, Robin
 

-----Original message-----
From: Steve Bayliss <[hidden email]>
Sent: Wed 03-02-2010 07:09
To: [hidden email];
Subject: [ops-users] RE: SOAP response without proper prefix?

Hi Robin
 
You can use the xslt processor in your pipeline to process the results before they get back to your form - you can reformat the results into whatever format's most convenient for your form.
 
(by the way it's not actually a namespace collision - <total xmlns="http://www.someothernamespace/services">10</total> is identical - eg from an xpath point of view - to <xyz:total xmlns:xyz="http://www.someothernamespace/services">10</xyz:total>, so alternatively just use the appropriate syntax with your own namespace prefix definition within your xform.  It doesn't matter what the actual namespace prefix so long as it is declared correctly to match the - in this case - default namespace in your SOAP response)
 
Regards
Steve
 
 
-----Original Message-----
From: Robin Diederen [mailto:[hidden email]]
Sent: 02 February 2010 22:25
To: [hidden email]
Subject: [ops-users] SOAP response without proper prefix?

Hello all,

 

I'm using a pipeline which performs a SOAP call. The SOAP response is (of course) an XML document, which looks like this:


<QueryResponse xmlns:ns1="http://www.somenamespace/parameters" SNIP SNAP xmlns="http://www.someothernamespace/services">
<total>10</total>
</QueryResponse>

Now I want to use the result from this SOAP call on my form. How should I handle this name space collision? On my form I have defined "xmlns="http://www.w3.org/1999/xhtml"" (it wouldn't be very pretty to change this, would it).

 

Can I somehow force a certain namespace / prefix on my SOAP response?

 

Best, Robin



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws