views:

384

answers:

1

Solved building a stand-alone client for a jax-ws web service on Weblogic 10.3.1.

The web service:

@WebService(portName = "Port", serviceName = "Service", targetNamespace = "tns/web", wsdlLocation = "/wsdls/org.wsdl", endpointInterface = "tns.web.PortType")
@BindingType("http://schemas.xmlsoap.org/wsdl/soap/http")
public class ServicePort implements PortType

public Ticket start(Request request) { ... }
public Answer poll(Ticket ticket) { ... }

The java classes were generated (wsdl first development) and everything is in one jar, e.g. org.jar.

Now for the stand alone client java application (or ws consumer).

    public static void main(String[] args)
    {
        URL wsdlLocation = new URL("http", "server", 7001, "/tns.web/Service?WSDL");
        QName serviceName = new QName("tns/web", "Service");
        Service ws = new Service(wsdlLocation, serviceName);
        PortType port = ws.getPort();
        Request request = null;
        Ticket ticket = port.start(request);
    }

On the classpath jdk1.6.0_16, org.jar, weblogic.jar, and wseeclient.jar from the weblogic...server/lib folder like mentioned here are neccessary. Also ?WSDL in the URL wsdlLocation was neccessary.

First the exception on the line PortType port = ws.getPort(); was :com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassValue(RuntimeInlineAnnotationReader.java:139).

At some point this error mysteriously disappeared and instead a missing dependency showed up in the error message. After addding this dependency jar it worked.

A: 

See edited question.

Gerard