Greetings.

I have a custom transport that I am using. The releavant classes are attached to this mail.

When I try to execute via Dynamic Invocation Interface, everything works fine but when I try to execute it with the JAXRPC generated classes from wsdl2java, the client says the following:

0 DEBUG [main] com.bmw.candy.protocol.CandyProtocolHandlerInitializer - -------> initProtocolPackages(): Enter
0 DEBUG [main] com.bmw.candy.protocol.CandyProtocolHandlerInitializer - java.protocol.handler.pkgs = com.bmw.candy.protocol
0 DEBUG [main] com.bmw.candy.protocol.CandyProtocolHandlerInitializer - <------- initProtocolPackages(): Exit
672 DEBUG [main] com.bmw.candy.candiedAxis.demo.CandiedAxisConfig - -------> CandiedAxisConfig(): Enter
688 DEBUG [main] com.bmw.candy.candiedAxis.demo.CandiedAxisConfig - -------> CandiedAxisConfig(): Exit
719 DEBUG [main] com.bmw.candy.candiedAxis.transport.CandiedTransport - -------> CandiedTransport(): Enter
719 DEBUG [main] com.bmw.candy.candiedAxis.transport.CandiedTransport - <------- CandiedTransport(): Exit
828 DEBUG [main] com.bmw.candy.candiedAxis.transport.CandiedTransport - -------> setupMessageContextImpl(MessageContext, Call, AxisEngine): Enter
828 DEBUG [main] com.bmw.candy.candiedAxis.transport.CandiedTransport - -------> createHeaders(MessageContext): Enter
828 DEBUG [main] com.bmw.candy.candiedAxis.transport.CandiedTransport - <------- createHeaders(MessageContext): Exit
844 DEBUG [main] com.bmw.candy.candiedAxis.transport.CandiedTransport - <------- setupMessageContextImpl(MessageContext, Call, AxisEngine): Exit
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: No client transport named 'candy' found!
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:No client transport named 'candy' found!
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:150)
at org.apache.axis.client.Call.invokeEngine(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2720)
at org.apache.axis.client.Call.invoke(Call.java:2396)
at org.apache.axis.client.Call.invoke(Call.java:2319)
at org.apache.axis.client.Call.invoke(Call.java:1776)
at com.bmw.candy.candiedAxis.demo.generated.axis.version.VersionSoapBindingStub.getVersion(VersionSoapBindingStub.java:100)
at com.bmw.candy.candiedAxis.demo.VersionClientW2J.main(VersionClientW2J.java:50)


   {http://xml.apache.org/axis/}hostname:pc3

No client transport named 'candy' found!
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:150)
at org.apache.axis.client.Call.invokeEngine(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2720)
at org.apache.axis.client.Call.invoke(Call.java:2396)
at org.apache.axis.client.Call.invoke(Call.java:2319)
at org.apache.axis.client.Call.invoke(Call.java:1776)
at com.bmw.candy.candiedAxis.demo.generated.axis.version.VersionSoapBindingStub.getVersion(VersionSoapBindingStub.java:100)
at com.bmw.candy.candiedAxis.demo.VersionClientW2J.main(VersionClientW2J.java:50)


Now obviously something is wrong here but after hours of work, I cant find out how to do it right. I would appreciate it if someone could look at the file and find out let me know how I can fix this.

-- Robert
/*
 *    File: CandiedAxisConfig.java
 * Package: com.bmw.candy.candiedAxis.demo
 * 
 * Copyright(c) 10-Dec-2004 by BMW Group. All rights reserved. 
 * Written by developers at jambit (www.jambit.com) for BMW Group. 
 * 
 ************* DO NOT EDIT ABOVE THIS LINE ************* */

package com.bmw.candy.candiedAxis.demo;

import javax.xml.namespace.QName;

import org.apache.axis.ConfigurationException;
import org.apache.axis.Handler;
import org.apache.axis.SimpleTargetedChain;
import org.apache.axis.client.Call;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.configuration.BasicClientConfig;
import org.apache.commons.logging.Log;

import com.bmw.candy.candiedAxis.transport.CandiedSender;
import com.bmw.candy.candiedAxis.transport.CandiedTransport;

/**
 * SimpleProvider
 */
class CandiedAxisConfig extends BasicClientConfig {
    /** The logging instance */
    private final static Log LOG = 
LogFactory.getLog(CandiedAxisConfig.class.getName());

    /** Candy transport package name. */
    final static String CANDY_PROTOCOL_PKG = CandiedTransport.class.getPackage()
                                                                   .getName();

    /**
     * Create the configuration.
     */
    CandiedAxisConfig() {
        if (LOG.isDebugEnabled())
            LOG.debug("-------> CandiedAxisConfig(): Enter"); //$NON-NLS-1$

        // -- Create chain for Candy and deploy the transport.
        CandiedSender sender = new CandiedSender();
        SimpleTargetedChain chain = new SimpleTargetedChain(sender);
        deployTransport(CandiedTransport.DEFAULT_NAME, chain); //$NON-NLS-1$

        // -- Tell Call to use candy transport for candy URLs.
        Call.addTransportPackage(CANDY_PROTOCOL_PKG);
        Call.setTransportForProtocol(CandiedTransport.DEFAULT_NAME,
                                     CandiedTransport.class);

        if (LOG.isDebugEnabled())
            LOG.debug("-------> CandiedAxisConfig(): Exit"); //$NON-NLS-1$
    }
}

/* ************* End of File ************* */
/*
 *    File: VersionClientDII.java
 * Package: com.bmw.candy.candiedServices.client
 * 
 * Copyright(c) 18-Nov-2004 by BMW Group. All rights reserved. 
 * Written by developers at jambit (www.jambit.com) for BMW Group. 
 * 
 ************* DO NOT EDIT ABOVE THIS LINE ************* */

package com.bmw.candy.candiedAxis.demo;

import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.XMLType;

import org.apache.axis.EngineConfiguration;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import com.bmw.candy.candiedAxis.transport.CandiedTransport;
import com.bmw.candy.protocol.CandyProtocolHandlerInitializer;

/**
 * A Demo of Candied Axis that calls the VersionService in Axis using DII.
 */
public class VersionClientDII {
    /** Prefix for VersionClient namespace URI URLs. */
    final static String PREFIX_NS_URI = 
"http://localhost:8080/Candied_Services/services/";; //$NON-NLS-1$

    /** Prefix for VersionClient endpoint URLs. */
    final static String PREFIX_END_URL = 
"candy://localhost:12345/Candied_Services/services/"; //$NON-NLS-1$

    /** Prefix for VersionClient WSDL URLs. */
    final static String PREFIX_WSDL_URL = 
"http://localhost:8080/Candied_Services/services/";; //$NON-NLS-1$

    /** Candy transport package name. */
    final static String CANDY_PROTOCOL_PKG = CandiedTransport.class.getPackage()
                                                                   .getName();

    static {
        CandyProtocolHandlerInitializer.initProtocolPackages();
    }

    public static void main(final String[] args) {
        try {
            final String namespaceURI = PREFIX_NS_URI + "Version"; //$NON-NLS-1$
            final String remoteURL = PREFIX_END_URL + "Version"; //$NON-NLS-1$
            final String opName = "getVersion"; //$NON-NLS-1$
            final EngineConfiguration config = new CandiedAxisConfig();

            final Service service = new Service(config);
            final Call call = (Call) service.createCall();
            call.setTargetEndpointAddress(remoteURL);
            call.setReturnType(XMLType.XSD_STRING);
            call.setOperationName(new QName(namespaceURI, opName));
            final String response = (String) call.invoke(new Object[0]);
            System.out.println(response);
        } catch (final Exception ex) {
            ex.printStackTrace();
        }
    }
}

/* ************* End of File ************* */
/*
 *    File: VersionClientW2J.java
 * Package: com.bmw.candy.candiedAxis.demo
 * 
 * Copyright(c) 09-Dec-2004 by BMW Group. All rights reserved. 
 * Written by developers at jambit (www.jambit.com) for BMW Group. 
 * 
 ************* DO NOT EDIT ABOVE THIS LINE ************* */

package com.bmw.candy.candiedAxis.demo;

import org.apache.axis.client.Call;

import com.bmw.candy.candiedAxis.demo.generated.axis.version.Version;
import com.bmw.candy.candiedAxis.demo.generated.axis.version.VersionService;
import 
com.bmw.candy.candiedAxis.demo.generated.axis.version.VersionServiceLocator;
import com.bmw.candy.candiedAxis.transport.CandiedTransport;
import com.bmw.candy.protocol.CandyProtocolHandlerInitializer;

/**
 * A version client that takes advantage of the <code>wsdl2java</code> Axis
 * Ant task.
 */
public class VersionClientW2J {
    /** Candy transport package name. */
    final static String CANDY_PROTOCOL_PKG = CandiedTransport.class.getPackage()
                                                                   .getName();

    /** Endpoint URL. */
    final static String ENDPT_URL = 
"candy://localhost:12345/Candied_Services/services/"; //$NON-NLS-1$

    static {
        CandyProtocolHandlerInitializer.initProtocolPackages();
    }

    /** Endpoint URL. */

    public static void main(final String[] args) {
        try {
            final VersionServiceLocator locator = new VersionServiceLocator();
            locator.setEngineConfiguration(new CandiedAxisConfig());
            Call.addTransportPackage(CANDY_PROTOCOL_PKG);
            Call.setTransportForProtocol(CandiedTransport.DEFAULT_NAME,
                                         CandiedTransport.class);
            locator.setEndpointAddress("Version", ENDPT_URL);

            // -- execute the call and get the result.
            final VersionService versionService = locator;
            final Version version = versionService.getVersion(); //$NON-NLS-1$
            System.out.println(version.getVersion());
        } catch (final Exception ex) {
            ex.printStackTrace();
        }
    }
}

/* ************* End of File ************* */
begin:vcard
fn:Robert Simmons Jr
n:Simmons Jr;Robert
org:jambit GmbH
adr;quoted-printable:;;R=C3=B6ntgenstrasse 7;Martinsried;;82152;Germany
email;internet:[EMAIL PROTECTED]
title:Senior Software Architect / Consultant
note:Author: "Hardcore Java", O'Reilly and Associates, (2004) http://www.oreilly.com/catalog/hardcorejv/index.html
x-mozilla-html:TRUE
url:http://www.jambit.com
version:2.1
end:vcard

Reply via email to