I'm using JDev 11.1.1.3.0. Trying to create a WSDL that uses only an HTTP binding (non-SOAP) to recreate a web service I'm trying to connect to. My hope is to create the WSDL and use the 'Java Web Service from WSDL' tool (WSDL2Java) to create the Java client code for connecting to the web service. (No, the author of the web service does not support SOAP. Sigh).
First off, I do not see an option to create a straight HTTP binding using the 'WSDL Editor/Create Binding' dialog, (only SOAP11, SOAP12, Java, EJB, JCA, JMS, Custom). So I manually created the binding based on what I could find in the w3c. Here it is slightly modified with bogus namespaces and URL addresses:
<?xml version="1.0" encoding="UTF-8" ?>
<definitions targetNamespace="https://my.server.com/context/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:tns="https://my.server.com/context/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:types="https://my.server.com/context//types"
xmlns:java="http://schemas.xmlsoap.org/wsdl/java/"
xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/">
<types>
<xsd:schema targetNamespace="https://my.server.com/context//types"
elementFormDefault="qualified"/>
<xsd:schema>
<xsd:import schemaLocation="MyRequest.xsd" namespace="https://my.server.com/context//types"/>
</xsd:schema>
<xsd:schema>
<xsd:import schemaLocation="MyResponse.xsd" namespace="https://my.server.com/context//types"/>
</xsd:schema>
<xsd:schema>
<xsd:import schemaLocation="Common.xsd" namespace="https://my.server.com/context//cmn"/>
</xsd:schema>
</types>
<portType name="AvailabilityServices">
<operation name="RequestAvailability">
<input message="tns:AvailabilityRequestMessage"/>
<output message="tns:AvailabilityResponseMessage"/>
</operation>
</portType>
<message name="AvailabilityRequestMessage">
<part name="part" element="types:PNARequest"/>
</message>
<message name="AvailabilityResponseMessage">
<part name="part" element="types:PNAResponse"/>
</message>
<binding name="AvailabilityServicesHTTPBinding"
type="tns:AvailabilityServices">
<http:binding verb="POST"/>
<operation name="RequestAvailability">
<http:operation location="RequestAvailability"/>
<input>
<mime:content type="application/xml"/>
</input>
<output>
<mime:mimeXml/>
</output>
</operation>
</binding>
<service name="AvailabilityService">
<port name="AvailabilityServicesPort"
binding="tns:AvailabilityServicesHTTPBinding">
<http:address location="https://my.server.com/context/"/>
</port>
</service>
</definitions>
I really don't know if the the input and output tags for the binding are correct. I've tried <mime:mimeXml/> for both. I basically want to just send and receive the XSD schemas as straight XML over HTTP. Is this right?
Secondly, when trying to generate the Java code from this WSDL, the generation fails with an IndexOutOfBoundsException:
oracle.jdeveloper.webservices.model.WebServiceException: Error creating model from wsdl "file:/C:/_Developer11g1_1_3_0/work/Web/PriceAvailability/public_html/WEB-INF/wsdl/PriceAvailability.wsdl": Index: 0, Size: 0
at oracle.jdeveloper.webservices.model.java.JavaWebService.createPortTypes(JavaWebService.java:1635)
at oracle.jdeveloper.webservices.model.WebService.createServiceFromWSDL(WebService.java:2846)
at oracle.jdeveloper.webservices.model.WebService.createServiceFromWSDL(WebService.java:2611)
at oracle.jdeveloper.webservices.model.java.JavaWebService.setDescription(JavaWebService.java:745)
at oracle.jdevimpl.webservices.wizard.jaxrpc.topdown.TDJaxWsSpecifyWsdlPanel.setDescription(TDJaxWsSpecifyWsdlPanel.java:364)
at oracle.jdevimpl.webservices.wizard.jaxrpc.common.SpecifyWsdlPanel.buildModel(SpecifyWsdlPanel.java:1109)
at oracle.jdevimpl.webservices.wizard.jaxrpc.common.SpecifyWsdlPanel$5.run(SpecifyWsdlPanel.java:661)
at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:655)
at java.lang.Thread.run(Thread.java:619)
Caused by: oracle.jdeveloper.webservices.tools.WsdlValidationException: Error creating model from wsdl "file:/C:/_Developer11g1_1_3_0/work/Web/PriceAvailability/public_html/WEB-INF/wsdl/PriceAvailability.wsdl": Index: 0, Size: 0
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.newWsdlValidationException(WsaAdaptor.java:825)
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.getSeiInfo(WsaAdaptor.java:515)
at oracle.jdeveloper.webservices.tools.WebServiceTools.getSeiInfo(WebServiceTools.java:523)
at oracle.jdeveloper.webservices.model.java.JavaWebService.getSeiInfo(JavaWebService.java:1741)
at oracle.jdeveloper.webservices.model.java.JavaWebService.createPortTypes(JavaWebService.java:1496)
... 8 more
Caused by: oracle.j2ee.ws.common.tools.api.ValidationException: Error creating model from wsdl "file:/C:/_Developer11g1_1_3_0/work/Web/PriceAvailability/public_html/WEB-INF/wsdl/PriceAvailability.wsdl": Index: 0, Size: 0
at oracle.j2ee.ws.tools.wsa.jaxws.JaxwsWsdlToJavaTool.getJAXWSModel(JaxwsWsdlToJavaTool.java:664)
at oracle.j2ee.ws.tools.wsa.WsdlToJavaTool.createJAXWSModel(WsdlToJavaTool.java:475)
at oracle.j2ee.ws.tools.wsa.Util.getJaxWsSeiInfo(Util.java:1357)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.jdevimpl.webservices.tools.wsa.Assembler$2$1.invoke(Assembler.java:218)
at $Proxy39.getJaxWsSeiInfo(Unknown Source)
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.getSeiInfo(WsaAdaptor.java:505)
... 11 more
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.consolidateInterfaceMappings(WSDLToJavaModelBuilder.java:689)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.consolidateInterfaceMappings(WSDLToJavaModelBuilder.java:682)
at oracle.j2ee.ws.tools.jaxws.wsdl.WSDLToJavaModelBuilder.build(WSDLToJavaModelBuilder.java:196)
at oracle.j2ee.ws.tools.wsa.jaxws.JaxwsWsdlToJavaTool.getJAXWSModel(JaxwsWsdlToJavaTool.java:656)
... 20 more
Anybody know how to write a WSDL with a non-SOAP HTTP binding and then generate Java from it?
Thanks