jax-ws

How do you build an EAR with policy files included using WLS Ant Tasks?

I've been working with JAX-WS with Weblogic Server, using their Ant tasks to build EAR files that can be deployed on the server. I've gotten basic SOAP calls to work with JAX-WS, but now I'm trying to add some message-level security via WS-Security. According to the documentation, there are two ways of adding security policies to web s...

Consuming .NET webservice in Java (metro) - XMLNode/XMLDocument consumption?

I am a bit rusty in my Java, and this is my first time using metro/JAX-WS, so if this is a dumb question I apologize. I have to write a client that consumes a .NET webservice. I've got the basics down; I have generated the wrappers from the WSDL, and I can create my object and port and make a call and get a response. Widgets d = new ...

Best way to consume .NET web services in Java

I'm trying to consume some .NET web services using JAX-WS. I have generated the Java classes using the wsimport tool. However, when I try to use these (proprietary, not public) web services in Java, I notice that most of the methods and properties provided by the vendor in their C# examples are not avaiable in the generated classes (desp...

How do I specify host and port when accessing a web service from JAX-WS-generated code?

I have a WSDL file for a web service. I'm using JAX-WS/wsimport to generate a client interface to the web service. I don't know ahead of time the host that the web service will be running on, and I can almost guarantee it won't be http://localhost:8080. How to I specify the host URL at runtime, e.g. from a command-line argument? The ge...

How do I add a <UsernameToken> header programatically to a SOAP message in JAX-WS?

I'm writing a simple proof-of-concept webservice client using the JBoss-WS library. I need to send messages to a remote service that requires a <Security> header with a <UsernameToken> element. I would like to add this header in the most JAX-WS-kosher way, without having to manually add XML elements by hand, without having to read in a ...

JAX-WS Consuming web service with WS-Security and WS-Addressing

I'm trying to develop a standalone Java web service client with JAX-WS (Metro) that uses WS-Security with Username Token Authentication (Password digest, nonces and timestamp) and timestamp verification along with WS-Addressing over SSL. The WSDL I have to work with does not define any security policy information. I have been unable to...

Web service response is null, but SOAP message response is valid

I am writing a web service starting with writing the WSDL. I have been generating server-side skeleton code using wsimport and then writing my own implementing class. I'm running the web service on an Axis2 server. When using soapUI, the SOAP messages coming to and from the service look fine, but when using a web service client, I'm g...

Servlets + JAX-WS

Hi All: I'm trying to expose a web service method via JAX-WS annotations. Many examples I've seen reference the EndPoint.publish() method to quickly stand up the service in a standalone app (ex from Java Web Services: Up and Running, 1st Edition): public class TimeServerPublisher { public static void main(String[ ] args) { // 1st arg...

JAX-WS Loading WSDL from jar

I'm writing a fat client that makes use of a SOAP service for some features (bug reporting etc.) I've got JAX-WS working fine, but by default (in netbeans at least) it fetches the WSDL from the remote server every time the service is initialized. I expect this helps provide some versioning support etc., but it's not what I want. I've ...

Can JAX-WS be used to let a server execute web service calls on a client?

Hello! I'm playing around with P2P. I want to use JAX-WS for communication inside a P2P network. Some peers are "behind a firewall", so they can't listen on ports. (They act as clients). Other peers are allowed to listen on ports. (They act as servers (and clients)). Now I want to be able to abstract from the fact, which peers are serv...

JAX-WS client with AXIS server; namespace problem?

I'm having a problem related to JAX-WS and AXIS. JAX-WS (2.1.7) as a client, Axis (1.4.x) as server. Everything works OK, but the response can't be read to Java. Response: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xm...

Transformation error: "The current event is not START_ELEMENT but 2"

Similarly to an older post I'm trying to access a web service with JAX-WS using: Dispatch<Source> sourceDispatch = null; sourceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD); Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req))); System.out.println(sourceToXML(result)); where:...

Wrong Encoding in JAX-WS Dispatch Response

I'm trying to access a web service with JAX-WS using: Dispatch<Source> sourceDispatch = null; sourceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD); Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req))); System.out.println(sourceToXMLString(result)); where: private static Str...

Deploying a WebService in glassfish with init parameters

I've created a WebService using the JAX-WS API. This service runs without any problem using an Endpoint class. main(String args[]) { (...) MyService service=new MyService(); service.setParam1("limit=100"); service.setParam2("hello"); service.setParam3("max-value=10"); Endpoint endpoint = Endpoint.create(service); endpoint.publish("http:...

What happens to all the hard-coded URIs when I move a Web Service?

I'm developing a test WS with JAX-WS and the demo works fine but if I try to move it in production there are a lot of occurences of the URL of my test enviroment on my code. For example: com.mycompany.testserver.ws.writer.WriterInterface service = new com.mycompany.testserver.ws.writer.WriterInterface(); QName portQName = new QName("ht...

How do I add a SOAP Header using Java JAX-WS

A typical SOAP client request using JAX-WS might be FooService service = new FooService(); FooPort port = service.getFooPort(); FooPayload payload = new FooPayload(); payload.setHatSize(3); payload.setAlias("The Hat"); ... port.processRequest(payload); This generates an HTTP request content something like <?xml ... ?> <S:Envelope xml...

How can you pipe an OutputStream to a StreamingDataHandler?

I've got a Java web service in JAX-WS that returns an OutputStream from another method. I can't seem to figure out how to stream the OutputStream into the returned DataHandler any other way than to create a temporary file, write to it, then open it back up again as an InputStream. Here's an example: @MTOM @WebService class Example { ...

JBoss 4.2.3 + WebServices Client

Hi, I have Web application deployed on a JBoss 4.2.3, that access a SOAP Webservices deployed at a GlassFish V2. When a I run the web application in my local Jetty, it runs smoothly. When I deploy it to JBoss 4.2.3 (Java 1.6), it raises an EOFException. Caused by: javax.xml.ws.WebServiceException: java.io.IOException: Could not tra...

JAX-WS Exception

How to assign the fault field of the SOAPFaultException on the server side? ...

Complex Object in JAX-WS is created empty.

I'm testing JAX-WS to access the Oracle IRM web serviecs. I can get it to work just fine with AXIS so this isn't an Oracle problem. What's happening is that I'm getting the following error when making the call: Expected xsd:anyType - unknown type provided If I look at the SOAP packet is sent I see that the owner tag is blank under J...