我们目前遇到了JAX-WS实现的问题,特别是在获取服务返回的值时,虽然我们给它一个值,但在我们的例子中它总是为null.
在更多解释我们的问题之前的一些代码:
这是我们操作的签名:
@WebMethod(action = "urn:genererEdition")
public void genererEdition(
@WebParam(name = "requeteEdition", targetNamespace = "http://creditcgi.com/serviceeditique", partName = "requete")
RequeteEdition requete,
@WebParam(name = "reponseEdition", targetNamespace = "http://creditcgi.com/serviceeditique", mode = WebParam.Mode.OUT, partName = "reponse")
Holder<ReponseEdition> reponse,
@WebParam(name = "documentProduit", targetNamespace = "", mode = WebParam.Mode.OUT, partName = "documentProduit")
Holder<byte[]> documentProduit);
Run Code Online (Sandbox Code Playgroud)
这是我们的Web服务测试用例:
@Test
public void testCallGenererEdition() {
RequeteEdition requete = new RequeteEdition();
Holder<ReponseEdition> reponseHolder = new Holder<ReponseEdition>(new ReponseEdition());
Holder<byte[]> documentHolder = new Holder<byte[]>(new byte[512]);
editique.genererEdition(requete, reponseHolder, documentHolder);
Assert.assertNotNull(reponseHolder.value);
Assert.assertNotNull(reponseHolder.value.getCodeRetour());
}
Run Code Online (Sandbox Code Playgroud)
最后,我们的WS实现:
@Override
public …Run Code Online (Sandbox Code Playgroud) 任何人都可以告诉我,我可以将Hibernate实体作为JAXWS Web服务方法中的返回值返回!
的确,我有一些这样的实体:
@Entity
public class Parent {
...
private Childone childoneByChildoneid;
@ManyToOne
public
@javax.persistence.JoinColumn(name="ChildOneId",referencedColumnName="Id")
Childone getChildoneByChildoneid() {
return childoneByChildoneid;
}
public void setChildoneByChildoneid(Childone childoneByChildoneid) {
this.childoneByChildoneid = childoneByChildoneid;
}
...
}
@Entity
public class Childone {
...
private Collection<Parent> parentsById;
@OneToMany(mappedBy = "childoneByChildoneid")
public Collection<Parent> getParentsById() {
return parentsById;
}
public void setParentsById(Collection<Parent> parentsById) {
this.parentsById = parentsById;
}
...
}
Run Code Online (Sandbox Code Playgroud)
并有这样的服务:
@Stateless
@WebService()
public class MasterDataService {
@EJB
private MasterDataManager manager;
@WebMethod
public Parent getParent(int parentId) {
return …Run Code Online (Sandbox Code Playgroud) JSON在泽西岛使用杰克逊处理器时,何时以及为什么我需要JAXB在两者之间使用注释?Object->JAXB->JSON
杰克逊还提供自己的JAX-RS直接供应商Object->JSON.这种方法缺少什么?或者为什么我更喜欢另一个
ps:我也用春天
我有一个使用JAXWS开发的简单WebService.我需要上传/下载一些文件.我创建了一个带有DataHandler属性的类FileItem.服务运行正常.
但是当我使用wsimport工具生成客户端存根时,FileItem类具有byte []类型属性而不是DataHandler类型.
如何自定义此行为,以便生成的代码在生成的客户端代码中也具有相同的DataHandler类型?
是否可以在jax-ws中更改http处理程序?例如:从weblogic.net.http.HttpURLConnection到sun.net.www.protocol.http.HttpURLConnection.
我正在开发一个Java EE项目,需要将Web服务合并到外部源或从外部源接收数据.我不确定走哪条路,Axis2或JAX-WS.
任何建议将不胜感激.
亲爱的开发人员,
我正在努力改进我的Java Web服务,我正在尝试使用更精细的方法来获取Java Web Service中属性文件的目录路径.
为了使我的Java Web应用程序更易于部署在Apache Tomcat服务器上,我将以下行添加到web.xml文件中:
<env-entry>
<env-entry-name>loggerPropertyFile</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>/Some/Long/Directory/File/Path/Which/May/Change/conf/LoggerInfo.properties</env-entry-value>
</env-entry>
Run Code Online (Sandbox Code Playgroud)
正如上面的xml代码描述的那样,我在本地Filesystem中的某处放置了一个Properties文件,我希望我的Web Service根据该配置初始化其logger类.您可以意识到,每次将Web服务部署到另一台服务器时,此路径都会更改.因此,我发现我可以使用$ CATALINA_BASE属性,以使环境输入路径更小.如何从我的Java Web服务代码中检索CATALINA_BASE值(如何在Linux上完成以及如何在Windows上完成)?
谢谢.
我是肥皂和jax-ws的新手.
在阅读了很多信息后,我知道eclipse可以捕获肥皂信息,但我有问题.
我的出版商
public static void main(String[] args) {
Endpoint.publish("http://localhost:8081/WS/Greeting",
new GreetingImpl());
}
Run Code Online (Sandbox Code Playgroud)
我的客户
public static void main(String[] args) {
GreetingImplService service = new GreetingImplService();
Greeting greeting = service.getGreetingImplPort();
System.out.println("------->> Call Started");
System.out.println(greeting.sayHello("friend !!!"));
System.out.println("------->> Call Ended");
}
Run Code Online (Sandbox Code Playgroud)
当我在Console中调用客户端时,我看到了
------->> Call Started
Hello, Welcom to jax-ws friend !!!
------->> Call Ended
Run Code Online (Sandbox Code Playgroud)
因此它是工作服务.
但在TCP | IP监视器中我看到空列表.
我配置的TCP | IP监视器

我做错了什么?
请帮忙)
我使用sun-jaxws制作了wsdl。我在Netbeanse中创建了Web服务客户端,并成功调用了wsdl Web服务。然后,我将Nginx服务器配置为通过https访问Web服务。通过https致电服务时出现错误com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 200: OK
我的wsdl可通过地址获得https://somesite.com/mywsdl/?wsdl。在wsdl中,我看到了这样的服务位置:
<service name="GenericService">
<port name="GenericServicePort" binding="tns:GenericServicePortBinding">
<soap:address location="https://somesite.com:443/mywsdl"/>
</port>
</service>
我不知道问题出在我的nginx配置还是我的jaxws中。
我使用JAX-WS RI进行SOAP XML与其他服务的交换.我试图看到我的soap xml发送的完整错误日志,但由于截断消息而无法执行此操作:
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
at org.apache.cxf.transpo
Message has been truncated
use com.sun.xml.ws.transport.http.HttpAdapter.dumpTreshold property to increase the amount of printed part of the message
--------------------
Run Code Online (Sandbox Code Playgroud)
我无法使用以下设置更正此问题:
System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold", "999999");
Run Code Online (Sandbox Code Playgroud)
我的意思是dumpTreshold = 999999
任何帮助将不胜感激.