Package com.ibm.di.connector.axis2.util
Class WSUtils
- java.lang.Object
-
- com.ibm.di.connector.axis2.util.WSUtils
-
public class WSUtils extends java.lang.Object
Utility class , providing various methods for managing Axis 2 web services.
-
-
Constructor Summary
Constructors Constructor Description WSUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Vector
createAllAxisServicesFromWSDLFile(java.lang.String wsdl)
Returns all services from the given WSDL file.static java.util.Vector
createAllAxisServicesFromWSDLFile(java.lang.String wsdl, boolean isServerSide)
Returns all services from the given WSDL file.static java.util.Vector
createAllAxisServicesFromWSDLFile(java.lang.String wsdl, boolean isServerSide, java.lang.String username, java.lang.String password)
/** Returns all services from the given WSDL file.static org.apache.axis2.description.AxisService
createAxisServiceFromWSDLFile(java.lang.String wsdlFile, java.lang.String serviceName)
Creates a specified service object from the WSDL file.static org.apache.axis2.description.AxisService
createAxisServiceFromWSDLFile(java.lang.String wsdlFile, java.lang.String serviceName, boolean isServerSide)
Creates a specified service object from the WSDL file.static org.apache.axis2.description.AxisService
createAxisServiceFromWSDLFile(java.lang.String wsdlFile, java.lang.String serviceName, boolean isServerSide, java.lang.String username, java.lang.String password)
Creates a specified service object from the WSDL file.static java.util.Vector
getServiceEndPointNames(java.lang.String wsdlFile, java.lang.String serviceName)
Retrieves the endpoint names from the give WSDL file for the given service.static java.util.Vector
getServiceOperationNames(java.lang.String wsdlFile, java.lang.String serviceName)
Returns service operation names from the give WSDL file for the given service.static Attribute
getSOAPHeader(org.apache.axiom.soap.SOAPEnvelope envelope, java.lang.String attributeName, Entry e)
Returns the SOAP Header as TDI Hierarchical Attribute from a given SOAP Envelope.static boolean
isWSDL20(java.net.URL wsdlURL)
This method determines the version of the WSDL file which corresponds to the given URL.static boolean
isWSDL20(java.net.URL wsdlURL, java.lang.String username, java.lang.String password)
This method determines the version of the WSDL file which corresponds to the given URL.static void
setSOAPHeader(org.apache.axiom.soap.SOAPEnvelope envelope, Attribute soapHeaderHAttr)
Sets the SOAP Envelope header to the provided TDI Hierarchical Attribute.static void
storeContent(java.net.URL wsdlURL, java.lang.String username, java.lang.String password, java.lang.String proxyHost, java.lang.Object proxyPort, java.lang.String proxyUser, java.lang.String proxyPass)
static org.w3c.dom.Element
toDOM(org.apache.axiom.om.OMElement src, org.w3c.dom.Document doc)
Converts Apache AXIOM element to W3C DOM Element, i.e.static org.apache.axiom.om.OMElement
toOM(org.w3c.dom.Element src)
Converts W3C DOM Element to Apache AXIOM element.static org.apache.axiom.om.OMElement
toOM(org.w3c.dom.Element src, org.apache.axiom.om.OMFactory factory)
Converts W3C DOM Element to Apache AXIOM element.static Attribute
verifyAttribute(Attribute a, javax.xml.namespace.QName qname)
Verifies that the passed Attribute has the required prefix/localName/namespace and that its child is aText
object
-
-
-
Method Detail
-
toDOM
public static org.w3c.dom.Element toDOM(org.apache.axiom.om.OMElement src, org.w3c.dom.Document doc)
Converts Apache AXIOM element to W3C DOM Element, i.e. to TDI Hierarchical Attribute.- Parameters:
src
- The AXIOM element which will be converted.doc
- The document used to create all needed DOM information.- Returns:
- DOM Element object which corresponds to the AXIOM element.
-
toOM
public static org.apache.axiom.om.OMElement toOM(org.w3c.dom.Element src)
Converts W3C DOM Element to Apache AXIOM element. It uses the default OMFactory.- Parameters:
src
- The element which will be converted.- Returns:
- AXIOM element corresponding to the source DOM Element object.
-
toOM
public static org.apache.axiom.om.OMElement toOM(org.w3c.dom.Element src, org.apache.axiom.om.OMFactory factory)
Converts W3C DOM Element to Apache AXIOM element. It uses the provided OMFactory.- Parameters:
src
- The element which will be converted.factory
- The desired OMFacotry for the convertion.- Returns:
- AXIOM element corresponding to the source DOM Element object.
-
isWSDL20
public static boolean isWSDL20(java.net.URL wsdlURL) throws java.lang.Exception
This method determines the version of the WSDL file which corresponds to the given URL.- Parameters:
wsdlURL
- The URL to the WSDL file.username
- Uername for http auth.password
- Password for http auth.- Returns:
- Returns true if the WSDL file version 2.0 and false if it is 1.1.
- Throws:
java.lang.Exception
- The WSDL version cannot be recognized. *
-
isWSDL20
public static boolean isWSDL20(java.net.URL wsdlURL, java.lang.String username, java.lang.String password) throws java.lang.Exception
This method determines the version of the WSDL file which corresponds to the given URL.- Parameters:
wsdlURL
- The URL to the WSDL file.username
- Uername for http auth.password
- Password for http auth.- Returns:
- Returns true if the WSDL file version 2.0 and false if it is 1.1.
- Throws:
java.lang.Exception
- The WSDL version cannot be recognized. *
-
createAllAxisServicesFromWSDLFile
public static java.util.Vector createAllAxisServicesFromWSDLFile(java.lang.String wsdl) throws java.lang.Exception
Returns all services from the given WSDL file. The services are created from server point of view - this affects the input/output message creation.- Parameters:
wsdl
- The location to the WSDL file.- Returns:
- Vector object with all services in the WSDL file.
- Throws:
java.lang.Exception
- If an Exception occurs during the process. Check the Exception message for more details.
-
createAllAxisServicesFromWSDLFile
public static java.util.Vector createAllAxisServicesFromWSDLFile(java.lang.String wsdl, boolean isServerSide) throws java.lang.Exception
Returns all services from the given WSDL file. The services are created from server or client point of view - this affects the input/output message creation.- Parameters:
wsdl
- The location to the WSDL file.isServerSide
- If true the services will be created form server point of view. If false - from client point of view.- Returns:
- Vector object with all services in the WSDL file.
- Throws:
java.lang.Exception
- If an Exception occurs during the process. Check the Exception message for more details.
-
createAllAxisServicesFromWSDLFile
public static java.util.Vector createAllAxisServicesFromWSDLFile(java.lang.String wsdl, boolean isServerSide, java.lang.String username, java.lang.String password) throws java.lang.Exception
/** Returns all services from the given WSDL file. The services are created from server or client point of view - this affects the input/output message creation.- Parameters:
wsdl
- The location to the WSDL file.isServerSide
- If true the services will be created form server point of view. If false - from client point of view.username
- Username for http authenticationpassword
- Password for http authentication- Returns:
- Vector object with all services in the WSDL file.
- Throws:
java.lang.Exception
-
storeContent
public static void storeContent(java.net.URL wsdlURL, java.lang.String username, java.lang.String password, java.lang.String proxyHost, java.lang.Object proxyPort, java.lang.String proxyUser, java.lang.String proxyPass) throws java.io.IOException
- Throws:
java.io.IOException
-
createAxisServiceFromWSDLFile
public static org.apache.axis2.description.AxisService createAxisServiceFromWSDLFile(java.lang.String wsdlFile, java.lang.String serviceName) throws java.lang.Exception
Creates a specified service object from the WSDL file. The service is created from server point of view - this affects the input/output message creation.- Parameters:
wsdlFile
- The location to the WSDL file.serviceName
- The service name of the service which will be created.- Returns:
- A service object generated from the WSDL file.
- Throws:
java.lang.Exception
- If an Exception occurs during the process. Check the Exception message for more details.
-
createAxisServiceFromWSDLFile
public static org.apache.axis2.description.AxisService createAxisServiceFromWSDLFile(java.lang.String wsdlFile, java.lang.String serviceName, boolean isServerSide) throws java.lang.Exception
Creates a specified service object from the WSDL file. The service is created from server or client point of view - this affects the input/output message creation.- Parameters:
wsdlFile
- The location to the WSDL file.serviceName
- The service name of the service which will be created.isServerSide
- If true the service will be created form server point of view. If false - from client point of view.- Returns:
- A service object generated from the WSDL file.
- Throws:
java.lang.Exception
- If an Exception occurs during the process. Check the Exception message for more details.
-
createAxisServiceFromWSDLFile
public static org.apache.axis2.description.AxisService createAxisServiceFromWSDLFile(java.lang.String wsdlFile, java.lang.String serviceName, boolean isServerSide, java.lang.String username, java.lang.String password) throws java.lang.Exception
Creates a specified service object from the WSDL file. The service is created from server or client point of view - this affects the input/output message creation.- Parameters:
wsdlFile
- The location to the WSDL file.serviceName
- The service name of the service which will be created.isServerSide
- If true the service will be created form server point of view. If false - from client point of view.- Returns:
- A service object generated from the WSDL file.
- Throws:
java.lang.Exception
- If an Exception occurs during the process. Check the Exception message for more details.
-
getServiceEndPointNames
public static java.util.Vector getServiceEndPointNames(java.lang.String wsdlFile, java.lang.String serviceName) throws java.lang.Exception
Retrieves the endpoint names from the give WSDL file for the given service.- Parameters:
wsdlFile
- The location to the WSDL file.serviceName
- The service name of the service from which the endpoint will be extracted.- Returns:
- Vector with Endpoint names of the service.
- Throws:
java.lang.Exception
- If an Exception occurs during the process. Check the Exception message for more details.
-
getServiceOperationNames
public static java.util.Vector getServiceOperationNames(java.lang.String wsdlFile, java.lang.String serviceName) throws java.lang.Exception
Returns service operation names from the give WSDL file for the given service.- Parameters:
wsdlFile
- The location to the WSDL file.serviceName
- The service name of the service from which the operations will be extracted.- Returns:
- Vector with Operation names of the service.
- Throws:
java.lang.Exception
- If an Exception occurs during the process. Check the Exception message for more details.
-
getSOAPHeader
public static Attribute getSOAPHeader(org.apache.axiom.soap.SOAPEnvelope envelope, java.lang.String attributeName, Entry e)
Returns the SOAP Header as TDI Hierarchical Attribute from a given SOAP Envelope.- Parameters:
envelope
- The Envelope from which the headers will be extracted.attributeName
- The name of the TDI Hierarchical Attribute to which the Envelope Header will be written.e
- The entry which is used to manipulate the TDI Hierarchical Attribute.- Returns:
- TDI Hierarchical Attribute which contains the SOAP Header information.
-
setSOAPHeader
public static void setSOAPHeader(org.apache.axiom.soap.SOAPEnvelope envelope, Attribute soapHeaderHAttr)
Sets the SOAP Envelope header to the provided TDI Hierarchical Attribute.- Parameters:
envelope
- The SOAP Envelope which will be populated with the headers information.soapHeaderHAttr
- The TDI Hierarchical Attribute containing the SOAP Headers.
-
verifyAttribute
public static Attribute verifyAttribute(Attribute a, javax.xml.namespace.QName qname)
Verifies that the passed Attribute has the required prefix/localName/namespace and that its child is aText
object- Parameters:
a
- The TDI Attribute.qname
- The name which will be used for the TDI Attribute if it is not already set..- Returns:
- the correct Attribute to use.
-
-