wood burning stoves 2.0*
The moose likes Web Services and the fly likes Making Webmethod parameters mandatory? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Making Webmethod parameters mandatory?" Watch "Making Webmethod parameters mandatory?" New topic
Author

Making Webmethod parameters mandatory?

Sree SaiRam
Greenhorn

Joined: Jan 18, 2013
Posts: 1
Hi

I am working on webservice bottom up approach on IRAD 7 with jaxws 2.1.and jaxb

I want to make webmethod parameters mandatory,I tried using @Xmlelement(required=true)
but it is not updating my XSd.

Can you suggest a suitable approach to make my webmethod parameters mandatory


Thanks in Advance.
rama.
joy lobo
Greenhorn

Joined: Jan 19, 2013
Posts: 1
Hi,

I have WebService (C#) with one WebMethod that takes 4 parameters, as below:

<s:element minOccurs="0" maxOccurs="1" name="requestedBy" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="submissionDateTime" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="orderReference" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="currentState" type="s:string" />

My problem is that I would like every one of these arguments to be mandatory when being call by the client i.e.

<s:element minOccurs="1" maxOccurs="1" name="requestedBy" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="submissionDateTime" type="s:dateTime" />
<s:element minOccurs="1" maxOccurs="1" name="orderReference" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="currentState" type="s:string" />

If it is not clear what my problem is from this then please let me know and I will try to clarify.


Internet Marketing Auckland | Web Design Auckland
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Making Webmethod parameters mandatory?
 
Similar Threads
Axis 1.4 does not validate input parameters?
JAX-WS sending Document/Literal Bare throws exception
What to do, if we have 130 to 150 attributes/fields/parameters for a web service..???
Please help, need an expert in java.policy
JBoss WS error when calling service defined with no argument