Package org.apache.axis.handlers.soap

Examples of org.apache.axis.handlers.soap.SOAPService


      }
        }

  // Otherwise, use the container support
  if (!clientSpecified) {
      SOAPService soapService = context.getService();
      if (soapService != null) {
    // A client configuration exists for this service.  Check
    // to see if there is a HandlerInfoChain configured on it.
    hiChainFactory = (HandlerInfoChainFactory)
            soapService.getOption(Constants.ATTR_HANDLERINFOCHAIN);
      }
  }

  if (hiChainFactory == null) {
      return;
View Full Code Here


        category.info( "Deploying service: " + name );
        String            hName = null ;
        Handler            tmpH = null ;
        StringTokenizer      st = null ;
        SOAPService     service = null ;
        Chain                c  = null ;

        if ( pivot == null && request == null && response == null )
            throw new AxisFault( "Admin.error",
                "Services must use targeted chains",
                null, null );

        service = (SOAPService) sr.find( name );

        if ( service == null ) service = new SOAPService();
        else              service.clear();

        if ( request != null && !"".equals(request) ) {
            st = new StringTokenizer( request, " \t\n\r\f," );
            c  = null ;
            while ( st.hasMoreElements() ) {
                if ( c == null )
                    service.setRequestHandler( c = new SimpleChain() );
                hName = st.nextToken();
                tmpH = hr.find( hName );
                if ( tmpH == null )
                    throw new AxisFault( "Admin.error",
                        "Unknown handler: " + hName,
                        null, null );
                c.addHandler( tmpH );
            }
        }

        if ( pivot != null && !"".equals(pivot) ) {
            tmpH = hr.find(pivot);
            if (tmpH == null)
                throw new AxisFault("Deploying service " + name +
                    ": couldn't find pivot Handler '" + pivot + "'");

            service.setPivotHandler( tmpH );

            if (pivot.equals("MsgDispatcher")) {
                ServiceDescription sd = new ServiceDescription("msgService", false);
                service.setServiceDescription(sd);
            }
        }

        if ( response != null && !"".equals(response) ) {
            st = new StringTokenizer( response, " \t\n\r\f," );
            c  = null ;
            while ( st.hasMoreElements() ) {
                if ( c == null )
                    service.setResponseHandler( c = new SimpleChain() );
                hName = st.nextToken();
                tmpH = hr.find( hName );
                if ( tmpH == null )
                    throw new AxisFault( "Admin.error",
                        "Unknown handler: " + hName,
View Full Code Here

  {
    ServiceClient.initialize();
    AxisServer server = new AxisServer();
    HandlerRegistry hr = (HandlerRegistry) server.getHandlerRegistry();
    Handler disp = hr.find("RPCDispatcher");   
    SOAPService service = new SOAPService(disp);
    service.addOption("className", "test.encoding.TestArrayListConversions");
    service.addOption("methodName", "*");
   
    server.deployService(SERVICE_NAME, service);
   
    client = new ServiceClient(new LocalTransport(server));
  }
View Full Code Here

    public void setServiceHandler(Handler sh)
    {
        category.debug("MessageContext: setServiceHandler("+sh+")");
        serviceHandler = sh;
        if (sh != null && sh instanceof SOAPService) {
            SOAPService service = (SOAPService)sh;
            TypeMappingRegistry tmr = service.getTypeMappingRegistry();
            setTypeMappingRegistry(tmr);
           
            if (serviceDesc == null) {
                serviceDesc = service.getServiceDescription();
            }
        }
    }
View Full Code Here

        if (log.isDebugEnabled())
            log.debug("Enter: JavaProvider::generateWSDL (" + this + ")");

        /* Find the service we're invoking so we can grab it's options */
        /***************************************************************/
        SOAPService service = msgContext.getService();
        ServiceDesc serviceDesc = service.getInitializedServiceDesc(msgContext);

        // Calculate the appropriate namespaces for the WSDL we're going
        // to put out.
        //
        // If we've been explicitly told which namespaces to use, respect
        // that.  If not:
        //
        // The "interface namespace" should be either:
        // 1) The namespace of the ServiceDesc
        // 2) The transport URL (if there's no ServiceDesc ns)

        try {
            // Location URL is whatever is explicitly set in the MC
            String locationUrl =
                    msgContext.getStrProp(MessageContext.WSDLGEN_SERV_LOC_URL);

            if (locationUrl == null) {
                // If nothing, try what's explicitly set in the ServiceDesc
                locationUrl = serviceDesc.getEndpointURL();
            }

            if (locationUrl == null) {
                // If nothing, use the actual transport URL
                locationUrl = msgContext.getStrProp(MessageContext.TRANS_URL);
            }

            // Interface namespace is whatever is explicitly set
            String interfaceNamespace =
                    msgContext.getStrProp(MessageContext.WSDLGEN_INTFNAMESPACE);

            if (interfaceNamespace == null) {
                // If nothing, use the default namespace of the ServiceDesc
                interfaceNamespace = serviceDesc.getDefaultNamespace();
            }

            if (interfaceNamespace == null) {
                // If nothing still, use the location URL determined above
                interfaceNamespace = locationUrl;
            }

//  Do we want to do this?
//
//            if (locationUrl == null) {
//                locationUrl = url;
//            } else {
//                try {
//                    URL urlURL = new URL(url);
//                    URL locationURL = new URL(locationUrl);
//                    URL urlTemp = new URL(urlURL.getProtocol(),
//                            locationURL.getHost(),
//                            locationURL.getPort(),
//                            urlURL.getFile());
//                    interfaceNamespace += urlURL.getFile();
//                    locationUrl = urlTemp.toString();
//                } catch (Exception e) {
//                    locationUrl = url;
//                    interfaceNamespace = url;
//                }
//            }

            Emitter emitter = new Emitter();

            // service alias may be provided if exact naming is required,
            // otherwise Axis will name it according to the implementing class name
            String alias = (String)service.getOption("alias");
            if(alias != null) emitter.setServiceElementName(alias);

            Style style = serviceDesc.getStyle();
            if (style == Style.RPC) {
                emitter.setMode(Emitter.MODE_RPC);
            } else if (style == Style.DOCUMENT) {
                emitter.setMode(Emitter.MODE_DOCUMENT);
            } else if (style == Style.WRAPPED) {
                emitter.setMode(Emitter.MODE_DOC_WRAPPED);
            }

            emitter.setClsSmart(serviceDesc.getImplClass(), locationUrl);

            // If a wsdl target namespace was provided, use the targetNamespace.
            // Otherwise use the interfaceNamespace constructed above.
            String targetNamespace = (String) service.getOption(OPTION_WSDL_TARGETNAMESPACE);
            if (targetNamespace == null ||
                targetNamespace.length() == 0) {
                targetNamespace = interfaceNamespace;
            }
            emitter.setIntfNamespace(targetNamespace);

            emitter.setLocationUrl(locationUrl);
            emitter.setServiceDesc(serviceDesc);
            emitter.setTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                   getTypeMapping(Constants.URI_DEFAULT_SOAP_ENC));
            emitter.setDefaultTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                          getDefaultTypeMapping());

            String wsdlPortType = (String) service.getOption(OPTION_WSDL_PORTTYPE);
            String wsdlServiceElement = (String) service.getOption(OPTION_WSDL_SERVICEELEMENT);
            String wsdlServicePort = (String) service.getOption(OPTION_WSDL_SERVICEPORT);

            if (wsdlPortType != null && wsdlPortType.length() > 0) {
                emitter.setPortTypeName(wsdlPortType);
            }
            if (wsdlServiceElement != null && wsdlServiceElement.length() > 0) {
View Full Code Here

                } else {
                    msgContext.setTargetService(body.getNamespaceURI());
                }
            }

            SOAPService svc = msgContext.getService();
            if (svc != null) {
                svc.setPropertyParent(scopedProperties);
            } else {
                msgContext.setPropertyParent(scopedProperties);
            }
        }
        if (log.isDebugEnabled()) {
View Full Code Here

     */
    public void setClientHandlers(Handler reqHandler, Handler respHandler)
    {
        // Create a SOAPService which will be used as the client-side service
        // handler.
        setSOAPService(new SOAPService(reqHandler, null, respHandler));
    }
View Full Code Here

                            serviceName = pathInfo.substring(1);
                        } else {
                            serviceName = pathInfo;
                        }

                        SOAPService s = engine.getService(serviceName);
                        if (s == null) {
                            // no such service....
                            response.setStatus(java.net.HttpURLConnection.HTTP_NOT_FOUND);
                            response.setContentType("text/html");
                            writer.println("<h2>" +
View Full Code Here

        MessageContext msgContext = context.getMessageContext();

        // Obtain our possible operations
        if (operations == null && msgContext != null) {
            SOAPService service    = msgContext.getService();
            if (service != null) {
                ServiceDesc serviceDesc =
                        service.getInitializedServiceDesc(msgContext);
               
                String lc = Utils.xmlNameToJava(name);
                if (serviceDesc == null) {
                    AxisFault.makeFault(
                            new ClassNotFoundException(
View Full Code Here

        if (!accessAllHeaders) {
            MessageContext mc = MessageContext.getCurrentContext();
            if (mc != null) {
                if (header != null) {
                    String actor = header.getActor();
                    SOAPService soapService = mc.getService();
                    if (soapService != null) {
                        ArrayList actors = mc.getService().getActors();
                        if ((actor != null) &&
                            !Constants.URI_SOAP11_NEXT_ACTOR.equals(actor) &&
                            (actors == null || !actors.contains(actor))) {
View Full Code Here

TOP

Related Classes of org.apache.axis.handlers.soap.SOAPService

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.