web-services

How to use CXF client in thread safe way

南笙酒味 提交于 2020-01-01 10:04:29
问题 I have created the client stub for below service using apache-cxf 's wsdl2java command. http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL Then I invoke the getWeatherInformation() method as below. Weather weatherService = new Weather(); WeatherSoap weatherSoap = weatherService.getWeatherSoap(); ArrayOfWeatherDescription result = weatherSoap.getWeatherInformation(); I have read that cxf clients are thread safe. But I have a doubt whether it is safe to use the same WeatherSoap instance accross

Adding service references to multiple WCF services that shared classes

南笙酒味 提交于 2020-01-01 10:03:32
问题 I'm attempting to split up my WCF web services into a few services instead of 1 giant service. But the Visual Studio (Silverlight client) duplicates the common classes shared by both services. Here is a simple example to illustrate my problem. In this example there are two services. Both return the type "Person". By default VS will create two seperate Person proxy's under unique NameSpaces. This means that the "Person" returned by the different services cannot be consumed by the client as the

IllegalArgumentException: com.sun.xml.internal.messaging.saaj.soap.LocalStrings != com.sun.xml.messaging.saaj.soap.LocalStrings

夙愿已清 提交于 2020-01-01 09:58:10
问题 In my web-application, I am contacting a Web-Service (using JAX-WS) but I get the following error: java.lang.ExceptionInInitializerError at com.sun.xml.ws.message.AttachmentUnmarshallerImpl.<clinit>(AttachmentUnmarshallerImpl.java:55) at com.sun.xml.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:500) at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:242) at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210) at com

How to get control over JAXBContext in JAX-WS?

微笑、不失礼 提交于 2020-01-01 09:42:16
问题 I need to deploy the same web service for each customer. This @javax.jws.WebService uses Object as method arguments and return types (resulting in <xs:anyType/> in wsdl). Each instance of web service is deployed along with customer's jar on the classpath. This jar has known structure and contains JAXB-annotated classes which client wants to handle via my service. The problem is that when customer passes an instance of his class as method agrument, server-side JAXB context unmarshals it into

Java JBoss 401 Error on SharePoint 2010 Web Service

﹥>﹥吖頭↗ 提交于 2020-01-01 09:22:43
问题 My code runs successfully when tested within the Eclipse IDE. I'm connecting to MS SharePoint 2010 via Web Services using the generated Copy.wsdl When I deploy my code on the JBoss server (Running Adobe LifeCycle) my code receives a 401 Error. Error: Caused by: org.jboss.ws.WSException: Invalid HTTP server response [401] - Unauthorized at org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP.read(SOAPMessageUnMarshallerHTTP.java:75) at org.jboss.remoting.transport.http.HTTPClientInvoker

Enable gzip compression in CXF client

ぐ巨炮叔叔 提交于 2020-01-01 09:18:07
问题 I'm trying to make my client use gzip. I have the GZip Feature enabled in the server. It seems that the client it's not sending the correct header: POST /api/v1/data HTTP/1.1 Content-Type: text/xml; charset=UTF-8 Accept: */* SOAPAction: "" User-Agent: Apache CXF 2.6.2 Cache-Control: no-cache Pragma: no-cache Host: localhost:8001 Connection: keep-alive Content-Length: 539 Here's the code where I create the client: private static final QName SERVICE_NAME = new QName( "http://xxx/", "IData");

How to handle Dtos for objects which implement multiple interfaces?

こ雲淡風輕ζ 提交于 2020-01-01 09:14:49
问题 We are using Dtos in our WCF service interface, but have started to come across issues when the Business Object that the Dto represents implements more than a single interface and we want to return the Dtos in those different contexts and to also be able to treat the Dtos polymorphically on the client. For example lets say we have an interface for an IBusinessObject with several properties containing details of the relationships of the object, attributes of the object etc etc. I have several

Stackoverflow exception in VS 2015 but not in VS2010 how?

北城以北 提交于 2020-01-01 09:14:26
问题 There is a webservice project written in VS2010 few years ago and the problem is all code exactly same (same PC , Tested with vs2010 and 2015 with the same code) but in vs2015 it gives error on debug mode. Options > "Projects & Solutions" settings are all same. I took this error and definition of it; An unhandled exception of type 'System.StackOverflowException' occurred in System.Runtime.Serialization.dll System.StackOverflowException was unhandled Message: An unhandled exception of type

Accessing a web service from CQRS

余生颓废 提交于 2020-01-01 09:03:05
问题 Supposed I have a CQRS-based system and my domain needs some data from an external web service to make its decisions. How do I model this correctly? I can think of two options: The command handler runs the domain logic and the domain itself calls out to the web service. Once it gets a response, it attaches the appropriate events to the current aggregate and stores them. The domain basically "waits" for the web service to return. The command handler runs the domain logic and the domain

Accessing a web service from CQRS

末鹿安然 提交于 2020-01-01 09:02:10
问题 Supposed I have a CQRS-based system and my domain needs some data from an external web service to make its decisions. How do I model this correctly? I can think of two options: The command handler runs the domain logic and the domain itself calls out to the web service. Once it gets a response, it attaches the appropriate events to the current aggregate and stores them. The domain basically "waits" for the web service to return. The command handler runs the domain logic and the domain