Package com.sun.xml.ws.wsdl.writer
Class WSDLGenerator
- java.lang.Object
-
- com.sun.xml.ws.wsdl.writer.WSDLGenerator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classWSDLGenerator.JAXWSOutputSchemaResolverImplements the SchemaOutputResolver used by JAXB to
-
Constructor Summary
Constructors Constructor Description WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container, Class implType, boolean inlineSchemas, boolean disableXmlSecurity, WSDLGeneratorExtension... extensions)Creates the WSDLGeneratorWSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container, Class implType, boolean inlineSchemas, WSDLGeneratorExtension... extensions)Creates the WSDLGenerator
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultcreateOutputFile(String namespaceUri, String suggestedFileName)Creates theResultobject used by JAXB to generate a schema for the namesapceUri namespace.voiddoGeneration()Performes the actual WSDL generationprotected voidgenerateBinding()Generates the Binding section of the WSDLprotected voidgenerateBindingOperation(JavaMethodImpl method, Binding binding)protected voidgenerateDocumentParameterOrder(Operation operation, JavaMethodImpl method)Generates the parameterOrder for a PortType operationprotected voidgenerateInputMessage(Operation operation, JavaMethodImpl method)protected voidgenerateMessages()Generates the WSDL messagesprotected voidgenerateOutputMessage(Operation operation, JavaMethodImpl method)protected voidgenerateParameterOrder(Operation operation, JavaMethodImpl method)Generates the parameterOrder for a PortType operationprotected voidgeneratePortType()Generates the WSDL portTypeprotected voidgenerateRpcParameterOrder(Operation operation, JavaMethodImpl method)Generates the parameterOrder for a PortType operationprotected voidgenerateService()Generates the Service section of the WSDLprotected voidgenerateSOAP12BindingOperation(JavaMethodImpl method, Binding binding)protected voidgenerateSOAP12Headers(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message)protected voidgenerateSOAPHeaders(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message)protected voidgenerateSOAPMessages(JavaMethodImpl method, SOAPBinding binding)Generates messages for a SOAPBindingprotected voidgenerateTypes()Generates the types section of the WSDLprotected booleanisAttachmentParameter(ParameterImpl parameter)protected booleanisBodyParameter(ParameterImpl parameter)Determines if a parameter is associated with the message Bodyprotected booleanisHeaderParameter(ParameterImpl parameter)protected booleanisRpcLit(JavaMethodImpl method)Determines if aJavaMethodis rpc/literalprotected booleanisWrapperStyle(JavaMethodImpl method)Determines if themethodis wrapper styleprotected StringmangleName(String name)protected static Stringrelativize(String uri, String baseUri)Relativizes a URI by using another URI (base URI.)voidsetEndpointAddress(String address)Sets the endpoint address string to be written.protected List<ParameterImpl>sortMethodParameters(JavaMethodImpl method)Sorts the parameters for the method by their positionprotected voidsplitParameters(List<ParameterImpl> bodyParams, List<ParameterImpl> headerParams, List<ParameterImpl> params)
-
-
-
Field Detail
-
XsdNs
public static final String XsdNs
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WSDLGenerator
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container, Class implType, boolean inlineSchemas, WSDLGeneratorExtension... extensions)
Creates the WSDLGenerator- Parameters:
model- TheAbstractSEIModelImplused to generate the WSDLwsdlResolver- TheWSDLResolverto use resovle names while generating the WSDLbinding- specifies whichBindingTypeto generateextensions- an arrayWSDLGeneratorExtensionthat will be invoked to generate WSDL extensions
-
WSDLGenerator
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container, Class implType, boolean inlineSchemas, boolean disableXmlSecurity, WSDLGeneratorExtension... extensions)
Creates the WSDLGenerator- Parameters:
model- TheAbstractSEIModelImplused to generate the WSDLwsdlResolver- TheWSDLResolverto use resovle names while generating the WSDLbinding- specifies whichBindingTypeto generatedisableXmlSecurity- specifies whether to disable the secure xml processing featureextensions- an arrayWSDLGeneratorExtensionthat will be invoked to generate WSDL extensions
-
-
Method Detail
-
setEndpointAddress
public void setEndpointAddress(String address)
Sets the endpoint address string to be written. Defaults toREPLACE_WITH_ACTUAL_URL.- Parameters:
address- wsdl:port/soap:address/[@location] value
-
doGeneration
public void doGeneration()
Performes the actual WSDL generation
-
generateTypes
protected void generateTypes()
Generates the types section of the WSDL
-
generateMessages
protected void generateMessages()
Generates the WSDL messages
-
generateSOAPMessages
protected void generateSOAPMessages(JavaMethodImpl method, SOAPBinding binding)
Generates messages for a SOAPBinding- Parameters:
method- TheJavaMethodto generate messages forbinding- TheSOAPBindingto add the generated messages to
-
generatePortType
protected void generatePortType()
Generates the WSDL portType
-
isWrapperStyle
protected boolean isWrapperStyle(JavaMethodImpl method)
Determines if themethodis wrapper style- Parameters:
method- TheJavaMethodto check if it is wrapper style- Returns:
- true if the method is wrapper style, otherwise, false.
-
isRpcLit
protected boolean isRpcLit(JavaMethodImpl method)
Determines if aJavaMethodis rpc/literal- Parameters:
method- The method to check- Returns:
- true if method is rpc/literal, otherwise, false
-
generateParameterOrder
protected void generateParameterOrder(Operation operation, JavaMethodImpl method)
Generates the parameterOrder for a PortType operation- Parameters:
operation- The operation to generate the parameterOrder formethod- TheJavaMethodto generate the parameterOrder from
-
generateRpcParameterOrder
protected void generateRpcParameterOrder(Operation operation, JavaMethodImpl method)
Generates the parameterOrder for a PortType operation- Parameters:
operation- the operation to generate the parameterOrder formethod- theJavaMethodto generate the parameterOrder from
-
generateDocumentParameterOrder
protected void generateDocumentParameterOrder(Operation operation, JavaMethodImpl method)
Generates the parameterOrder for a PortType operation- Parameters:
operation- the operation to generate the parameterOrder formethod- theJavaMethodto generate the parameterOrder from
-
sortMethodParameters
protected List<ParameterImpl> sortMethodParameters(JavaMethodImpl method)
Sorts the parameters for the method by their position- Parameters:
method- theJavaMethodused to sort the parameters- Returns:
- the sorted
Listof parameters
-
isBodyParameter
protected boolean isBodyParameter(ParameterImpl parameter)
Determines if a parameter is associated with the message Body- Parameters:
parameter- the parameter to check- Returns:
- true if the parameter is a
bodyparameter
-
isHeaderParameter
protected boolean isHeaderParameter(ParameterImpl parameter)
-
isAttachmentParameter
protected boolean isAttachmentParameter(ParameterImpl parameter)
-
generateBinding
protected void generateBinding()
Generates the Binding section of the WSDL
-
generateBindingOperation
protected void generateBindingOperation(JavaMethodImpl method, Binding binding)
-
generateSOAP12BindingOperation
protected void generateSOAP12BindingOperation(JavaMethodImpl method, Binding binding)
-
splitParameters
protected void splitParameters(List<ParameterImpl> bodyParams, List<ParameterImpl> headerParams, List<ParameterImpl> params)
-
generateSOAPHeaders
protected void generateSOAPHeaders(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message)
-
generateSOAP12Headers
protected void generateSOAP12Headers(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message)
-
generateService
protected void generateService()
Generates the Service section of the WSDL
-
generateInputMessage
protected void generateInputMessage(Operation operation, JavaMethodImpl method)
-
generateOutputMessage
protected void generateOutputMessage(Operation operation, JavaMethodImpl method)
-
createOutputFile
public Result createOutputFile(String namespaceUri, String suggestedFileName) throws IOException
Creates theResultobject used by JAXB to generate a schema for the namesapceUri namespace.- Parameters:
namespaceUri- The namespace for the schema being generatedsuggestedFileName- the JAXB suggested file name for the schema file- Returns:
- the
Resultfor JAXB to generate the schema into - Throws:
IOException- thrown if on IO error occurs
-
relativize
protected static String relativize(String uri, String baseUri)
Relativizes a URI by using another URI (base URI.)For example,
relative("http://www.sun.com/abc/def","http://www.sun.com/pqr/stu") => "../abc/def"This method only works on hierarchical URI's, not opaque URI's (refer to the java.net.URI javadoc for complete definitions of these terms.
This method will not normalize the relative URI.
- Parameters:
uri- the URI to relativizebaseUri- the base URI to use for the relativization- Returns:
- the relative URI or the original URI if a relative one could not be computed
-
-