users@jax-ws.java.net

Re: Bare binding causes inability to have multiple web methods

From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Date: Tue, 15 Aug 2006 11:29:12 -0700

JAX-WS doesn't use SOAPAction for method dispatching. WS-I BasicProfile
1.1 specifies the following:


        "3.4.3 SOAPAction HTTP Header

...

|SOAPAction| is purely a hint to processors. All vital information
regarding the intent of a message is carried in |soap:Envelope|.

 R 1127 A RECEIVER MUST NOT rely on the value of the |SOAPAction| HTTP
header to correctly process the message.SOAP12"

Jitu


Greg Adams wrote:

> I tried adding a SOAPAction by adding @WebMethod(action="method1") and
> @WebMethod(action="method2"), but the runtime didn't distinguish
> between the methods even with a SOAPAction. That seems like behavior
> that would have been useful for this kind of case.
>
> On 8/15/06, *Jitendra Kotamraju* <Jitendra.Kotamraju_at_sun.com
> <mailto:Jitendra.Kotamraju_at_sun.com>> wrote:
>
> Greg Adams wrote:
>
> > I'm cross-posting this from the JAX-WS/JAXB discussion forums.
> >
> > Here's my java class:
> >
> >
> >*package* com.foo;
> >
> >*import* javax.jws.WebMethod;
> >*import* javax.jws.WebService
> >;
> >*import* javax.jws.soap.SOAPBinding;
> >
> >@WebService(targetNamespace = " http://foo.com", name = "Test"
> >)
> >@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> >*public* *class* TestEndPoint {
> >
> >
> >*public* String method1() {
> > *return* "method1 return";
> > }
> >
> >
> >
> >*public* String method2() {
> > *return* "method2 return";
> > }
> >}
> >
> >
> >
> >
> >
> >
> >
> > My client (a .Net client using wsdl.exe generated proxies) calls
> > method1, then method2, but method2 gets called twice.
>
> Since input messages are same for bothe operations, the runtime
> cannot
> distinguish between method1, and method2. doc/lit bare cannot have two
> methods with a parameter that is bound to body is mapped to same type.
> The wsgen tool should catch this kind of errors so that there
> won't be
> this kind of behaviour in the runtime.
>
> Jitu
>
> >
> > I tried adding @WebMethod(operationName="method1", action="method1")
> > to method1 and @WebMethod(operationName="method2",
> action="method2")
> > to the methods, but that made no difference.
> >
> > Here's the wsdl without the @WebMethod annotations:
> >
> >
> ><?xml version="1.0" encoding="UTF-8"?><definitions xmlns:tns=
> >"http://foo.com" xmlns"0" src="images/emoticons/love.gif" alt=":x"
> >>sd="http://www.w3.org/2001/XMLSchema
> <http://www.w3.org/2001/XMLSchema>"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/
> > <http://schemas.xmlsoap.org/wsdl/soap/>" xmlns="
> http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://foo.com
> >" name="TestEndPointService">
> > <types>
> > <xsd:schema>
> > <xsd:*import* namespace="
> >http://foo.com"
> schemaLocation="http://localhost:8080/jaxWsTest2/services/Test?xsd=1
> <http://localhost:8080/jaxWsTest2/services/Test?xsd=1>"></xsd:import>
> >
> > </xsd:schema>
> > </types>
> > <message name="method1"></message>
> > <message name="method1Response">
> > <part element=
> >"tns:method1Response" name="method1Response"></part>
> > </message>
> > <message name="method2"></message>
> >
> > <message name="method2Response">
> > <part element="tns:method2Response"
> name="method2Response"></part>
> >
> > </message>
> > <portType name="Test">
> > <operation name="method1">
> > <input message="tns:method1"
> >></input>
> > <output message="tns:method1Response"></output>
> > </operation>
> > <operation name="method2"
> >>
> > <input message="tns:method2"></input>
> > <output message="tns:method2Response"></output>
> > </operation>
> >
> > </portType>
> > <binding type="tns:Test" name="TestPortBinding">
> > <soap:binding style="document"
> > transport="http://schemas.xmlsoap.org/soap/http
> <http://schemas.xmlsoap.org/soap/http>"></soap:binding>
> > <operation name="method1"
> >>
> > <soap:operation soapAction=""></soap:operation>
> > <input>
> > <soap:body use="literal"></soap:body>
> >
> > </input>
> > <output>
> > <soap:body use="literal"></soap:body>
> > </output>
> > </operation>
> > <operation name=
> >"method2">
> > <soap:operation soapAction=""></soap:operation>
> > <input>
> > <soap:body use=
> >"literal"></soap:body>
> > </input>
> > <output>
> > <soap:body use="literal"></soap:body>
> > </output>
> >
> > </operation>
> > </binding>
> > <service name="TestEndPointService">
> > <port binding="tns:TestPortBinding" name=
> >"TestPort">
> > <soap:address location="
> http://localhost:8080/jaxWsTest2/services/Test"></soap:address>
> >
> > </port>
> > </service>
> ></definitions>
> >
> >
> >
> >
> >
> >
> >
> > Any ideas?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> <mailto:users-unsubscribe_at_jax-ws.dev.java.net>
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
> <mailto:users-help_at_jax-ws.dev.java.net>
>
>