我在Eclipse中使用JAX WS创建了一个Web服务,并部署到Weblogic 12c应用服务器。
@Webservice类和WSDL如下所示。问题是当我使用WSDL进行wsimport时,由于WSAM:输入/输出操作,我得到了错误。我理解它用于WS寻址,但我没有在@SOAPBinding中指定任何显式的@Addressing。
问题1)为什么在WSDL中生成它。 Altova XML间谍没有验证这个WSDL。
问题2)Wsimport可以完美地生成客户端工件 wsimport<>。我甚至没有提供包含WSDL中引用的Schema的-b绑定文件。如果没有绑定文件,wsimport如何能够生成客户端artifcats
...谢谢Venkat
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();
}
}
<?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
答案 0 :(得分:1)
尝试从Web方法中删除@Action()。通常,Action用于指定寻址的显式操作。