Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * (c) Copyright IBM Corp 2006 
  */
 
 package com.ibm.wsdl.extensions.soap12;
 
 import java.io.*;
 import org.w3c.dom.*;
 import javax.wsdl.*;
Copied from com.ibm.wsdl.extensions.soap.SOAPAddressSerializer
public class SOAP12AddressSerializer 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
  {
    SOAP12Address soapAddress = (SOAP12Address)extension;
    if (soapAddress != null)
    {
      String tagName =
                                   "address",
                                   def);
      pw.print("      <" + tagName);
                              soapAddress.getLocationURI(),
                              pw);
      Boolean required = soapAddress.getRequired();
      if (required != null)
      {
                                         required.toString(),
                                         def,
                                         pw);
      }
      pw.println("/>");
    }
  }
  public ExtensibilityElement unmarshall(Class parentType,
                                         QName elementType,
                                         Element el,
                                         Definition def,
                                         ExtensionRegistry extReg)
                                           throws WSDLException
	{
    SOAP12Address soapAddress = (SOAP12Address)extReg.createExtension(parentType,
                                                                  elementType);
    String locationURI = DOMUtils.getAttribute(el.);
    String requiredStr = DOMUtils.getAttributeNS(el,
                                                 .,
                                                 .);
    if (locationURI != null)
    {
      soapAddress.setLocationURI(locationURI);
    }
    if (requiredStr != null)
    {
      soapAddress.setRequired(new Boolean(requiredStr));
    }
    return soapAddress;
	}
New to GrepCode? Check out our FAQ X