wsdl datasource not able to display in grid

Hello,
I am trying to fetch the data from wsdl datasource and display it on grid. I am using smartclient server for evaluation purpose. But I am not able to see the data on the grid. Header is displaying but not data.

<HTML><HEAD>
 <SCRIPT>var isomorphicDir="../../isomorphic/";</SCRIPT>
 <SCRIPT SRC=../../isomorphic/system/modules/ISC_Core.js></SCRIPT>
 <SCRIPT SRC=../../isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
  <SCRIPT SRC=../../isomorphic/system/modules/ISC_Containers.js></SCRIPT>
  <SCRIPT SRC=../../isomorphic/system/modules/ISC_Grids.js></SCRIPT>
  <SCRIPT SRC=../../isomorphic/system/modules/ISC_Forms.js></SCRIPT>
<SCRIPT SRC=../../isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
<SCRIPT SRC=../../isomorphic/skins/SmartClient/load_skin.js></SCRIPT>
<!--<SCRIPT SRC="ProductSearch.js"></SCRIPT>-->
</HEAD><BODY BGCOLOR='#e0e0e0' MARGINHEIGHT=0 MARGINWIDTH=0 LEFTMARGIN=0 TOPMARGIN=0>
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=5 BORDER=0><TR><TD CLASS=pageHeader BGCOLOR=WHITE>

	Web Service Binding (PRODUCT SEARCH)

</TD></TR></TABLE><TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0><TR>
<TD BGCOLOR=336666><IMG SRC=images/blank.gif WIDTH=1 HEIGHT=4></TD></TR></TABLE>
<script>
isc.VLayout.create({
    width: "80%",
    height: "70%",
    top:150,
	members: [

isc.SearchForm.create({
    ID: "searchForm",
    numCols: 4,
    wsdlLoaded: function () {
        isc.clearPrompt();
        var service = isc.WebService.get("http://com/net/service");
        if (service == null) {
            isc.warn("WSDL not currently available  (tried"
                    +"http://localhost:7001/Test/ProductSearch?wsdl)");

        }
        
        this.setDataSource(service.getInputDS("search"));
        var myResults = isc.DataSource.create({
            serviceNamespace : service.serviceNamespace,
            wsOperation : "search",
            recordName : "searchResponse", 
           fields:[
           {name:"ProductId", type:"long", xmlRequired:true},
           {nillable:"true", name:"ProductName", type:"string", xmlRequired:true},
           {nillable:"true", name:"ProductLevel", type:"ProductLevel", xmlRequired:true},
           {name:"ConsumptionViewExist", type:"boolean", xmlRequired:true},
            {name:"SupplyViewExist", type:"boolean", xmlRequired:true},
            {name:"PlantDetailsExist", type:"boolean", xmlRequired:true}
            ]
        });
		      
        searchResults.setDataSource(myResults);

    }
}),

isc.Button.create({
    title: "Search",
    click: "searchResults.fetchData(searchForm.getValuesAsCriteria())"
}),

isc.ListGrid.create({
    ID: "searchResults",
    width:"80%",
    height:500,
    wrapCells:true,
    fixedRecordHeights:false,
    showAllRecords:true,
    alternateRecordStyles:true,
    dataSource:"myResults"
   
})

]
});

isc.showPrompt("Loading WSDL from http://localhost:7001/Test/ProductSearch?wsdl");

isc.XMLTools.loadWSDL("http://localhost:7001/Test/ProductSearch?wsdl", "searchForm.wsdlLoaded()");

</script>

</BODY>
</HTML>

Thanks for your help in advance.

Hi Sima,

It looks like your recordName setting isn’t putting you in the right part of the response message for your field declarations. The “searchResponse” appears like it will have a series of sublements named “return” which in turn have subelements “ResultProduct” which finally have the subelements your dataSource.fields declaration describes.

At a glance, recordName should be “ResultProduct”. We have not actually set up a simulation and tried this, so if that doesn’t work immediately, try eg calling dataSource.fetchData() directly and see what data is being parsed out of the message.

Still not able to display data to the grid

Hello, thanks for the response. I am still unable to display data in the grid. I have changed the wsdl to bring element into an array. I tried Datasource.fetchData(), but it gives me transport error.
I am setting recordXPath:“//ResultProduct”,
What do I set for recordXPath ?

Thanks

We’d recommend you stick with recordName rather than recordXPath. A recordName of “ResultProduct”, as previously recommended, looks like it’s still correct with the new WSDL. If that doesn’t work, let us know - we have a simulator where we can run your WSDL with dummy data.

Calling dataSource.fetchData() is equivalent to what you are doing with searchResults.fetchData() below. The transport error may indicate that you are not passing required data and your web service is returning a 500 server error. Enable the RPCManager log category in the Developer Console to see what’s going on. If the logs don’t make the problem clear, it would be useful to share them here.

Just to clarify recordName vs recordXPath: recordXPath would also work but using it is more difficult - you need to have a strong familiarity with XML namespacing. See DataSource.xmlNamespaces if curious.

Hi,
I have changed the code to use datasource.fetchData as you suggested.

myResults.fetchData(searchForm.getValuesAsCriteria());

But now I am getting the following error.

=== 2008-03-10 15:25:20,607 [sor2] ERROR IDACall - Top-level servlet error:
java.lang.Exception: Non-RPC request ignored.
        at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:860)
        at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:201)
        at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:90)
        at com.isomorphic.servlet.IDACall.doGet(IDACall.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:269)

I am using smartclient serverside code. Please let me know what is the cause of this error.

Thanks

Hi sima,

Most likely the DataSource “myResults” is not associated with your web service. Ordinarily you associate a DataSource with a web service by setting dataSource.serviceNamespace to match the namespace of a loaded WSDL file. This will cause the DataSource to attempt to contact the web service at the URL indicated by the location attribute of the <soap:address> element.

A DataSource that is not associated with a web service is going to contact the default actionURL and would show an error like what you are seeing.

Your previous code for creating “myResults” and associating it with a web service was correct. Perhaps you have changed it?

Just to clarify, the recommendation was to use dataSource.fetchData() as a debugging technique. Your previous code was correct for displaying results in the grid. dataSource.fetchData() is a lower-level method that does not affect UI components - see the docs for dataSource.fetchData() for more detail.

Hello Isomorpic,
I haven’t changed the code much.

But now I am getting the javascript error Line 409, char 138, “o” is null or not an object. Please let me know if am missing anything ?
Thanks for all your help.

Hi Sima,

Running your code and your WSDL in a stock SmartClient 6.0 SDK, I see that pressing the Search button sends a well-formed SOAP message to the URL set as the soap:address@location in your WSDL file (http://140.176.196.238:7001/Test/ProductSearch). This is all correct. Of course for me, this then times out, because I can’t access your web service.

There’s really no way to get ‘“o” is null or not an object’ using just the code you’ve shown. There is no “o” variable in your code, and because SmartClient is run through an obfuscator, we can say definitively that there is no “o” variable in SmartClient that could cause this error.

You haven’t said whether this error occurs before the SOAP request is sent, during, or after. Regardless, there are Debugging guidelines here. There are several steps you can take for a JS error, and then the Debugging topic explains how to gather information in order to ask for help. You can also look at diagnostic log categories, and post that output here. The RPCManager log category set to DEBUG would be helpful for troubleshooting this interaction.

If you’d rather just breeze by this and other learning curve issues, Isomorphic also offers both training and prototyping services - contact us here about those.