Package com.sun.xml.ws.model.wsdl

Examples of com.sun.xml.ws.model.wsdl.WSDLBoundOperationImpl


  }
 
  private boolean handleOperationInOutElements(WSDLBoundOperation operation,
      XMLStreamReader reader,BindingMode mode){
    QName name = reader.getName();
    WSDLBoundOperationImpl bindingOp = (WSDLBoundOperationImpl)operation;
    if (JSONConstants.QNAME_BODY.equals(name) || SOAPConstants.QNAME_BODY.equals(name)) {
      if(mode == BindingMode.INPUT)
        bindingOp.setInputExplicitBodyParts(parseBodyBinding(reader, bindingOp, mode));
      else if(mode == BindingMode.OUTPUT)
        bindingOp.setOutputExplicitBodyParts(parseBodyBinding(reader, bindingOp, mode));
            goToEnd(reader);
            return true;
        } else if(JSONConstants.QNAME_CONTENT.equals(name) ||
            /* remove in latter by notfiying major users.
             * FOR Support 06 and early users.*/com.sun.xml.rpc.wsdl.document.mime.MIMEConstants.QNAME_CONTENT.equals(name)){
          // Direct content type appears in req/res binding. Vilating BP.
          // But for just content response E.g image this is required to avoid mutipart type
          String type = reader.getAttributeValue(null, "type");
          String part = reader.getAttributeValue(null, "part");
          if(type != null && bindingOp != null){
            if(BindingMode.INPUT == mode){
              // part name , type
              bindingOp.getInputMimeTypes().put(part != null ? part : "main" , type);
            }else{
              bindingOp.getOutputMimeTypes().put(part != null ? part : "main" , type);
            }
          }
          // Special case only in json
          if(com.sun.xml.rpc.wsdl.document.mime.MIMEConstants.QNAME_CONTENT.equals(name)){
            LOG.warning("Your operation json binding mime part using xmlsoap mime (http://schemas.xmlsoap.org/wsdl/mime/) namespace." +
View Full Code Here


            if(method.isAsync())
                continue;
            QName opName = new QName(wsdlBinding.getPortTypeName().getNamespaceURI(), method.getOperationName());

            //patch the soapaction correctly from the WSDL
            WSDLBoundOperationImpl bo = wsdlBinding.get(opName);
            String action = bo.getSOAPAction();
            method.getBinding().setSOAPAction(action);

            boolean isRpclit = method.getBinding().isRpcLit();
            List<ParameterImpl> reqParams = method.requestParams;
            List<ParameterImpl> reqAttachParams = null;
            for(ParameterImpl param:reqParams){
                if(param.isWrapperStyle()){
                    if(isRpclit){
                        WrapperParameter reqParam = (WrapperParameter)param;
                        if(bo.getRequestNamespace() != null){
                            patchRpclitNamespace(bo.getRequestNamespace(), reqParam);
                        }
                        reqAttachParams = applyRpcLitParamBinding(method, (WrapperParameter)param, wsdlBinding, Mode.IN);
                    }
                    continue;
                }
                String partName = param.getPartName();
                if(partName == null)
                    continue;
                ParameterBinding paramBinding = wsdlBinding.getBinding(opName, partName, Mode.IN);
                if(paramBinding != null)
                    param.setInBinding(paramBinding);
            }

            List<ParameterImpl> resAttachParams = null;
            List<ParameterImpl> resParams = method.responseParams;
            for(ParameterImpl param:resParams){
                if(param.isWrapperStyle()){
                    if(isRpclit){
                        WrapperParameter respParam = (WrapperParameter)param;
                        if(bo.getResponseNamespace() != null){
                            patchRpclitNamespace(bo.getResponseNamespace(), respParam);
                        }
                        resAttachParams = applyRpcLitParamBinding(method, (WrapperParameter)param, wsdlBinding, Mode.OUT);
                    }
                    continue;
                }
View Full Code Here

     * @return
     * Returns attachment parameters if/any.
     */
    private List<ParameterImpl> applyRpcLitParamBinding(JavaMethodImpl method, WrapperParameter wrapperParameter, WSDLBoundPortTypeImpl boundPortType, Mode mode) {
        QName opName = new QName(boundPortType.getPortTypeName().getNamespaceURI(), method.getOperationName());
        WSDLBoundOperationImpl bo = boundPortType.get(opName);
        Map<Integer, ParameterImpl> bodyParams = new HashMap<Integer, ParameterImpl>();
        List<ParameterImpl> unboundParams = new ArrayList<ParameterImpl>();
        List<ParameterImpl> attachParams = new ArrayList<ParameterImpl>();
        for(ParameterImpl param : wrapperParameter.wrapperChildren){
            String partName = param.getPartName();
            if(partName == null)
                continue;

            ParameterBinding paramBinding = boundPortType.getBinding(opName,
                    partName, mode);
            if(paramBinding != null){
                if(mode == Mode.IN)
                    param.setInBinding(paramBinding);
                else if(mode == Mode.OUT || mode == Mode.INOUT)
                    param.setOutBinding(paramBinding);

                if(paramBinding.isUnbound()){
                        unboundParams.add(param);
                } else if(paramBinding.isAttachment()){
                    attachParams.add(param);
                }else if(paramBinding.isBody()){
                    if(bo != null){
                        WSDLPartImpl p = bo.getPart(param.getPartName(), mode);
                        if(p != null)
                            bodyParams.put(p.getIndex(), param);
                        else
                            bodyParams.put(bodyParams.size(), param);
                    }else{
View Full Code Here

                operationName;
        }

        //override the @WebMethod.action value by the one from the WSDL
        if(binding != null){
            WSDLBoundOperationImpl bo = binding.getBinding().get(new QName(targetNamespace, operationName));
            if(bo != null){
                WSDLInputImpl wsdlInput = bo.getOperation().getInput();
                String wsaAction = wsdlInput.getAction();
                if(wsaAction != null && !wsdlInput.isDefaultAction())
                    action = wsaAction;
                else
                    action = bo.getSOAPAction();
            }
        }

        javaMethod.setOperationName(operationName);
        SOAPBinding methodBinding =
View Full Code Here

        String reqNamespace = targetNamespace;
        String respNamespace = targetNamespace;

        if(binding != null && binding.getBinding().isRpcLit()){
            QName opQName = new QName(binding.getBinding().getPortTypeName().getNamespaceURI(), operationName);
            WSDLBoundOperationImpl op = binding.getBinding().get(opQName);
            if(op != null){
                //it cant be null, but lets not fail and try to work with service namespce
                if(op.getRequestNamespace() != null){
                    reqNamespace = op.getRequestNamespace();
                }

                //it cant be null, but lets not fail and try to work with service namespce
                if(op.getResponseNamespace() != null){
                    respNamespace = op.getResponseNamespace();
                }
            }
        }

        QName reqElementName = new QName(reqNamespace, operationName);
View Full Code Here

        return binding.getBinding().getBinding(opName, part, mode);
    }

    private WSDLPart getPart(QName opName, String partName, Mode mode){
        if(binding != null){
            WSDLBoundOperationImpl bo = binding.getBinding().get(opName);
            if(bo != null)
                return bo.getPart(partName, mode);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.model.wsdl.WSDLBoundOperationImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.