在WebSphereApplicationServer管理控制台中为JAX RPC添加用户名令牌

在WebSphereApplicationServer管理控制台中为JAX RPC添加用户名令牌,websphere,jax-rpc,Websphere,Jax Rpc,我已经用自下而上的方法开发了JAX RPC Web服务。我想从WebSphereApplicationServer管理控制台向webservice添加用户名令牌 通常,RAD(RationalApplicationDeveloper)有一个在Extensions选项卡中添加用户名令牌的选项,但我在Eclipse中开发了我的Web服务。当我用webservice编辑器打开wsdl时,我没有找到扩展选项卡。因此,我正在尝试从管理控制台添加。是否有任何选项可以从管理控制台添加。如果您谈论的是JAX-R

我已经用自下而上的方法开发了JAX RPC Web服务。我想从WebSphereApplicationServer管理控制台向webservice添加用户名令牌


通常,RAD(RationalApplicationDeveloper)有一个在Extensions选项卡中添加用户名令牌的选项,但我在Eclipse中开发了我的Web服务。当我用webservice编辑器打开wsdl时,我没有找到扩展选项卡。因此,我正在尝试从管理控制台添加。是否有任何选项可以从管理控制台添加。

如果您谈论的是JAX-RPC,我假设您使用的是6.1。如果您没有RAD,最好的选择是使用AST(应用程序服务器工具包-单独提供的eclipse工具,用于组装和部署应用程序)。
作为参考,您可以使用此红皮书
一旦配置完成,您可以通过控制台编辑绑定:
enterpriseapplications>JAXRPCEAR>managemodules>JAXRPC.war>Web服务:服务器安全绑定
,但您将无法在那里创建配置

以下是带有用户名令牌的虚拟Hello服务的模板,您可以根据需要调整它们。它们可能无法完全工作,因为我没有测试它们。您需要将它们放在WEB-INF文件夹中

文件
webservices.xml

<?xml version="1.0" encoding="UTF-8"?><webservices version="1.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd">
    <webservice-description>
        <webservice-description-name>HelloService</webservice-description-name>
        <wsdl-file>WEB-INF/wsdl/Hello.wsdl</wsdl-file>
        <jaxrpc-mapping-file>WEB-INF/Hello_mapping.xml</jaxrpc-mapping-file>
        <port-component>
            <port-component-name>Hello</port-component-name>
            <wsdl-port xmlns:pfx="http://service">pfx:Hello</wsdl-port>
            <service-endpoint-interface>service.Hello</service-endpoint-interface>
            <service-impl-bean>
                <servlet-link>service_Hello</servlet-link>
            </service-impl-bean>
        </port-component>
    </webservice-description>
</webservices>
文件
ibmwebservices bnd.xmi

<?xml version="1.0" encoding="UTF-8"?>
<com.ibm.etools.webservice.wsext:WsExtension xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:com.ibm.etools.webservice.wsext="http://www.ibm.com/websphere/appserver/schemas/5.0.2/wsext.xmi" xmi:id="WsExtension_1408569011266">
  <wsDescExt xmi:id="WsDescExt_1408569011266" wsDescNameLink="HelloService">
    <pcBinding xmi:id="PcBinding_1408569011266" pcNameLink="Hello">
      <serverServiceConfig xmi:id="ServerServiceConfig_1408569548722">
        <securityRequestConsumerServiceConfig xmi:id="SecurityRequestConsumerServiceConfig_1408569548722">
          <caller xmi:id="Caller_1408569896666" name="basicAuth." part="" uri="" localName="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken"/>
          <requiredSecurityToken xmi:id="RequiredSecurityToken_1408569548722" name="userToken" uri="" localName="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken" usage="Required"/>
        </securityRequestConsumerServiceConfig>
      </serverServiceConfig>
    </pcBinding>
  </wsDescExt>
</com.ibm.etools.webservice.wsext:WsExtension>
<?xml version="1.0" encoding="UTF-8"?>
<com.ibm.etools.webservice.wsbnd:WSBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:com.ibm.etools.webservice.wsbnd="http://www.ibm.com/websphere/appserver/schemas/5.0.2/wsbnd.xmi" xmi:id="WSBinding_1408569011266">
  <wsdescBindings xmi:id="WSDescBinding_1408569011266" wsDescNameLink="HelloService">
    <pcBindings xmi:id="PCBinding_1408569011266" pcNameLink="Hello">
      <securityRequestConsumerBindingConfig xmi:id="SecurityRequestConsumerBindingConfig_1408569960450">
        <tokenConsumer xmi:id="TokenConsumer_1408570879556" classname="com.ibm.wsspi.wssecurity.token.UsernameTokenConsumer" name="usernameTokenConsumer">
          <valueType xmi:id="ValueType_1408570879556" localName="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken" uri="" name="Username Token"/>
          <jAASConfig xmi:id="JAASConfig_1408570879556" configName="system.wssecurity.UsernameToken"/>
          <partReference xmi:id="PartReference_1408570879556" part="userToken"/>
        </tokenConsumer>
      </securityRequestConsumerBindingConfig>
    </pcBindings>
  </wsdescBindings>
</com.ibm.etools.webservice.wsbnd:WSBinding>


谢谢您的帮助!!!我正在使用websphere 7.0。我安装了RAD并导入了Web服务。但是我没有找到extensions选项卡。我甚至尝试在RAD中创建一个新的Web服务,但是我没有找到extensions选项卡。创建Web服务后是否需要执行其他更改。请确保在Project
Properties>Project Facets
中选择了Facets WebSphere Web(共存)和(扩展)。然后在打开webservice.xml之后,应该有一个扩展选项卡。请确保您是使用Web服务编辑器而不是XML编辑器打开它。我已经检查了这些选项。但是,我仍然不能。您确定它是JAX-RPC服务,而不是JAX-WS吗?您的应用程序也应该是J2EE1.4,即动态Web模块2.4。打开webservices.xml文件时,您有哪些选项卡?它是JAX-RPC,但我是使用Dynamic Web module 2.5创建的,我的webservice.xml仅包含webservices、端口组件和处理程序。