Your SAS programs, embedded in web apps and elsewhere

SAS Bi Web Services XML <axis2ns...

Reply
Regular Contributor
Posts: 229

SAS Bi Web Services XML <axis2ns...

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>

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

         <mSmiley SurprisedrSalesResult>

            <axis2ns128Smiley Frustratedtreams 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

            <axis2ns128Smiley Frustratedtreams 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?

Regular Contributor
Posts: 229

SAS Bi Web Services XML <axis2ns...

no one??

SAS Super FREQ
Posts: 683

SAS Bi Web Services XML <axis2ns...

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">
<xslSmiley Surprisedutput
  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

Ask a Question
Discussion stats
  • 2 replies
  • 405 views
  • 0 likes
  • 2 in conversation