The summery:
-----------------
I'm trying to use wsdl2java to generate a simple test REST client, with HTTP
binding (not SOAP).
It seems that either:
A) There is a problem with the wsdl2java which somehow expects a SOAP
binding.
B) Something is missing in my WSDL file.
The actual symptom:
--------------------------
Running the generated client, results in a NullPointerException.
Exception in thread "main" java.lang.NullPointerException
at
com.sun.xml.internal.ws.client.WSServiceDelegate.setBindingOnProvider(WSServiceDelegate.java:323)
at
com.sun.xml.internal.ws.client.WSServiceDelegate.buildEndpointIFProxy(WSServiceDelegate.java:383)
at
com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:295)
at
com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:174)
at javax.xml.ws.Service.getPort(Service.java:94)
at com.test.TestService.getTestHttpPort(TestService.java:55)
at
com.test.TestPortType_TestHttpPort_Client.main(TestPortType_TestHttpPort_Client.java:50)
The analysis:
------------------
wsdl2java generates SOAP annotations for my portType (which is not soap
binded)
NOTE: when running wsdl2java with -validate option, I get this message:
WSIBP Validator found <{http://test.com/}testHttpBinding> is NOT a SOAP
binding
My wsdl2java command line is: wsdl2java -client -verbose -validate -d .
test.wsdl
More Info
-------------
The generated portType java code looks like this:
@WebService(targetNamespace = "http://test.com/", name = "testPortType")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface TestPortType {
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(targetNamespace = "http://test.com/", partName = "out", name
= "test_arg")
@WebMethod
public int testOperation(
@WebParam(targetNamespace = "http://test.com/", partName = "in",
name = "test_arg")
int in
);
}
This is my test.wsdl:
-----------------------------------
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://test.com/" targetNamespace="http://test.com/">
<types>
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://test.com/"
xmlns="http://test.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="test_int">
<xsd:restriction base="xsd:int" />
</xsd:simpleType>
<xsd:element name="test_arg" type="test_int"/>
</xsd:schema>
</types>
<message name="testRequest">
<part element="tns:test_arg" name="in" />
</message>
<message name="testResponse">
<part element="tns:test_arg" name="out" />
</message>
<portType name="testPortType">
<operation name="testOperation">
<input message="tns:testRequest" name="testOpInput" />
<output message="tns:testResponse" name="testOpOutput"
/>
</operation>
</portType>
<wsdl:binding name="testHttpBinding" type="tns:testPortType">
<http:binding verb="POST" />
<operation name="testOperation">
<http:operation location="" />
<input>
<mime:content
type="application/x-www-form-urlencoded" />
</input>
<output>
<mime:content type="text/xml" />
</output>
</operation>
</wsdl:binding>
<service name="testService">
<port binding="tns:testHttpBinding" name="testHttpPort">
<http:address location="http://test.com/" />
</port>
</service>
</definitions>
Any help would be appreciated.
Thanks,
Erez.
--
View this message in context:
http://www.nabble.com/wsdl2java-generates-SOAP-annotations-for-non-soap-portType-tp14842359p14842359.html
Sent from the cxf-issues mailing list archive at Nabble.com.