Tag: webservice client

是否需要设置一个服务器运行时来在Eclipse中使用CXF生成Web服务客户端?

当我转到文件 – >新 – >其他 – > Web服务 – > Eclipse中的Web服务客户端并选择“Web服务运行时”时,我看到“Apache CFX 2.x”,但是完成按钮被禁用,我得到了在对话框中跟随: “从运行时和部署服务器列表中选择,或使用默认设置。” 我是否真的必须设置服务器才能在Eclipse中使用CXF生成Web服务客户端? 提前致谢。

Apache CXF客户端在Eclipse中加载正常,但独立的jar在WSDLServiceFactory中抛出NullpointerException

我的目标是使用mvn assembly创建一个在独立jar中运行的Web服务客户端,其中包含所有依赖项:single 我使用CXF codegen wsdl2java生成了客户端,创建了名为NetBanxAutostatementService的@WebServiceClient 对于我有的依赖 2.5.2 org.apache.cxf cxf-rt-frontend-jaxws ${cxf.version} runtime org.apache.cxf cxf-rt-transports-http ${cxf.version} runtime 我甚至试图添加更多“东西” org.apache.cxf cxf-rt-core 2.5.2 runtime org.apache.cxf cxf 2.5.2 pom runtime 问题:每次我尝试运行“java -jar target / Netbanx-0.0.1-SNAPSHOT-jar-with-dependencies.jar” INFO [main] (Netbanx.java:97) – autostatement_wsdlLocation:https://www.test.netbanx.com/cgi-bin/autostatement_wsdl Exception in thread “main” java.lang.NullPointerException at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:92) at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:204) at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:148) at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:91) at javax.xml.ws.Service.(Service.java:56) at com.netbanx.autostatement.NetBanxAutostatementService. (NetBanxAutostatementService.java:39) at my.project.netbanx.Netbanx.(Netbanx.java:98) […]

这个JAX-WS客户端调用线程是否安全?

由于WS客户端服务和端口的初始化需要很长时间,我喜欢在启动时初始化它们并重用相同的端口实例。 初始化看起来像这样: private static RequestContext requestContext = null; static { MyService service = new MyService(); MyPort myPort = service.getMyServicePort(); Map requestContextMap = ((BindingProvider) myPort).getRequestContext(); requestContextMap = ((BindingProvider)myPort).getRequestContext(); requestContextMap.put(BindingProvider.USERNAME_PROPERTY, uName); requestContextMap.put(BindingProvider.PASSWORD_PROPERTY, pWord); rc = new RequestContext(); rc.setApplication(“test”); rc.setUserId(“test”); } 我class上某个地方的电话: myPort.someFunctionCall(requestContext, “someValue”); 我的问题:这个电话会是线程安全的吗?

如何向SOAP请求添加标头?

我尝试通过java代码调用HTTPS SOAP Web服务: URL url = new URL(“https://somehost:8181/services/”SomeService?wsdl”); QName qname = new QName(“http://services.somehost.com/”, “SomeService”); Service service = Service.create(url, qname); SomeService port = service.getPort(SomeService .class); port.doSomething(); 但得到例外: threw an unexpected exception: javax.xml.ws.soap.SOAPFaultException: Security Requirements not met – No Security header in message 当我分析正确的请求样本时,我确定它必须包含标题: http://somehost:8181/services/SomeService https://somehost:8181/services/”SomeService/doSomethingRequest http://www.w3.org/2005/08/addressing/anonymous uuid:3428539e-d645-72ae-adc0-5423c1e68942 2013-01-15T16:36:30Z 2014-01-15T14:06:30Z 那么如何将这个头添加到我的SOAP请求中呢?

Web服务客户端给出了WSDL

我正在尝试用Java创建一个Web服务客户端。 我不知道该怎么做。 这是WSDL的URL: https : //testservices.gatewayedi.com/PayerList/payerlist.asmx?wsdl 这是WSDL: 服务中有三种方法。 我试图使用SOAP调用此方法。 XML消息格式为: POST /PayerList/payerlist.asmx HTTP/1.1 Host: testservices.gatewayedi.com Content-Type: application/soap+xml; charset=utf-8 Content-Length: <> <> <> 知道解决方案的任何人请告诉我。 任何帮助都非常可观。

更改使用JAXWS生成的默认XML名称空间前缀

我正在使用JAXWS为我们正在构建的Java应用程序生成WebService客户端。 当JAXWS构建其XML以在SOAP协议中使用时,它会生成以下名称空间前缀: 我的问题是我的对手(一家大型转账公司)管理我的客户端连接的服务器,拒绝接受WebService调用( 请不要问我的原因 ),除非XMLNS(XML namepspace前缀是soapenv )。 喜欢这个: 所以我的问题是: 有没有办法命令JAXWS(或任何其他Java WS客户端技术)使用soapenv而不是env作为XMLNS前缀来生成客户端? 是否有API调用来设置此信息? 谢谢!