You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Mittermaier, Christian" <Ch...@fabasoft.com> on 2002/08/22 11:58:18 UTC

WSDL2Java and '&' in Service URL

Hi all,

I am using AXIS in order to consume web services provided by my
company's software product. As there are WSDLs available for the
services, I have used WSDL2Java to generate all the necessary stuff and
call the service by a few lines of code (which actually works apart from
some minor modifications).

Analyzing the Java classes and stubs generated by WSDL2Java I realized
that WSDL2Java does not handle quoted characters in the service URL.
To make it clear, look at the <service> element of the WSDL:

<service name="FSCGOVXML_SOAPSearch">
	<port name="FSCSoapSoapPort"
binding="wsdlns:FSCSoapSoapBinding">
		<soap:address
location="http://fb232/fsc/fscdav/wsdl?ACTIONS=COO.1.1001.1.58817&style=
doc"/>
	</port>
</service>

In order to make this valid XML, one as to quote the '&' in the location
URL to '&amp;' (at least, my XML aware browser reports an error if I
don't do it like this), so actually the <soap:address> element looks
like the following (e.g. when saved to a file):

		<soap:address
location="http://fb232/fsc/fscdav/wsdl?ACTIONS=COO.1.1001.1.58817&amp;st
yle=doc"/>

In the FSCGOVXML_SOAPSearchLocator class generated by WSDL2Java, the
string

	private final java.lang.String FSCSoapSoapPort_address

is not aware of the quoted '&', i.e. it is generated as
	
"http://fb232/fsc/fscdav/wsdl?ACTIONS=COO.1.1001.1.58817&amp;style=doc"
instead of
	
"http://fb232/fsc/fscdav/wsdl?ACTIONS=COO.1.1001.1.58817&style=doc"
which would be correct.

I am not sure, if this is a bug of WSDL2Java or if I am under a
misapprehension?!?!
Please give any comments/clarifications?

Chris

RE: WSDL2Java and '&' in Service URL

Posted by Tom Zschaage <To...@first.fraunhofer.de>.
It must be a WSDL2Java bug since the XML specification says about entity
normalization http://www.w3.org/TR/REC-xml#AVNormalize
And every WSDL file is conformant to XML
http://www.w3.org/TR/wsdl12/#intro

Sometimes it's in the spec (o:

Tom
Fraunhofer Institute


-----Ursprüngliche Nachricht-----
Von: Mittermaier, Christian [mailto:Christian.Mittermaier@fabasoft.com] 
Gesendet: Donnerstag, 22. August 2002 11:58
An: axis-user@xml.apache.org
Betreff: WSDL2Java and '&' in Service URL

Hi all,

I am using AXIS in order to consume web services provided by my
company's software product. As there are WSDLs available for the
services, I have used WSDL2Java to generate all the necessary stuff and
call the service by a few lines of code (which actually works apart from
some minor modifications).

Analyzing the Java classes and stubs generated by WSDL2Java I realized
that WSDL2Java does not handle quoted characters in the service URL.
To make it clear, look at the <service> element of the WSDL:

<service name="FSCGOVXML_SOAPSearch">
	<port name="FSCSoapSoapPort"
binding="wsdlns:FSCSoapSoapBinding">
		<soap:address
location="http://fb232/fsc/fscdav/wsdl?ACTIONS=COO.1.1001.1.58817&style=
doc"/>
	</port>
</service>

In order to make this valid XML, one as to quote the '&' in the location
URL to '&amp;' (at least, my XML aware browser reports an error if I
don't do it like this), so actually the <soap:address> element looks
like the following (e.g. when saved to a file):

		<soap:address
location="http://fb232/fsc/fscdav/wsdl?ACTIONS=COO.1.1001.1.58817&amp;st
yle=doc"/>

In the FSCGOVXML_SOAPSearchLocator class generated by WSDL2Java, the
string

	private final java.lang.String FSCSoapSoapPort_address

is not aware of the quoted '&', i.e. it is generated as
	
"http://fb232/fsc/fscdav/wsdl?ACTIONS=COO.1.1001.1.58817&amp;style=doc"
instead of
	
"http://fb232/fsc/fscdav/wsdl?ACTIONS=COO.1.1001.1.58817&style=doc"
which would be correct.

I am not sure, if this is a bug of WSDL2Java or if I am under a
misapprehension?!?!
Please give any comments/clarifications?

Chris