You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mark Kvistgaard Thomsen <mk...@cdrator.com> on 2013/06/10 09:05:53 UTC

Axis2 response namespaces

Hello

I'm handling a SOAP service, which we build with Ant on Hudson and I'm new to Axis, but one of our clients has asked if we can remove some information from our Webservice response. Namely the ax226 or similar numbers.

Here's an example of a response we send to a request (with some links changed):

<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                <soapenv:Body>
                                <ns:addPromoResponse xmlns:ns="http://soap.company.com">
                                                <ns:return xmlns:ax227="http://core.soap.company.com/xsd" xmlns:ax223="http://service.soap.company.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax226="http://soap.company.com/xsd" xsi:type="ax226:AddPromoResponseDTO">
                                                                <ax226:errorCode xsi:nil="true" />
                                                                <ax226:status>SU</ax226:status>
                                                                <ax226:errorMessage xsi:nil="true" />
                                                                <ax226:errorName xsi:nil="true" />
                                                </ns:return>
                                </ns:addPromoResponse>
                </soapenv:Body>
</soapenv:Envelope>

Our customer has a simple response parser that does not handle the ax226 and ax227 etc. prefixes, but goes straight to the element name. Can the prefixes be removed somehow in the configuration?

Any help appreciated. Thanks in advance.

Best Regards
Mark K. Thomsen


RE: Axis2 response namespaces

Posted by Mark Kvistgaard Thomsen <mk...@cdrator.com>.
Hi Martin

Thanks for your reply. We asked the client to use a better xml parser.

Best regards

Mark Kvistgaard Thomsen
Application Consultant

[cid:image001.jpg@01CE6DC0.EBF3E0A0]

From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: 10. juni 2013 12:33
To: java-user@axis.apache.org
Subject: RE: Axis2 response namespaces

Mark

if you strip off namespaces from the response sent from AxisService to AxisClient
Axis Client will have to *know* the type which can be handled in the client such as setReturnType
call.setReturnType( org.apache.axis.Constants.XSD_STRING );

http://axis.apache.org/axis/java/user-guide.html#Interoperating_with_untyped_servers

you will need the same mechanism for self-describing the type of each element parameter sent up the server

this work for primitive datatypes but as you venture into complex-types each and every element,sublement will need to be 'known' by the same self-describing untyped AxisClient algorithm

Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



________________________________
From: mkt@cdrator.com<ma...@cdrator.com>
To: java-user@axis.apache.org<ma...@axis.apache.org>
Date: Mon, 10 Jun 2013 09:05:53 +0200
Subject: Axis2 response namespaces
Hello

I'm handling a SOAP service, which we build with Ant on Hudson and I'm new to Axis, but one of our clients has asked if we can remove some information from our Webservice response. Namely the ax226 or similar numbers.

Here's an example of a response we send to a request (with some links changed):

<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                <soapenv:Body>
                                <ns:addPromoResponse xmlns:ns="http://soap.company.com">
                                                <ns:return xmlns:ax227="http://core.soap.company.com/xsd" xmlns:ax223="http://service.soap.company.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax226="http://soap.company.com/xsd" xsi:type="ax226:AddPromoResponseDTO">
                                                                <ax226:errorCode xsi:nil="true" />
                                                                <ax226:status>SU</ax226:status>
                                                                <ax226:errorMessage xsi:nil="true" />
                                                                <ax226:errorName xsi:nil="true" />
                                                </ns:return>
                                </ns:addPromoResponse>
                </soapenv:Body>
</soapenv:Envelope>

Our customer has a simple response parser that does not handle the ax226 and ax227 etc. prefixes, but goes straight to the element name. Can the prefixes be removed somehow in the configuration?

Any help appreciated. Thanks in advance.

Best Regards
Mark K. Thomsen


RE: Axis2 response namespaces

Posted by Martin Gainty <mg...@hotmail.com>.
Mark
 
if you strip off namespaces from the response sent from AxisService to AxisClient
Axis Client will have to *know* the type which can be handled in the client such as setReturnType
call.setReturnType( org.apache.axis.Constants.XSD_STRING );
 
http://axis.apache.org/axis/java/user-guide.html#Interoperating_with_untyped_servers
 
you will need the same mechanism for self-describing the type of each element parameter sent up the server

this work for primitive datatypes but as you venture into complex-types each and every element,sublement will need to be 'known' by the same self-describing untyped AxisClient algorithm

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 
From: mkt@cdrator.com
To: java-user@axis.apache.org
Date: Mon, 10 Jun 2013 09:05:53 +0200
Subject: Axis2 response namespaces

Hello I’m handling a SOAP service, which we build with Ant on Hudson and I’m new to Axis, but one of our clients has asked if we can remove some information from our Webservice response. Namely the ax226 or similar numbers. Here’s an example of a response we send to a request (with some links changed): <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">                <soapenv:Body>                                <ns:addPromoResponse xmlns:ns="http://soap.company.com">                                                <ns:return xmlns:ax227="http://core.soap.company.com/xsd" xmlns:ax223="http://service.soap.company.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax226="http://soap.company.com/xsd" xsi:type="ax226:AddPromoResponseDTO">                                                                <ax226:errorCode xsi:nil="true" />                                                                <ax226:status>SU</ax226:status>                                                                <ax226:errorMessage xsi:nil="true" />                                                                <ax226:errorName xsi:nil="true" />                                                </ns:return>                                </ns:addPromoResponse>                </soapenv:Body></soapenv:Envelope> Our customer has a simple response parser that does not handle the ax226 and ax227 etc. prefixes, but goes straight to the element name. Can the prefixes be removed somehow in the configuration? Any help appreciated. Thanks in advance. Best RegardsMark K. Thomsen