webservice-client

Detecting Client Disconnects in Web Services

大憨熊 提交于 2019-12-07 04:39:09
问题 I'm using the Apache CXF Web Services stack. When a client times out or disconnects from the server before the operation is complete, the server keeps running the operation until it is complete. I would like to have the server detect when the client disconnects and handle that accordingly. Is there a way to detect when a client disconnects using Apache CXF? What about using other Java web-services stacks? 回答1: I am not familiar with Apache CXF , but the following should be applicable to any

How to remove empty header from SOAP message?

…衆ロ難τιáo~ 提交于 2019-12-07 03:32:36
问题 I am using Spring-WS for consuming Webservice which compains if SOAP envelop has empty header element. I figured out that default SOAPMessage implementation adds one. How can I remove it? Thanks in advance 回答1: http://docs.oracle.com/javaee/5/tutorial/doc/bnbhr.html: The next line is an empty SOAP header. You could remove it by calling header.detachNode after the getSOAPHeader call. So here is the solution in plain SAAJ: MessageFactory messageFactory = MessageFactory.newInstance("SOAP 1.2

How do I prevent my .NET SOAP client from including “Connection: KeepAlive” in the HTTP headers. (using WSE3.0)

耗尽温柔 提交于 2019-12-07 01:33:11
问题 In the HTTP Connection header, my web service client is including: Connection: Keep-Alive I want to disable this. After doing some research, it appears the way to do this is to set the KeepAlive member of the SoapHttpChannelOptions class to false. But, I do not see a way to access/modify SoapHttpChannelOptions in the webservice client class that was generated for me in Visual Studio using WSE3.0 (Web Service Enhancement. In my case, the generated stub class extends Microsoft.Web.Services3

Getting java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl despite the dependencies are defined

这一生的挚爱 提交于 2019-12-06 20:12:58
问题 Despite that I have defined the related dependencies as I have added below, getting the java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl exception when my app makes a call to the web service. <dependency> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api</artifactId> <version>2.2.10</version> </dependency> <dependency> <groupId>com.sun.xml.ws</groupId> <artifactId>jaxws-rt</artifactId> <version>2.2.10</version> <type>pom</type> </dependency> p.s. The servlet

Java web service client generated in Netbeans - getting Http Status Code 307

岁酱吖の 提交于 2019-12-06 14:42:23
问题 I use Netbeans to generate web service client code, client-style JAX-WS, so i can invoke a web service API. However, when I invoke the web service API, I get the exception: com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 307: Temporary Redirect Why do I get this? What is the workaround? I know the problem isn't with the web service itself, because I can get responses fine via soapUI and .Net. 回答1: Faced the same problem about a month ago. Web service

javax.xml.ws.WebServiceException: Failed to access the WSDL. Response: '401: Unauthorized'

大憨熊 提交于 2019-12-06 13:17:00
I am trying to access a web service for a project i'm working on. I'm using JAX-WS and the app is deployed on weblogic. When i'm trying to access the WS, i get the following exception: javax.portlet.PortletException: javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://xxx.xxxx.ro:40000/idm/ws/cup?wsdl. It failed with: Response: '401: Unauthorized' for url: 'http://xxx.xxxx.ro:40000/idm/ws/cup?wsdl'. at com.bea.portlet.container.PortletStub.processAction(PortletStub.java:346) at com.bea.portlet.container.AppContainer.invokeProcessAction(AppContainer.java:678) ........ I read

Why is the SOAP Webservice error returned by the service provider?

本小妞迷上赌 提交于 2019-12-06 09:27:14
I'm using a SOAP web-service developed by webservicex server (downloaded from here ) to develop a country locator application with IP address as input. Imported the jar files and java files, using the wsimport . Now, developed a java application that returns the country name by taking the input as IP address. Everything was working as per plan, without any syntax errors. But when executing the java program, it returned an error which I couldn't trace back(I'm a learner). I'm not sure if it is a problem with either WS or Jar files. The error is as follows: Exception in thread "main" com.sun.xml

WCF error calling WS-Security web service: Cannot find a token authenticator for the X509SecurityToken

半腔热情 提交于 2019-12-06 08:09:36
问题 I'm trying to connect with an external Java Web service with WS-Security enabled over https with a WCF client. The service use UserNameToken authentication. When the client call the service, I get this exception: Cannot find a token authenticator for the 'System.IdentityModel.Tokens.X509SecurityToken' token type. Tokens of that type cannot be accepted according to current security settings. I use a custom binding with this configuration: The endpoint: <endpoint address="https://des-afirma

WebService Client and List<JAXBElement<?>>

放肆的年华 提交于 2019-12-06 07:08:03
问题 When I try to generate a client from a wsdl document, I get a client that seems to have a lot of JAXBElement atributes, for instance protected List<JAXBElement<?>> nameOrLinkingNameOrFamilyName; I use soapUI to generate with apache cxf 2.3.3 as tool, also as config file the following: <jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <jaxb:globalBindings generateElementProperty

Android services with RestFull web services

北慕城南 提交于 2019-12-06 04:14:56
I am new in android. I need to call RestFull web services from my app. Can i call RestFull web services from android service? if yes then how it implement? Consuming Webservices directly via HTTP method in android causes ANR (Android not responding) exception and Network On Main Thread exception. Hence you would have to use an ASYNCTASK to call /consume web-services. Permission Required: <uses-permission android:name="android.permission.INTERNET" /> Code snippet: This is the main activity in the android client. From here, the web-service would be consumed on some particular trigger, say user