简体   繁体   English

为城域Web服务调用设置wsit-client的问题

[英]problems with setting up wsit-client for metro webservice call

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). 我使用客户提供的wdsl(wsimport)创建了一个客户端Web服务Java对象。 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. 标头不在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. 我对此进行了一些研究,似乎在进行wsimport时需要将wsit-client.xml导入其中。 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. 我试图从发现的示例中拼凑出一个例子,但是当我运行wsimport时,它似乎再也找不到。 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. XML没有格式错误,但我知道我遗漏了一些东西或完全了解了这个错误。 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. 任何帮助将不胜感激。

wsit-client.xml is not used by wsimport. wsimport不使用wsit-client.xml。 You put in in /META-INF/ and Metro reads it when you connect to the service. 您放入/ META-INF /中,Metro在连接到该服务时会读取它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM