Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7940139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:18:03+00:00 2026-06-03T23:18:03+00:00

I am trying to parse a WSDL to get the operations, endpoint and an

  • 0

I am trying to parse a WSDL to get the operations, endpoint and an example payload. The WSDL in inputted by the user. I can’t find a tutorial to do this.

I can only find ones that generate source code which I don’t need. I’ve tried using XBeans but apparently I need Saxon. Is there a simple lightweight way to do this without Saxon?

E.g.

   <?xml version="1.0"?>
  <definitions name="StockQuote"
  targetNamespace=
    "http://example.com/stockquote.wsdl"
  xmlns:tns="http://example.com/stockquote.wsdl"
  xmlns:xsd1="http://example.com/stockquote.xsd"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns="http://schemas.xmlsoap.org/wsdl/">
   <types>
   <schema targetNamespace=
     "http://example.com/stockquote.xsd"
     xmlns="http://www.w3.org/2000/10/XMLSchema">
      <element name="TradePriceRequest">
        <complexType>
           <all>
             <element name="tickerSymbol" 
               type="string"/>
           </all>
        </complexType>
      </element>
      <element name="TradePrice">
        <complexType>
          <all>
            <element name="price" type="float"/>
          </all>
        </complexType>
      </element>
   </schema>
   </types>
   <message name="GetLastTradePriceInput">
     <part name="body" element=
       "xsd1:TradePriceRequest"/>
   </message>
   <message name="GetLastTradePriceOutput">
     <part name="body" element="xsd1:TradePrice"/>
   </message>
   <portType name="StockQuotePortType">
     <operation name="GetLastTradePrice">
       <input message="tns:GetLastTradePriceInput"/>
       <output message="tns:GetLastTradePriceOutput"/>
     </operation>
   </portType>
     <binding name="StockQuoteSoapBinding"
       type="tns:StockQuotePortType">
       <soap:binding style="document"
         transport=
           "http://schemas.xmlsoap.org/soap/http"/>
     <operation name="GetLastTradePrice">
       <soap:operation
         soapAction=
           "http://example.com/GetLastTradePrice"/>
         <input>
           <soap:body use="literal"/>
         </input>
         <output>
           <soap:body use="literal"/>
         </output>
       </operation>
     </binding>
     <service name="StockQuoteService">
       <documentation>My first service</documentation>
       <port name="StockQuotePort" 
         binding="tns:StockQuoteBinding">
         <soap:address location=
           "http://example.com/stockquote"/>
       </port>
     </service>
    </definitions>

Should get operations: GetLastTradePrice, GetLastTradePrice

Endpoint: StockQuotePort

Sample Payload:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:stoc="http://example.com/stockquote.xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <stoc:TradePriceRequest/>
   </soapenv:Body>
</soapenv:Envelope>

This is like what SoapUI does. But I’m mainly concerned with being able to parse the WSDL. A bit more context is the WSDL is uploaded and then the result is displayed in a GWT application (file upload must go to the servlet). So I need to parse the file and create an object the GWT will be able to understand.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:18:05+00:00Added an answer on June 3, 2026 at 11:18 pm

    This looks nice: http://www.membrane-soa.org/soa-model-doc/1.4/java-api/parse-wsdl-java-api.htm

    Didn’t work on first attempt for me though, So I wrote a method that returns the suggested results for the sample wsdl – no dependencies outside of J2SE6.

    public String[] listOperations(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
      Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new FileInputStream(filename));
      NodeList elements = d.getElementsByTagName("operation");
      ArrayList<String> operations = new ArrayList<String>();
      for (int i = 0; i < elements.getLength(); i++) {
        operations.add(elements.item(i).getAttributes().getNamedItem("name").getNodeValue());
      }
      return operations.toArray(new String[operations.size()]);
    }
    

    Seems like you would want to remove the duplicates, since each operation is listed twice in WSDL. That’s easy using a Set. Uploaded complete eclipse project that shows both unique and non-unique results here: https://github.com/sek/wsdlparser

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to parse out this xml file to get a list of Elements but
Am trying to parse this HTML document to get the contents of flight, time,
Trying to parse Maplines for an airport. Each airport can have X number of
Trying to parse some XML but apparently this is too much for a lazy
I'm trying to parse a log file that looks like this: %%%% 09-May-2009 04:10:29
I'm trying to parse phone number with regex. Exactly I want to get a
Im trying to parse an JSON response string to my class objects.. I can't
Im trying to parse a Soap ProbeMatch message with XMLPullParser. I receive this via
I trying to parse this string: $right = '34601)S(1,6)[2] - 34601)(11)[2] + 34601)(3)[2,4]'; with
I have an xml feed at this url Now im trying parse the content,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.