addFaultInfo(faults,minfo);
Iterator paramlist = null;
//add each parameter to parameter list
if ("document".equals(bindingEntry.getBindingStyle().getName())){
paramlist = op.getInput().getMessage().getParts().values().iterator();
Part part = (Part) paramlist.next();
QName minfoqname;
element = symbolTable.getElement(part.getElementName());
if ( element == null ) {
// the part reference a type.
qname = symbolTable.getType(part.getTypeName()).getQName();
minfoqname = symbolTable.getType(part.getTypeName()).getQName();
}
else {
qname = element.getRefType().getQName();
minfoqname = element.getQName();
}
if (qname != null){
minfo.setInputMessage(minfoqname);
System.out.println(minfoqname.getLocalPart()+"setInputMessage.............?????????????");
type = this.typeMap.getType(qname);
boolean wrapped = true; //TODO take this from a commandline argument
if (wrapped){
if(type == null)
throw new WrapperFault("unregisterd type "+qname+" refered");
else{
/* if(type.getLanguageSpecificName().startsWith(">")){*/ //anyway skip the wrapping element type even if it is a named type.
//get inner attributes and elements and add them as parameters
ArrayList elementlist = new ArrayList();
Iterator names = type.getElementnames();
while (names.hasNext()){
elementlist.add(names.next());
}
Type innerType;
for (int i = 0 ; i < elementlist.size(); i++) {
String elementname = (String)elementlist.get(i);
innerType = type.getElementForElementName(elementname).getType();
pinfo = new ParameterInfo(innerType,elementname);
pinfo.setElementName(type.getElementForElementName(elementname).getName());
if (innerType.getName().equals(CUtils.anyTypeQname))
pinfo.setAnyType(true);
minfo.addInputParameter(pinfo);
}
//remove the type that represents the wrapping element so that such type is not created.
//following is commented for the moment because the same element can be refered by more
//than one message. Also this complex type may be used as a type while it is the wrapping
//element here
//this.typeMap.removeType(qname);
}
}
else{
}
}
}
else{
minfo.setInputMessage(op.getInput().getMessage().getQName());
if (op.getParameterOrdering() != null){
for (int ix=0; ix < op.getParameterOrdering().size(); ix++){
Part p = (Part)(op.getInput().getMessage().getParts().get((String)op.getParameterOrdering().get(ix)));
if (p == null) continue;
pinfo = createParameterInfo(p);
if (null != pinfo) minfo.addInputParameter(pinfo);
}
}
else {
paramlist = op.getInput().getMessage().getParts().values().iterator();
while (paramlist.hasNext()) { //RPC style messages can have multiple parts
Part p = (Part) paramlist.next();
pinfo = createParameterInfo(p);
if (null != pinfo) minfo.addInputParameter(pinfo);
}
}
}
//get the return type
if(op.getOutput()!=null){
Iterator returnlist = op.getOutput().getMessage().getParts().values().iterator();
if (returnlist.hasNext() && "document".equals(bindingEntry.getBindingStyle().getName())){
Part part = (Part) returnlist.next();
QName minfoqname;
element = symbolTable.getElement(part.getElementName());
if ( element == null ) {
// the part reference a type.
qname = symbolTable.getType(part.getTypeName()).getQName();
minfoqname = symbolTable.getType(part.getTypeName()).getQName();
}
else {
qname = element.getRefType().getQName();
minfoqname = element.getQName();
}
if (qname != null){
minfo.setOutputMessage(minfoqname);
type = this.typeMap.getType(qname);
boolean wrapped = true; //TODO take this from a commandline argument
if (wrapped){
if(type == null)
throw new WrapperFault("unregisterd type "+qname+" refered");
else{
/*if(type.getLanguageSpecificName().startsWith(">")){*///anyway skip the wrapping element type even if it is a named type.
//get inner attributes and elements and add them as parameters
ArrayList elementlist = new ArrayList();
Iterator names = type.getElementnames();
while (names.hasNext()){
elementlist.add(names.next());
}
Type innerType;
for (int i = 0 ; i < elementlist.size(); i++) {
String elementname = (String)elementlist.get(i);
innerType = type.getElementForElementName(elementname).getType();
pinfo = new ParameterInfo(innerType,elementname);
pinfo.setElementName(type.getElementForElementName(elementname).getName());
if (innerType.getName().equals(CUtils.anyTypeQname))
pinfo.setAnyType(true);
minfo.addOutputParameter(pinfo);
}
//remove the type that represents the wrapping element so that such type is not created.
//following is commented for the moment because the same element can be refered by more
//than one message. Also this complex type may be used as a type while it is the wrapping
//element here
//this.typeMap.removeType(qname);
}
}
else{
}
}
}
else{
//added on 1-jun-2004
minfo.setInputMessage(op.getInput().getMessage().getQName());
minfo.setOutputMessage(op.getOutput().getMessage().getQName());
// minfo.setFaultMessage();
if (op.getParameterOrdering() != null){
for (int ix=0; ix < op.getParameterOrdering().size(); ix++){
Part p = (Part)(op.getOutput().getMessage().getParts().get((String)op.getParameterOrdering().get(ix)));
if (p == null) continue;
pinfo = createParameterInfo(p);
if (null != pinfo) minfo.addOutputParameter(pinfo);
}
/* there can be more output parameters than in parameterOrder list (partial parameter ordering) */
returnlist = op.getOutput().getMessage().getParts().values().iterator();
while (returnlist.hasNext()) { //RPC style messages can have multiple parts
Part p = (Part) returnlist.next();
if (op.getParameterOrdering().contains(p.getName())) continue;
pinfo = createParameterInfo(p);
if (null != pinfo) minfo.addOutputParameter(pinfo);
}
}
else {
returnlist = op.getOutput().getMessage().getParts().values().iterator();
while (returnlist.hasNext()) { //RPC style messages can have multiple parts
Part p = ((Part) returnlist.next());
pinfo = createParameterInfo(p);
if (null != pinfo) minfo.addOutputParameter(pinfo);
}
}
}