Web Services
 Welcome to Web Services
 Tuesday, February 09 2010 @ 09:34 AM PST

 Forum Index > Web Services forum > General New Topic Post Reply
 Error coding in .NET
 |  Printable Version
marcmez
 Tuesday, September 19 2006 @ 11:09 AM PDT (Read 132966 times)  
Forum Active Member
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)


 
Profile Email Website
Quote
TLE
 Tuesday, September 19 2006 @ 11:18 AM PDT  
Forum Active Member
Active Member

Status: offline

Registered: 09/18/06
Posts: 44

Could be another DNS related issue, for the product.service.cj.com host name.
Tuan
************


nslookup product.service.cj.com ns1.mediaplex.com
Server: fs1.snv.mediaplex.com
Address: 64.158.223.64

*** fs1.snv.mediaplex.com can't find product.service.cj.com: Non-existent domain

nslookup product.service.cj.com ns2.mediaplex.com

(root) nameserver = I.ROOT-SERVERS.NET
(root) nameserver = J.ROOT-SERVERS.NET
(root) nameserver = K.ROOT-SERVERS.NET
(root) nameserver = L.ROOT-SERVERS.NET
(root) nameserver = M.ROOT-SERVERS.NET
(root) nameserver = A.ROOT-SERVERS.NET
(root) nameserver = B.ROOT-SERVERS.NET
(root) nameserver = C.ROOT-SERVERS.NET
(root) nameserver = D.ROOT-SERVERS.NET
(root) nameserver = E.ROOT-SERVERS.NET
(root) nameserver = F.ROOT-SERVERS.NET
(root) nameserver = G.ROOT-SERVERS.NET
(root) nameserver = H.ROOT-SERVERS.NET
*** Can't find server name for address 64.70.10.79: No information
Server: UnKnown
Address: 64.70.10.79

*** UnKnown can't find product.service.cj.com: Non-existent domain


 
Profile Email
Quote
marcmez
 Tuesday, September 19 2006 @ 11:24 AM PDT  
Forum Active Member
Active Member

Status: offline

Registered: 09/19/06
Posts: 30

Hmm...

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."


 
Profile Email Website
Quote
johnny
 Wednesday, September 20 2006 @ 07:41 PM PDT  
Forum New
New

Status: offline

Registered: 09/20/06
Posts: 8

Quote by: marcmez

Hmm...

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 Smile ). 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.


 
Profile Email
Quote
johnny
 Wednesday, September 20 2006 @ 07:48 PM PDT  
Forum New
New

Status: offline

Registered: 09/20/06
Posts: 8

sorry, I saw your code above. Couldn't edit or delete my post. I'll keep trying. Thanks.


 
Profile Email
Quote
johnny
 Wednesday, September 20 2006 @ 08:26 PM PDT  
Forum New
New

Status: offline

Registered: 09/20/06
Posts: 8

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.


 
Profile Email
Quote
marcmez
 Wednesday, September 20 2006 @ 08:31 PM PDT  
Forum Active Member
Active Member

Status: offline

Registered: 09/19/06
Posts: 30

Quote by: johnny

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?


 
Profile Email Website
Quote
johnny
 Wednesday, September 20 2006 @ 08:33 PM PDT  
Forum New
New

Status: offline

Registered: 09/20/06
Posts: 8

Quote by: marcmez

Quote by: johnny

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?


 
Profile Email
Quote
marcmez
 Wednesday, September 20 2006 @ 08:38 PM PDT  
Forum Active Member
Active Member

Status: offline

Registered: 09/19/06
Posts: 30


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 ??


 
Profile Email Website
Quote
johnny
 Wednesday, September 20 2006 @ 08:42 PM PDT  
Forum New
New

Status: offline

Registered: 09/20/06
Posts: 8

Quote by: marcmez


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.


 
Profile Email
Quote
Content generated in: 0.67 seconds
New Topic Post Reply



 All times are PST. The time is now 09:34 AM.

Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 

Copyright © 2010, Commission Junction, Inc.  All rights reserved.
Home | Getting Started | Resources | Developer Applications | Forum
Commission Junction