You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Philippe Couas <pc...@infodev.fr> on 2004/07/21 18:13:37 UTC

RE : How Limit String Size parameter in SOAP service

Hi,

I have keeping parameter like String Class and i verify length in my
Service.
But my Customer language as String type with length he says me
VARCHAR(15) .


Regards
Philippe


-----Message d'origine-----
De : Scott Nichol [mailto:snicholnews@scottnichol.com] 
Envoyé : mercredi 21 juillet 2004 17:50
À : soap-user@ws.apache.org
Objet : Re: How Limit String Size parameter in SOAP service


I think that in WSDL, you can create a type that is a restriction of
string and specify that the length is 15.  This provides a clue to a
WSDL client.  However, the service, regardless of whether it is WSDL
aware, must check for the correct length itself, unless it uses an XML
parser that validates against XML Schema.

My recommendation is to have your service check that the length of the
incoming string is 15 characters.  If it is not, throw an exception.
That exception will be turned into a SOAP Fault by Apache SOAP, which
the client will receive.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Philippe Couas" <pc...@infodev.fr>
To: <so...@ws.apache.org>
Sent: Wednesday, July 21, 2004 3:25 AM
Subject: How Limit String Size parameter in SOAP service


Hi,
 
Currtently My SOAP service use method with String parameter. But in fact
my String size has always 15 caracters. Could i define a SOAP service
with a limited string parameter like
StringBuffer(15)
 
Regards,
Philippe
 
Philippe COUAS

Responsable Développement

INFODEV S.A.

 




Re: How Limit String Size parameter in SOAP service

Posted by Scott Nichol <sn...@scottnichol.com>.
The varchar(15) refers to a database data type.  Technically, because it is "varchar", it can be any length from 0 to 15 characters.  In any case, such a piece of data would be exchanged as a "string" (or "xsd:string") using SOAP.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Philippe Couas" <pc...@infodev.fr>
To: <so...@ws.apache.org>
Sent: Wednesday, July 21, 2004 12:13 PM
Subject: RE : How Limit String Size parameter in SOAP service


Hi,

I have keeping parameter like String Class and i verify length in my
Service.
But my Customer language as String type with length he says me
VARCHAR(15) .


Regards
Philippe


-----Message d'origine-----
De : Scott Nichol [mailto:snicholnews@scottnichol.com] 
Envoyé : mercredi 21 juillet 2004 17:50
À : soap-user@ws.apache.org
Objet : Re: How Limit String Size parameter in SOAP service


I think that in WSDL, you can create a type that is a restriction of
string and specify that the length is 15.  This provides a clue to a
WSDL client.  However, the service, regardless of whether it is WSDL
aware, must check for the correct length itself, unless it uses an XML
parser that validates against XML Schema.

My recommendation is to have your service check that the length of the
incoming string is 15 characters.  If it is not, throw an exception.
That exception will be turned into a SOAP Fault by Apache SOAP, which
the client will receive.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Philippe Couas" <pc...@infodev.fr>
To: <so...@ws.apache.org>
Sent: Wednesday, July 21, 2004 3:25 AM
Subject: How Limit String Size parameter in SOAP service


Hi,
 
Currtently My SOAP service use method with String parameter. But in fact
my String size has always 15 caracters. Could i define a SOAP service
with a limited string parameter like
StringBuffer(15)
 
Regards,
Philippe
 
Philippe COUAS

Responsable Développement

INFODEV S.A.