Return-Path: Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: (qmail 92015 invoked from network); 5 Sep 2010 17:03:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Sep 2010 17:03:57 -0000 Received: (qmail 54329 invoked by uid 500); 5 Sep 2010 17:03:56 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 54205 invoked by uid 500); 5 Sep 2010 17:03:55 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 54192 invoked by uid 99); 5 Sep 2010 17:03:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Sep 2010 17:03:55 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of amilasuriarachchi@gmail.com designates 74.125.82.173 as permitted sender) Received: from [74.125.82.173] (HELO mail-wy0-f173.google.com) (74.125.82.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Sep 2010 17:03:51 +0000 Received: by wyb39 with SMTP id 39so3766514wyb.32 for ; Sun, 05 Sep 2010 10:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=Eaafi5C3fmp1iT5dvmaAigiE+z4jbb1qKmN9XyzZFFI=; b=CRkeImZUcCygdVv9aCPJt/PSDbadcVmPx4SuECc9j0KsqdDrt0/BobqLuaiHraD4Cv vznGcAAPODfDxeD7INlsFGxlkfDn0BpCuLyQ2HFS9V2NrY4+TTL1NOzz6iIz4r6Wirzq Gk2i8WYSvpxhwbLYZWESF0inapuIxSa8bZdtU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=EizkTToXdAmsgLTaOwU0k/lGLFYg8jKJ++Gv8mnkyuPCSBaPcFKIh9zNVwPIvg+PC3 ng/eb1I7n/2Dl80AGzAM0OsWe5N9Rf28yY+m/PGyf5eTTaHNKx+K9spLigWR67DUXmk7 r6h/1qPu6Q2YMbIWQHV5adMNR293bn1ZzWDHs= MIME-Version: 1.0 Received: by 10.227.145.69 with SMTP id c5mr1191190wbv.168.1283706209090; Sun, 05 Sep 2010 10:03:29 -0700 (PDT) Received: by 10.227.143.130 with HTTP; Sun, 5 Sep 2010 10:03:29 -0700 (PDT) In-Reply-To: References: <20100901054728.50C7D23889D7@eris.apache.org> Date: Sun, 5 Sep 2010 22:33:29 +0530 Message-ID: Subject: Re: svn commit: r991441 - /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/Java2WSDLConstants.java From: Amila Suriarachchi To: java-dev@axis.apache.org Content-Type: multipart/alternative; boundary=001636833d4696bd4a048f8624d7 --001636833d4696bd4a048f8624d7 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Sep 5, 2010 at 2:24 PM, Andreas Veithen wrote: > On Sun, Sep 5, 2010 at 05:12, Isuru Suriarachchi > wrote: > > > > > > On Sat, Sep 4, 2010 at 5:26 PM, Andreas Veithen < > andreas.veithen@gmail.com> > > wrote: > >> > >> On Thu, Sep 2, 2010 at 08:39, Isuru Suriarachchi > >> wrote: > >> > > >> > > >> > On Thu, Sep 2, 2010 at 1:47 AM, Andreas Veithen > >> > > >> > wrote: > >> >> > >> >> How can a namespace prefix conflict with a URI scheme? That sounds > >> >> like a quick and dirty workaround for a more fundamental issue. > >> > > >> > Let me explain it further.. I came up with a WSDL generated by our > >> > AxisService2WSDL11 class which has the following wsaw:Action for some > >> > message of some operation. > >> > > >> > wsaw:Action="http://www.webtest.org/echoStringMethodRequest" > >> > > >> > And also there is a namespace declaration in this WSDL as follows.. > >> > > >> > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" > >> > > >> > When I generate the stub for this WSDL, it sets the Action on the stub > >> > as > >> > follows.. > >> > > >> > > >> > _operationClient.getOptions().setAction("// > www.webtest.org/echoStringMethodRequest"); > >> > > >> > So this is due to the usage of "http" as a namespace prefix and it has > >> > treated the http://.. URL as :. > >> > >> The SOAP action is a URI, not a QName, so there is no reason why the > >> code generator would interpret "http" as a prefix. > > > > Yes agreed.. > > > >> > >> I think you should > >> try to determine why it is doing that instead of working around the > >> issue by changing the WSDL generation code. > > > > I did have a look into the code generator code. There, wsdl4j returns the > > action as a QName. That is why this issue occurs. Have a look at the > > getWSAWActionExtensionAttribute(AttributeExtensible ae) method in > > WSDL11ActionHelper. Ideally it should provide a method to get the string > > value of the attribute. But currently there's no such method. > > Then I would suggest to review the following code in > WSDL11ActionHelper#getWSAWActionExtensionAttribute: > > if (attribute instanceof QName) { > QName qn = (QName) attribute; > attribute = qn.getLocalPart(); > } > > The code is used only for the action attribute and we know that the > action is not a QName. Thus, instead of just taking the local part, we > should rebuild the qualified name (prefix + ":" + localPart) to > reconstruct the original value of the attribute. WDYT? > In this case prefix seems to be returning "". I think all these code is written since it does not have a method like getAttribute(String). Therefore one would say all these code is a hack because of the above reason. thanks, Amila. > > >> > >> > Thanks, > >> > ~Isuru > >> > > >> >> > >> >> Andreas > >> >> > >> >> On Wed, Sep 1, 2010 at 07:47, wrote: > >> >> > Author: isurues > >> >> > Date: Wed Sep 1 05:47:27 2010 > >> >> > New Revision: 991441 > >> >> > > >> >> > URL: http://svn.apache.org/viewvc?rev=991441&view=rev > >> >> > Log: > >> >> > changing the http prefix from http to http1. This is because, use > of > >> >> > http as a prefix causes conflicts with actual URLs like > >> >> > http://foo.com > >> >> > > >> >> > Modified: > >> >> > > >> >> > > >> >> > > axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/Java2WSDLConstants.java > >> >> > > >> >> > Modified: > >> >> > > >> >> > > axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/Java2WSDLConstants.java > >> >> > URL: > >> >> > > >> >> > > http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/Java2WSDLConstants.java?rev=991441&r1=991440&r2=991441&view=diff > >> >> > > >> >> > > >> >> > > ============================================================================== > >> >> > --- > >> >> > > >> >> > > axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/Java2WSDLConstants.java > >> >> > (original) > >> >> > +++ > >> >> > > >> >> > > axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/Java2WSDLConstants.java > >> >> > Wed Sep 1 05:47:27 2010 > >> >> > @@ -45,7 +45,7 @@ public interface Java2WSDLConstants { > >> >> > > >> >> > String HTTP_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/http/ > "; > >> >> > String MIME_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/mime/ > "; > >> >> > - String HTTP_PREFIX = "http"; > >> >> > + String HTTP_PREFIX = "http1"; > >> >> > String MIME_PREFIX = "mime"; > >> >> > String URN_PREFIX = "urn"; > >> >> > String COLON_SEPARATOR = ":"; > >> >> > > >> >> > > >> >> > > >> >> > >> >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org > >> >> For additional commands, e-mail: java-dev-help@axis.apache.org > >> >> > >> > > >> > > >> > > >> > -- > >> > Technical Lead, > >> > WSO2 Inc. http://wso2.org/ > >> > Blog : http://isurues.wordpress.com/ > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org > >> For additional commands, e-mail: java-dev-help@axis.apache.org > >> > > > > > > > > -- > > Technical Lead, > > WSO2 Inc. http://wso2.org/ > > Blog : http://isurues.wordpress.com/ > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org > For additional commands, e-mail: java-dev-help@axis.apache.org > > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ --001636833d4696bd4a048f8624d7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sun, Sep 5, 2010 at 2:24 PM, Andreas = Veithen <= andreas.veithen@gmail.com> wrote:
On Sun, Sep 5, 2010 at 05:12, Isuru Suria= rachchi <isurues@gmail.com> = wrote:
>
>
> On Sat, Sep 4, 2010 at 5:26 PM, Andreas Veithen <andreas.veithen@gmail.com>
> wrote:
>>
>> On Thu, Sep 2, 2010 at 08:39, Isuru Suriarachchi <isurues@gmail.com>
>> wrote:
>> >
>> >
>> > On Thu, Sep 2, 2010 at 1:47 AM, Andreas Veithen
>> > <andreas.veit= hen@gmail.com>
>> > wrote:
>> >>
>> >> How can a namespace prefix conflict with a URI scheme? Th= at sounds
>> >> like a quick and dirty workaround for a more fundamental = issue.
>> >
>> > Let me explain it further.. I came up with a WSDL generated b= y our
>> > AxisService2WSDL11 class which has the following wsaw:Action = for some
>> > message of some operation.
>> >
>> > wsaw:Action=3D"http://www.webtest.org/echoStringMethod= Request"
>> >
>> > And also there is a namespace declaration in this WSDL as fol= lows..
>> >
>> > xmlns:http=3D"http://schemas.xmlsoap.org/wsdl/http/" >> >
>> > When I generate the stub for this WSDL, it sets the Action on= the stub
>> > as
>> > follows..
>> >
>> >
>> > _operationClient.getOptions().setAction("//www.webtest= .org/echoStringMethodRequest");
>> >
>> > So this is due to the usage of "http" as a namespac= e prefix and it has
>> > treated the http://.. URL as <prefix>:<localname>= .
>>
>> The SOAP action is a URI, not a QName, so there is no reason why t= he
>> code generator would interpret "http" as a prefix.
>
> Yes agreed..
>
>>
>> I think you should
>> try to determine why it is doing that instead of working around th= e
>> issue by changing the WSDL generation code.
>
> I did have a look into the code generator code. There, wsdl4j returns = the
> action as a QName. That is why this issue occurs. Have a look at the > getWSAWActionExtensionAttribute(AttributeExtensible ae) method in
> WSDL11ActionHelper. Ideally it should provide a method to get the stri= ng
> value of the attribute. But currently there's no such method.

Then I would suggest to review the following code in
WSDL11ActionHelper#getWSAWActionExtensionAttribute:

=A0 =A0 =A0 =A0if (attribute instanceof QName) {
=A0 =A0 =A0 =A0 =A0 =A0QName qn =3D (QName) attribute;
=A0 =A0 =A0 =A0 =A0 =A0attribute =3D qn.getLocalPart();
=A0 =A0 =A0 =A0}

The code is used only for the action attribute and we know that the
action is not a QName. Thus, instead of just taking the local part, we
should rebuild the qualified name (prefix + ":" + localPart) to reconstruct the original value of the attribute. WDYT?

In this case prefix seems to be returning "".

I thin= k all these code is written since it does not have a method like getAttribu= te(String). Therefore one would say all these code is a hack because of the= above reason.

thanks,
Amila.


=A0

>>
>> > Thanks,
>> > ~Isuru
>> >
>> >>
>> >> Andreas
>> >>
>> >> On Wed, Sep 1, 2010 at 07:47, =A0<isurues@apache.org> wrote:
>> >> > Author: isurues
>> >> > Date: Wed Sep =A01 05:47:27 2010
>> >> > New Revision: 991441
>> >> >
>> >> > URL: http://svn.apache.org/viewvc?rev=3D= 991441&view=3Drev
>> >> > Log:
>> >> > changing the http prefix from http to http1. This is= because, use of
>> >> > http as a prefix causes conflicts with actual URLs l= ike
>> >> > http://= foo.com
>> >> >
>> >> > Modified:
>> >> >
>> >> >
>> >> > =A0axis/axis2/java/core/trunk/modules/kernel/src/org= /apache/axis2/description/java2wsdl/Java2WSDLConstants.java
>> >> >
>> >> > Modified:
>> >> >
>> >> > axis/axis2/java/core/trunk/modules/kernel/src/org/ap= ache/axis2/description/java2wsdl/Java2WSDLConstants.java
>> >> > URL:
>> >> >
>> >> > http://svn.apache.org/viewvc/axis/axis2/java/cor= e/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/Java2WSDL= Constants.java?rev=3D991441&r1=3D991440&r2=3D991441&view=3Ddiff=
>> >> >
>> >> >
>> >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> >> > ---
>> >> >
>> >> > axis/axis2/java/core/trunk/modules/kernel/src/org/ap= ache/axis2/description/java2wsdl/Java2WSDLConstants.java
>> >> > (original)
>> >> > +++
>> >> >
>> >> > axis/axis2/java/core/trunk/modules/kernel/src/org/ap= ache/axis2/description/java2wsdl/Java2WSDLConstants.java
>> >> > Wed Sep =A01 05:47:27 2010
>> >> > @@ -45,7 +45,7 @@ public interface Java2WSDLConstant= s {
>> >> >
>> >> > =A0 =A0 String HTTP_NAMESPACE =3D "http://schemas.xmls= oap.org/wsdl/http/";
>> >> > =A0 =A0 String MIME_NAMESPACE =3D "http://schemas.xmls= oap.org/wsdl/mime/";
>> >> > - =A0 =A0String HTTP_PREFIX =3D "http"; >> >> > + =A0 =A0String HTTP_PREFIX =3D "http1"; >> >> > =A0 =A0 String MIME_PREFIX =3D "mime";
>> >> > =A0 =A0 String URN_PREFIX =3D "urn";
>> >> > =A0 =A0 String COLON_SEPARATOR =3D ":"; >> >> >
>> >> >
>> >> >
>> >>
>> >> ---------------------------------------------------------= ------------
>> >> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
>> >> For additional commands, e-mail: java-dev-help@axis.apache.org
>> >>
>> >
>> >
>> >
>> > --
>> > Technical Lead,
>> > WSO2 Inc. http= ://wso2.org/
>> > Blog : http://isurues.wordpress.com/
>> >
>>
>> ------------------------------------------------------------------= ---
>> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-dev-help@axis.apache.org
>>
>
>
>
> --
> Technical Lead,
> WSO2 Inc. http://wso2.o= rg/
> Blog : htt= p://isurues.wordpress.com/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org




--
Amila Suria= rachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/
--001636833d4696bd4a048f8624d7--