JAX-WS WS with Soap11 and Soap12 Binding

View: New views
1 Messages — Rating Filter:   Alert me  

JAX-WS WS with Soap11 and Soap12 Binding

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everybody,

I have browsed the forum, but did not find concrete thread about that.

I am using NetBeans 6.7.1. Pretty new one. What I tried to do is to create Web Service (WS) that supports both Soap11 and Soap12 Binding. So when requesting the WSDL (?wsdl) I expect to have the following sample WSDL:

    <wsdl:binding name="AsymBindUTTimesSignHeaderAndEncrBodytServiceSoap11Binding" type="ns:AsymBindUTTimesSignHeaderAndEncrBodytServicePortType">
        <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#AsymBindUTTimesSignHeaderAndEncrBodytServicePolicy"/>

        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <wsdl:operation name="echo">
            <soap:operation soapAction="urn:echo" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="AsymBindUTTimesSignHeaderAndEncrBodytServiceSoap12Binding" type="ns:AsymBindUTTimesSignHeaderAndEncrBodytServicePortType">
        <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#AsymBindUTTimesSignHeaderAndEncrBodytServicePolicy"/>
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <wsdl:operation name="echo">
            <soap12:operation soapAction="urn:echo" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

The problem is that when I wrote my Java class and annotated it with @WebService() I did not find a way to use this class for both SOAP11 and SOAP12.
What I succeeded to do is to copy the java class as a new one (with diff name) and add the both annotations:

@WebService()
/*https://jax-ws.dev.java.net/2.1.7/docs/soap12.html*/
/*@javax.xml.ws.BindingType(value=SOAPBinding.SOAP12HTTP_BINDING) -- Does not work!?*/
@javax.xml.ws.BindingType(value="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/")

Here are my questions:

1) Do you know how can I reuse one and the same class for both SOAP11 and 12?

2) Reading https://jax-ws.dev.java.net/2.1.7/docs/soap12.html it seems there are several possible ways to specify that SOAP 12 should be used. Nevertheless, in NetBeans 6.7.1 only adding  @javax.xml.ws.BindingType(value="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/") works?

3) How can easily map the appropriate documentation to read based on the NetBeans version? It seems the help associated with the netBeans 6.7.1. is not in synch?

Thank you in advance,
Dobri
[Message sent by forum member 'kdobrik' (kdobrik@...)]

http://forums.java.net/jive/thread.jspa?messageID=370467

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...