All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.wsdl.extensions.http.HTTPUrlReplacementSerializer Maven / Gradle / Ivy

Go to download

Open and Free WSDL library: Web Services Description Language. Libre-wsdl4j is a fork of WSDL4J 1.6.3. WSL4j is a Java stub generator for WSDL. Many software projects still depends on WSL4j, so the idea is that libre-wsdl4j should be an actively maintained version of this software on GitHub. "WSDL, that's an anchronym i haven't heard in almost ten years." Still big in the enterprise world" - comments on the Internet.

The newest version!
/*
 * (c) Copyright IBM Corp 2001, 2005 
 */

package com.ibm.wsdl.extensions.http;

import java.io.*;
import org.w3c.dom.*;
import javax.wsdl.*;
import javax.wsdl.extensions.*;
import javax.wsdl.extensions.http.*;
import javax.xml.namespace.*;
import com.ibm.wsdl.*;
import com.ibm.wsdl.util.xml.*;

/**
 * @author Matthew J. Duftler ([email protected])
 */
public class HTTPUrlReplacementSerializer implements ExtensionSerializer, ExtensionDeserializer, Serializable {
  public static final long serialVersionUID = 1;

  public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException {
    HTTPUrlReplacement httpUrlReplacement = (HTTPUrlReplacement) extension;

    if (httpUrlReplacement != null) {
      String tagName = DOMUtils.getQualifiedValue(HTTPConstants.NS_URI_HTTP, "urlReplacement", def);

      pw.print("        <" + tagName);

      Boolean required = httpUrlReplacement.getRequired();

      if (required != null) {
        DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw);
      }

      pw.println("/>");
    }
  }

  public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException {
    HTTPUrlReplacement httpUrlReplacement = (HTTPUrlReplacement) extReg.createExtension(parentType, elementType);
    String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED);

    if (requiredStr != null) {
      httpUrlReplacement.setRequired(Boolean.valueOf(requiredStr));
    }

    return httpUrlReplacement;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy