soap header sin espacio de nombre y prefijos

Posted by melinav on 25-Apr-2014 14:49

Estamos desarrollando una aplicación que necesita acceder a un webservice desarrollado por un tercero. Para poder hacer uso de los métodos del mismo debemos enviar en el soap-header datos de autenticación pero debe respetar si o si la siguiente estructura: 


<soapenv:Envelope> 
<soapenv:Header> 
<user> nombreDeUsuario </user> 
<pwd> contraseña </pwd> 
</soapenv:Header> 
<soapenv:Body> 
… 
</soapenv:Body> 
</soapenv:Envelope> 




Progress permite customizar el soap-header de cada request, pero si o si debemos indicarle un espacio de nombre (namespace) lo que provoca que al ejecutarse el método se agreguen unos prefijos a cada elemento del soap-header, quedando de la siguiente manera: 


<soapenv:Envelope> 
<soapenv:Header> 
<ns0:user xlmns="url"> nombreDeUsuario </ns0:user> 
<ns0:pwd xlmns="url" > contraseña </ns0:pwd> 
</soapenv:Header> 
<soapenv:Body> 
… 
</soapenv:Body> 
</soapenv:Envelope> 




Y por esta razón el webservice no reconoce los mismos devolviendonos un error que indica que no reconoce los elementos. 

Existe alguna manera de poder generar ese soap-header sin la necesidad de enviarle el espacio de nombre y por ende sin los prefijos? 

All Replies

Posted by ezequielmontoya on 28-Apr-2014 11:19

Hola, somos pocos hispanohablantes por aquí y yo no sé responderte ese tema.

Te recomiendo postear en inglés, como en tus otras publicaciones.

Posted by Bill Wood on 28-Apr-2014 11:39

(For the Spanish-challenged readers, here is a Google Translate for the Question)

We are developing an application that needs to access a webservice developed by a third party. To use the same methods to ship in the soap -header authentication data but must respect if or if the following structure:

<soapenv:Envelope>
<soapenv:Header>
<user> username < / user>
<pwd> password < / pwd >
< / soapenv : Header>
<soapenv:Body>
...
< / soapenv : Body>
< / soapenv : Envelope>

Progress can customize the soap -header of each request , but if we tell whether a namespace (namespace ) which causes the method to run some prefixes are added to each element of the soap -header , being as follows:

<soapenv:Envelope>
<soapenv:Header>
<ns0:user xlmns="url"> username < / ns0 : user>
<ns0:pwd xlmns="url" > password < / ns0 : pwd >
< / soapenv : Header>
<soapenv:Body>
...
< / soapenv : Body>
< / soapenv : Envelope>

And for this reason the webservice does not recognize them by returning an error saying it does not recognize the elements.

Is there any way to generate the soap -header without the need to send the namespace and therefore without prefixes ?

Posted by Marian Edu on 28-Apr-2014 11:41

will give it a try although not in Spanish :)

how do you set the header value, using set-node or set-serialized
methods of soad-header-entryref object you add to soad-header?

set-node will add namespaces as needed while set-serialize will just set
the xml content as send, never tried that though.

[collapse]On 04/28/2014 07:20 PM, ezequielmontoya wrote:
>[collapse] From: ezequielmontoya
> Post: RE: soap header sin espacio de nombre y prefijos
> Posted in: OpenEdge Development
> Link: http://community.progress.com/technicalusers/f/19/p/9784/37138.aspx#37138
>
> Hola, somos pocos hispanohablantes por aquí y yo no sé responderte ese tema.
> Te recomiendo postear en inglés, como en tus otras publicaciones.
>
>
> --
> You were sent this email because you opted to receive email notifications when someone created a new thread.
>
> To unsubscribe[collapse] from:
> - ...only this thread, disable notifications at http://community.progress.com/technicalusers/f/19/p/9784/37138.aspx#37138.
> - ...all email notifications from Progress Community, navigate to "Settings", click on the "Email" tab, then under the "Email Configuration" section, set Send Notifications to "No".
>
>


--
m.edu
keep it simple
http://www.ganimede.ro
http://ro.linkedin.com/in/marianedu
medu@ganimede.ro
mobile: +40 740 036 212
skype: marian.edu[/collapse][/collapse][/collapse]

Posted by melinav on 28-Apr-2014 12:00

I use set-serialized but give me the next error:

"... Error en SET-SERIALIZE: (16454)

**El atributo SET-SERIALIZED en SOAP-HEADER-ENTRYREF widget contiene argumentos que no son válidos. (4065)..."

Posted by Marian Edu on 29-Apr-2014 01:22

huh, it does look like a namespace is required for soap header entry...
attaching one node that was not created with namespace will not raise an
error but get-serialize returns null, name and localname same :(

the only thing you might try is to use the soapenv namespace for the
node(s) you're adding and see if that changes anything, normally having
the same namespace as it's parent should remove the namespace
declaration from the node but who knows

xDoc:CREATE-NODE-NAMESPACE(xNode,
'http://www.w3.org/2003/05/soap-envelope', 'user', 'element').
xDoc:CREATE-NODE(xValue, '', 'text').
xValue:NODE-VALUE = 'toto'.
xNode:APPEND-CHILD(xValue).

CREATE SOAP-HEADER hSOAPHeader.
CREATE SOAP-HEADER-ENTRYREF hshEntry.
hSOAPHeader:ADD-HEADER-ENTRY (hshEntry).

hshEntry:SET-NODE(xNode).


[collapse]On 04/28/2014 08:01 PM, melinav wrote:
>[collapse] From: melinav
> Post: RE: soap header sin espacio de nombre y prefijos
> Posted in: OpenEdge Development
> Link: http://community.progress.com/technicalusers/f/19/p/9784/37146.aspx#37146
>
> I use set-serialized but give me the next error:
> "... Error en SET-SERIALIZE: (16454)
> **El atributo SET-SERIALIZED en SOAP-HEADER-ENTRYREF widget contiene argumentos que no son válidos. (4065)..."
>
>
> --
> You were sent this email because you opted to receive email notifications when someone created a new thread.
>
> To unsubscribe[collapse] from:
> - ...only this thread, disable notifications at http://community.progress.com/technicalusers/f/19/p/9784/37146.aspx#37146.
> - ...all email notifications from Progress Community, navigate to "Settings", click on the "Email" tab, then under the "Email Configuration" section, set Send Notifications to "No".
>
>


--
m.edu
keep it simple
http://www.ganimede.ro
http://ro.linkedin.com/in/marianedu
medu@ganimede.ro
mobile: +40 740 036 212
skype: marian.edu[/collapse][/collapse][/collapse]

Posted by melinav on 29-Apr-2014 06:07

Hi! yes a try to use the soapenv namespace but addme the prefix "soapenv". And I need the structure without namespace and prefixes... :(

Posted by Marian Edu on 29-Apr-2014 08:26

then guess you're out of luck, might want to try bringing this to TS for
a chance... or end-up making your own web-service request using http,
I'm doing that already for some time and if done right you can even get
it to work with things like WS-Security, WS-Addressing, WS-Trust (hint:
fiddler is your friend then might need a bunch of RFCs and oasis
standards reads)


[collapse]On 04/29/2014 02:07 PM, melinav wrote:
>[collapse] From: melinav
> Post: RE: soap header sin espacio de nombre y prefijos
> Posted in: OpenEdge Development
> Link: http://community.progress.com/technicalusers/f/19/p/9784/37177.aspx#37177
>
> Hi! yes a try to use the soapenv namespace but addme the prefix "soapenv". And I need the structure without namespace and prefixes... :(
>
>
> --
> You were sent this email because you opted to receive email notifications when someone created a new thread.
>
> To unsubscribe[collapse] from:
> - ...only this thread, disable notifications at http://community.progress.com/technicalusers/f/19/p/9784/37177.aspx#37177.
> - ...all email notifications from Progress Community, navigate to "Settings", click on the "Email" tab, then under the "Email Configuration" section, set Send Notifications to "No".
>
>


--
m.edu
keep it simple
http://www.ganimede.ro
http://ro.linkedin.com/in/marianedu
medu@ganimede.ro
mobile: +40 740 036 212
skype: marian.edu[/collapse][/collapse][/collapse]

Posted by melinav on 29-Apr-2014 09:23

yes i have fiddler!!! A huge friend! jaja

Thank you so much for you help medu!!!

This thread is closed