/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Builds all possible pseudo schemas for async operation ResponseBean to feed to XJC.
*
* @author Vivek Pandey
*/
public class PseudoSchemaBuilder {
" xmlns=\"http://java.sun.com/xml/ns/jaxb\"\n" +
" xmlns:wsa=\"http://www.w3.org/2005/08/addressing\"\n" +
" xmlns:xjc=\"http://java.sun.com/xml/ns/jaxb/xjc\"\n" +
" version=\"2.1\">\n" +
" \n" +
" <bindings scd=\"x-schema::wsa\" if-exists=\"true\">\n" +
//comment the following, otw JAXB won't generate ObjectFactory, classes from wsa schema. See JAX-WS-804
// " <schemaBindings map=\"false\" />\n" +
" <bindings scd=\"wsa:EndpointReference\">\n" +
" <class ref=\"javax.xml.ws.wsaddressing.W3CEndpointReference\" xjc:recursive=\"true\"/>\n" +
" </bindings>\n" +
" <bindings scd=\"~wsa:EndpointReferenceType\">\n" +
" <class ref=\"javax.xml.ws.wsaddressing.W3CEndpointReference\" xjc:recursive=\"true\"/>\n" +
" </bindings>\n" +
" </bindings>\n" +
"</bindings>";
" xmlns=\"http://java.sun.com/xml/ns/jaxb\"\n" +
" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"\n" +
" version=\"2.1\">\n" +
" \n" +
" <bindings scd=\"x-schema::wsa\" if-exists=\"true\">\n" +
//comment the following, otw JAXB won't generate ObjectFactory, classes from wsa schema. See JAX-WS-804
// " <schemaBindings map=\"false\" />\n" +
" <bindings scd=\"wsa:EndpointReference\">\n" +
" <class ref=\"com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference\"/>\n" +
" </bindings>\n" +
" <bindings scd=\"~wsa:EndpointReferenceType\">\n" +
" <class ref=\"com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference\"/>\n" +
" </bindings>\n" +
" </bindings>\n" +
"</bindings>";
public static List<InputSource> build(WSDLModeler wsdlModeler, WsimportOptions options, ErrorReceiver errReceiver) {
b.wsdlModeler = wsdlModeler;
b.build();
int i;
}
//add w3c EPR binding
}
//TODO: uncomment after JAXB fixes the issue related to passing multiples of such bindings
//add member submission EPR binding
// InputSource is1 = new InputSource(new ByteArrayInputStream(memberSubmissionEPR.getBytes()));
// is1.setSystemId(sysId+(++i + 1));
// b.schemas.add(is1);
return b.schemas;
}
this.wsdlDocument = _wsdl;
}
private void build() {
}
}
return;
//lets try and see if its SOAP 1.2. dont worry about extension flag, its
// handled much earlier
if (soapBinding == null) {
}
if(soapBinding == null)
return;
//we dont want to process the port bound to the binding processed earlier
return;
// get only the bounded operations
continue;
}
}
}
/**
* @param portType
* @param operation
* @param bindingOperation
*/
private void buildAsync(PortType portType, Operation operation, BindingOperation bindingOperation) {
if(operationName == null)
return;
if(outputMessage != null){
if(options.additionalHeaders) {
List<MessagePart> addtionalHeaderParts = wsdlModeler.getAdditionHeaderParts(bindingOperation, outputMessage, false);
}
}
}
String operationName = (jaxwsCustomization != null)?((jaxwsCustomization.getMethodName() != null)?jaxwsCustomization.getMethodName().getName():null):null;
if(operationName != null){
return null;
}
return operationName;
}
}
for(MessagePart p:parts){
if(!uris.contains(ns) && !ns.equals("http://www.w3.org/2001/XMLSchema") && !ns.equals(elementName.getNamespaceURI())){
}
}
}
boolean asyncRespBeanBinding = false;
"<xs:schema xmlns:xs=''http://www.w3.org/2001/XMLSchema''" +
" xmlns:jaxb=''http://java.sun.com/xml/ns/jaxb''" +
" xmlns:xjc=''http://java.sun.com/xml/ns/jaxb/xjc''" +
" jaxb:extensionBindingPrefixes=''xjc''" +
" jaxb:version=''1.0''" +
" targetNamespace=''{0}''>",
if(!asyncRespBeanBinding){
"<xs:annotation><xs:appinfo>" +
" <jaxb:schemaBindings>" +
" <jaxb:package name=''{0}'' />" +
" </jaxb:schemaBindings>" +
"</xs:appinfo></xs:annotation>",
asyncRespBeanBinding = true;
}
print("<xs:complexType>");
print("<xs:sequence>");
for(MessagePart p:allParts) {
//rpclit wsdl:part must reference schema type not element, also it must exclude headers and mime parts
print("<xs:element ref=''types:{0}'' xmlns:types=''{1}''/>",p.getDescriptor().getLocalPart(), p.getDescriptor().getNamespaceURI());
}else{
print("<xs:element name=''{0}'' type=''{1}'' xmlns=''{2}'' />",
p.getName(),
p.getDescriptor().getLocalPart(),
p.getDescriptor().getNamespaceURI() );
}
}
print("</xs:sequence>");
print("</xs:complexType>");
print("</xs:element>");
print("</xs:schema>");
// reset the StringWriter, so that next operation element could be written
//System.out.println("Response bean Schema for operation========> "+ elementName+"\n\n"+buf);
}
}
if(operationName == null)
return null;
// String namespaceURI = wsdlDocument.getDefinitions().getTargetNamespaceURI()+"?"+portType.getName()+"?" + operationName;
}
}
}
}
}
}
}