Tuesday, September 19 2006 @ 11:09 AM PDT (Read 132966 times)
Active Member
Status: offline
Registered: 09/19/06
Posts: 30
Trying to do a simple call to the service. Can't seeem to figure this error out...
The specified type was not recognized: name='ProductSearchResponse', namespace='http://product.service.cj.com', at <searchReturn xmlns='http://DefaultNamespace'>.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The specified type was not recognized: name='ProductSearchResponse', namespace='http://product.service.cj.com', at <searchReturn xmlns='http://DefaultNamespace'>.
Here is the code (ASP.NET / VB.NET)
Dim ProdSearch As New com.cj.api.ProductSearchService
Dim ProdSearchResponse As New com.cj.api.ProductSearchResponse
Dim ProdData As New com.cj.api.ProductData
ProdSearchResponse = ProdSearch.search(strDevKey, strPID, "", "nike", "", "", "", "", "", "", "", "", "", 0, 10)
Response.Write(ProdSearchResponse.products(0).name)
I changed the namespace from http://DefaultNamespace to http://productservice.cj.com
Looks like this:
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace:="http://product.service.cj.com", ResponseNamespace:="http://product.service.cj.com", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Now it loads up, but doesn't fill the produts array (I can see the total totalPossible though) ?!?
Thows an "Index was outside the bounds of the array."
I changed the namespace from http://DefaultNamespace to http://productservice.cj.com
Looks like this:
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace:="http://product.service.cj.com", ResponseNamespace:="http://product.service.cj.com", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Now it loads up, but doesn't fill the produts array (I can see the total totalPossible though) ?!?
Thows an "Index was outside the bounds of the array."
Can you please tell me the code you used (minus developer id and websiteid of course ). Here is what I am trying:
using com.cj.api;
...
ProductSearchResponse psr = new ProductSearchResponse();
ProductSearchService con;
con = new ProductSearchService();
psr.products = con.search("myDeveloperID", 123456, "joined", "mystuff", "", "", "mymanufacturer", "", "", "", "", "", "", 0, 3);
foreach (ProductData pd in psr.products)
Response.Write(pd.description);
Is this how you approach this? I had the same first error you did and then changed what you suggested, but now I get:
Parser Error Message: Unable to import binding 'productSearchServiceSoapBinding' from namespace 'http://api.cj.com'.
Any ideas? Could you share you code perhaps? Thank you for any help. Asp.net 2.0 c#. I can translate VB fine, if you used that.
To keep from getting any errors I updated my web reference and put in the URL:
http://api.cj.com/
When the page comes up select axis.
Run the page. I get no errors, but I also get no data. Probably now because I just have to work it out.
Hmm, as I said before I got it to the point where it loads the data, but not the products array. Have you gotten any product results?
No. I get object reference not set, but my guess is that is because no results are coming back. products[0].name isn't equal to anything. Could be our merchant isn't participating. How do we know?
No. I get object reference not set, but my guess is that is because no results are coming back. products[0].name isn't equal to anything. Could be our merchant isn't participating. How do we know?
Yes, but we are signed up with numerous merchants, and I'm certain some of them are participating. I'll try it again and see if I get any results. Check the "totalPossible" variable, if it is > 1 then there should be some results ??
No. I get object reference not set, but my guess is that is because no results are coming back. products[0].name isn't equal to anything. Could be our merchant isn't participating. How do we know?
Yes, but we are signed up with numerous merchants, and I'm certain some of them are participating. I'll try it again and see if I get any results. Check the "totalPossible" variable, if it is > 1 then there should be some results ??
I always have 0. I used "joined" in the advertiserID. I have tried two different types from merchants. I have also tried notjoined. No luck.