3

我在 Eclipse 中使用 JAX WS 创建了一个 Web 服务并部署到 Weblogic 12c 应用服务器。

@Webservice 类和 WSDL 如下所示。问题是当我将 WSDL 用于 wsimport 时,由于 WSAM:input/ouput 操作而出现错误。我知道它用于 WS 寻址,但我没有在我的 @SOAPBinding 中指定任何明确的 @Addressing。

问题 1)为什么会在 WSDL 中生成它。Altova XML 间谍未验证此 WSDL。

问题 2) Wsimport 可以完美地使用 wsimport <> 生成客户端工件。我什至没有提供包含 WSDL 中引用的模式的 -b 绑定文件。wsimport 如何在没有绑定文件的情况下生成客户端工件

谢谢...文卡特

package com.arie.account.web.webservice;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;
import javax.xml.ws.Action;
import javax.xml.ws.soap.Addressing;

@WebService(serviceName = "AccountWebservice" ,  name = "AccountWebservice" )
@SOAPBinding(style = Style.RPC ,use=Use.LITERAL)
public class Account {
    @WebMethod 
    @Action()
    public @WebResult(partName="return") AccountResponse getAccountData(
            @WebParam(partName="AccountRequestBean") AccountRequestBean accountRequest){
        return new AccountResponse();
    }
}

WSDL 在这里

<?xml version="1.0" encoding="UTF-8" ?> 
 <!--  Published by JAXWS RI at http://jaxws.dev.java.net. RI's version is JAXWS RI 2.2.6hudson86  svnrevision#12773. 
  > 
 <!  Generated by JAXWS RI at http://jaxws.dev.java.net. RI's version is JAXWS RI 2.2.6hudson86  svnrevision#12773. 
  --> 
 <definitions xmlns:wsu="http://docs.oasisopen.org/wss/2004/01/oasis200401wsswssecurityutility1.0.xsd" xmlns:wsp="http://www.w3.org/ns/wspolicy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.account.ivr.arie.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.account.arie.com/" name="AccountWebservice">
 <types>
 <xsd:schema>
  <xsd:import namespace="http://webservice.account.arie.com/" schemaLocation="http://localhost:7001/ATRWebStatistics/AccountWebservice?xsd=1" /> 
  </xsd:schema>
  </types>
 <message name="getAccountData">
  <part name="AccountRequestBean" type="tns:accountRequestBean" /> 
  </message>
 <message name="getAccountDataResponse">
  <part name="return" type="tns:accountResponse" /> 
  </message>
 <portType name="AccountWebservice">
 <operation name="getAccountData">
  <input wsam:Action="http://webservice.account.arie.com/AccountWebservice/getAccountDataRequest" message="tns:getAccountData" /> 
  <output wsam:Action="http://webservice.account.arie.com/AccountWebservice/getAccountDataResponse" message="tns:getAccountDataResponse" /> 
  </operation>
  </portType>
 <binding name="AccountWebservicePortBinding" type="tns:AccountWebservice">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> 
 <operation name="getAccountData">
  <soap:operation soapAction="" /> 
 <input>
  <soap:body use="literal" namespace="http://webservice.account.arie.com/" /> 
  </input>
 <output>
  <soap:body use="literal" namespace="http://webservice.account.arie.com/" /> 
  </output>
  </operation>
  </binding>
 <service name="AccountWebservice">
 <port name="AccountWebservicePort" binding="tns:AccountWebservicePortBinding">
  <soap:address location="http://localhost:7001/ATRWebStatistics/AccountWebservice" /> 
  </port>
  </service>
  </definitions
4

1 回答 1

1

尝试从 web 方法中删除 @Action()。通常 Action 用于指定寻址的显式操作。

于 2014-12-10T10:45:38.057 回答