1

This might be a pretty basic issue but I feel like I'm way over my head with it. I created a client side web service java object using the customer provided wdsl (wsimport). the problem is that they are saying I need to include a security header so it will connect. the header is not in the WSDL. I did some research into this and it seems that I need to import a wsit-client.xml into it when I do the wsimport. I can't seem to find a clear example of this file. I have tried to piece one together from the example I have found but when I run wsimport it never seems to pick it up. here is what I have:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" name="SecurityService"
      xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
      xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy"
      xmlns:sc="http://schemas.sun.com/2006/03/wss/server"
      xmlns="http://schemas.xmlsoap.org/wsdl/">
<portType name="LOOKUP_PortType"/>
  <binding name="LOOKUP_Binding" type="tns:LOOKUP_PortType">
   <wsp:PolicyReference URI="#lookupSecurityPolicy"/>
  </binding>
<service name="XXSW_GPOS_CUSTOMER_CREDIT_PKG_Service">
  <port name="XXSW_GPOS_CUSTOMER_CREDIT_PKG_Port" binding="tns:LOOKUP_Binding"/>
</service>
<wsp:Policy wsu:Id="lookupSecurityPolicy">
  <wsp:ExactlyOne>
     <wsp:All>
        <sc:CallbackHandlerConfiguration wspp:visibility="private">
           <sc:CallbackHandler name="usernameHandler" default="username" />
           <sc:CallbackHandler name="passwordHandler" default="password" />
        </sc:CallbackHandlerConfiguration>
     </wsp:All>
  </wsp:ExactlyOne>
</wsp:Policy>
</definitions>

the XML isn't malformed but I know I'm missing something or completely have the whole idea of this wrong. I really need a good walk through of how to create this but I can't seem to find one on the net. any help would be very appreciated.

4

1 回答 1

0

wsimport 不使用 wsit-client.xml。您输入 /META-INF/,Metro 会在您连接到服务时读取它。

于 2012-02-21T15:37:36.817 回答