Vijay Yadav
Vijay Yadav

Reputation: 11

how to hide / remove "<!--WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)-->" while calling the wsdl link

I have a wsdl file , where in there is a commented part i.e. <!--WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)--> , which gets displayed whenever i make a call to wsdl link through browser. This is regarding web services in java with eclipse as an IDE.

I tried removing that part and validating but still it is showing. I just want that commented part not to be shown when a make call to wsdl link..need help

    wsdl file example:

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://webservice.test.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://webservice.test.com" xmlns:intf="http://webservice.test.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    **<!--WSDL created by Apache Axis version: 1.4
    Built on Apr 22, 2006 (06:55:48 PDT)-->**
     <wsdl:types>
      <schema elementFormDefault="qualified" targetNamespace="http://webservice.test.com" xmlns="http://www.w3.org/2001/XMLSchema">
       <element name="checkDBConnection">
        <complexType/>
       </element>
       <element name="checkDBConnectionResponse">
        <complexType>
         <sequence>
          <element name="checkDBConnectionReturn" type="xsd:boolean"/>
         </sequence>
        </complexType>
       </element>
      </schema>
     </wsdl:types>
    .
    .
    .
    .
    .
    .

Upvotes: 1

Views: 1499

Answers (2)

maksim cekar
maksim cekar

Reputation: 1

You can modify axis.jar:

  1. Open axis.jar with archive tool (e.g. 7zip)
  2. Navigate to \org\apache\axis\i18n\
  3. Open resource.properties file in any text redactor (e.g. notepad++)
  4. Change values to:
  wsdlCreated00={0}

  axisVersion=

  axisVersionRaw=
 
  axisBuiltOnRaw=
  
  axisUserAgent=
 
  builtOn=
  1. Add updated file to axis.jar\org\apache\axis\i18n\

Works on axis 1.4 Result:

State before:

State before

State after:

State after

Upvotes: 0

Stephen C
Stephen C

Reputation: 718788

I don't see any good reason to do this. (And frankly the "security" reason is daft, IMO)

However, here are a couple of ideas.

  1. Find / use a generic XML tool that strips comments.
  2. Use an XSL transform to remove the comments; e.g. XSL to completely remove comments (Including the space)
  3. This Q&A: https://askubuntu.com/questions/525974/how-to-remove-comments-from-an-xml-file explains how to do it using sed.
  4. Download, modify and build your own copy of Apache Axis with the comment generation suppressed.

UPDATE

After rereading your question, I suspect you might be talking about the XML document that is returned in response to an ?wsdl query. If so, I think that option 4 might be your best bet.

Upvotes: 1

Related Questions