Showing posts with label bit. Show all posts
Showing posts with label bit. Show all posts

Monday, March 26, 2012

How do I debug the ...Behavior.js?

Im allways trying to solve my problems at first hand, but this Atlas-technology gives me a bit headacheGeeked

How do I debug my way through a behavior.js file? For instance, the DynamicPopulateBehavior.js. It would be nice to take a closer look at why the webservicecall failsCool

Cheers
Janus

Hi Janus,

You should first check outhttp://atlas.asp.net/docs/Overview/debug.aspx, which briefly explains how you can debug using VS. The VS approach is still a little rough through, so it can be nicely augmented with client-side only debuggers such asFireBug.

Thanks,
Ted

How do I create a WebService with mandatory elements in the request?

I need a bit of assitance creating a WebService. Say that I have something like this -

'The objectsPublic Class productPublic nameAs StringPublic priceAs DecimalEnd ClassPublic Class orderPublic customerAs StringPublic productsAs List(Of product)End Class'The DB layerPublic orderDBPublic Function commitOrder(orderAs order)As IntegerDim orderIdAs Integer'DB code ommittedReturn orderIdEnd FunctionEnd Class'The Web Service<System.Web.Services.WebService(Namespace:="http://localhost/")> _<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<ToolboxItem(False)> _Public Class order_wsInherits System.Web.Services.WebService <WebMethod()> _Public Function commitOrder(ByVal orderAs order)As Integer Dim orderDBAs New orderDB()Return orderDB.commitOrder(order)End FunctionEnd Class
The WSDL I get contains something like -

<s:element name="commitOrder"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="order" type="tns:order" /></s:sequence></s:complexType></s:element><s:complexType name="order"><s:sequence><s:element minOccurs="0" maxOccurs="1" name="customer" type="s:string" /><s:element minOccurs="0" maxOccurs="1" name="products" type="tns:ArrayOfproducts" /></s:sequence></s:complexType><s:complexType name="ArrayOfproducts"><s:sequence><s:element minOccurs="0" maxOccurs="unbounded" name="product" nillable="true" type="tns:product" /></s:sequence></s:complexType><s:complexType name="product"><s:sequence><s:element minOccurs="0" maxOccurs="1" name="name" type="s:string" /><s:element minOccurs="0" maxOccurs="1" name="price" type="s:decimal" /></s:sequence></s:complexType>

Notice that everything is minoccurs="0" and the product entry in the ArrayOfproducts is nillable. How do I make it so that specific bits are required (minoccurs="1" and/or product element not nillable)?

Thanks

Martin

You could set a web service header so they always send you those requiered fields.


I'm not sure that I understand what you mean. But, just to elaborate on what I am looking for, the WSDL should contain tags that specify minOccurs="1".


Might be better to use discrete parameters rather than sending an order object. Most people find that more straightforward to use.


How would you control mandatory / optional elements using discrete parameters?

In any case, I'm already severely restricted in my attempts to use best coding practices by the inadequacies of .Net's WebService implementation. If I can't even control mandatory elements in this scenario I'll give it a miss and look at using Java and Mule.

Wednesday, March 21, 2012

How can I implement the following component using Ajax/ATLAS/Ajax Control Toolkit??

Hi All,

I'd like to implement something a little bit simmilar to a TreeView (with 2 levels). The structure I'd like to present is a set of Groups where one of them can be selected and then it expands (and collapses any previouslly opened group) presenting the subgroups and clicking on one of them it also expands to show the elements (also closing the previouslly opened groups).

MAIN GROUP 1 (opened)

-- GROUP 1 (closed)

-- GROUP2 (opened)

--- ELEMENT 1

--- ELEMENT2

-- GROUP3 (closed)

MAIN GROUP 2 (closed)

MAIN GROUP 3 (closed)

For user experience purposes I think two Accordion controls nested would be a very nice solution ( The external one will have the panes containing a Accordion control containing the Groups as panes and within this one a table or grid containing the elements), but I have to get the internal elements (either groups or elements) from a business object when a item is selected and shall be expanded).

Please could anyone tell me if it is possible and, if so, how can I implement this?

Thanks in advance,


Sergio

HI All,

Still looking for an answer.. Could anyone help me? I'm thinking about using AJax directly through a javascript function, get a table according the layout I need and put it into a DIV using innerHtml instead of using the component (a worst using experince, but seems the reasonable solution right now)Sad