[jbossws-users] [JBossWS] - Set WS-Configuration

ethan1980 do-not-reply at jboss.com
Wed May 23 10:56:18 EDT 2007


Hi all,

I have created client artifacts with wsconsume from wsdl. I have a class service like:

package com.hp.som.handlers.webservices.impl;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;


/**
 * JBossWS Generated Source
 * 
 * Generation Date: Tue May 22 16:55:09 CEST 2007
 * 
 * This generated source code represents a derivative work of the input to
 * the generator that produced it. Consult the input for the copyright and
 * terms of use that apply to this source code.
 * 
 * JAX-WS Version: 2.0
 * 
 */
@WebServiceClient(name = "TestService", targetNamespace = "http://som.hp.som/com/hp/som/handlers/webservices/impl", wsdlLocation = "WEB-INF/wsdl/TestBean.wsdl")
public class TestService_Service
    extends Service
{

    private final static URL TESTSERVICE_WSDL_LOCATION;

    static {
        URL url = null;
        /*try {
            url = new File("WEB-INF/wsdl/TestBean.xml").toURL();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }*/
        TESTSERVICE_WSDL_LOCATION = url;
    }

    public TestService_Service(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }

    public TestService_Service() {
        super(TESTSERVICE_WSDL_LOCATION, new QName("http://som.hp.som/com/hp/som/handlers/webservices/impl", "TestService"));
    }

    /**
     * 
     * @return
     *     returns TestService
     */
    @WebEndpoint(name = "TestServicePort")
    public TestService getTestServicePort() {
        return (TestService)super.getPort(new QName("http://som.hp.som/com/hp/som/handlers/webservices/impl", "TestServicePort"), TestService.class);
    }

}

...

I want configure ws-security of this mode:

TestService_Service service = new TestService_Service();
String configFilePath = initConfigFilePath(ctx);
		if ( (configFilePath != null) && (!"".equals(configFilePath.trim())))  {
			URL securityURL = new File(configFilePath).toURL();
			((ServiceExt)service).setSecurityConfig(securityURL.toExternalForm());
		}

My problem is that i cant cast TestService_Service in ServiceExt for set security config and i want not create Service like Service.create(url,qname).

Thanks in advance.




[/img]

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047931#4047931

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047931



More information about the jbossws-users mailing list