BookmarkSubscribeRSS Feed
Filipvdr
Pyrite | Level 9

I have a stored process deployed as web service.

When I use soap to retrieve the Wsdl and to use the webservice i retrieve an XML file which looks like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

   <soapenv:Body>

      <m:orSalesResponse xmlns:m="http://tempuri.org/orWS">

         <m:orSalesResult>

            <axis2ns128:Streams xmlns:axis2ns128="http://tempuri.org/orWS">

               <axis2ns129:_WEBOUT contentType="text/xml;charset=windows-1252" xmlns:axis2ns129="http://tempuri.org/orWS">

                  <axis2ns130:Value xmlns:axis2ns130="http://tempuri.org/orWS">

                     <TABLE>

                        <ORSALES>

                           <Product_Category>Assorted Sports Articles</Product_Category>

                           <Profit>9994898.76</Profit>

                        </ORSALES>

                        <ORSALES>

                           <Product_Category>Children Sports</Product_Category>

                           <Profit>2417119.78</Profit>

                        </ORSALES>

                        <ORSALES>

                           <Product_Category>Clothes</Product_Category>

                           <Profit>9208375.41</Profit>

                        </ORSALES>

                        <ORSALES>

next time i run it

            <axis2ns128:Streams xmlns:axis2ns128="http://tempuri.org/orWS">

               <axis2ns129:_WEBOUT contentType="text/xml;charset=windows-1252" xmlns:axis2ns129="http://tempuri.org/orWS">

                  <axis2ns130:Value xmlns:axis2ns130="http://tempuri.org/orWS">

but actually i want these axis2ns rules to be gone. any ideas?

2 REPLIES 2
Filipvdr
Pyrite | Level 9

no one??

BrunoMueller
SAS Super FREQ

Hi Filipvdr

Check out the follwoing code below it uses Proc XSL (preproduction) to remove the names space information.

*
* remove name space stuff from XML response
*
* taken from http://wiki.tei-c.org/index.php/Remove-Namespaces.xsl
*;

filename rmns temp;
data _null_;
 
infile cards;
 
input;
 
file rmns;
  put _infile_;
cards4;
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
  method="xml"
  indent="no"/>

<xsl:template
  match="/|comment()|processing-instruction()">
  <xsl:copy>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="*">
  <xsl:element
    name="{local-name()}">
    <xsl:apply-templates
      select="@*|node()"/>
  </xsl:element>
</xsl:template>

<xsl:template match="@*">
  <xsl:attribute
    name="{local-name()}">
    <xsl:value-of
      select="."/>
  </xsl:attribute>
</xsl:template>
</xsl:stylesheet>
;;;;

*
* use XSL to remove namespace information
*;

filename xslout temp;
proc xsl
  in=soapout
  out=xslout
  xsl=rmns
;
run;

Bruno

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1286 views
  • 0 likes
  • 2 in conversation