New Posts New Posts RSS Feed: RESOLVED - Webservice Span not return any data
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

RESOLVED - Webservice Span not return any data

 Post Reply Post Reply
Author
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Topic: RESOLVED - Webservice Span not return any data
    Posted: 02-Apr-2009 at 3:15pm
I am trying to run a query with a webservice
 
I add the span:

QuerySpan mOrgOrgGroupSpan = new QuerySpan();

mOrgOrgGroupSpan.Relations = new string[] { "Organization_OrganizationGroup"};

aQuery.Spans = new QuerySpan[] {mOrgOrgGroupSpan};

The initial object is returned but none of the associated information is returned it is null.
Am I missing something?
 
 


Edited by orcities - 03-Apr-2009 at 10:16am
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 02-Apr-2009 at 8:11pm
Two other things to check, both in Object Mapper:
  • the "web visible" setting for the related class needs to be marked as either "As web method" or "As span object"
  • the "web visible" setting for the specific relation property must be checked
 There's a readme doc with the "Web Service Publishing" learning unit which may help explain this.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 7:09am
The stuctures is as such
 
Organization -> OrganizationGroup (ParentOf) -> Organization
 
I have Organization "As web method"
I have OrganizationGroup "As span object"
 
Organization -> OrganizationGroup is "Web Visible" Relation Name Organization_OrganizationGroup
OrganizationGroup -> Organization is "Web Visible" Relation Name Organization_OrganizationGroup_1
 
The property ParentOf is available but the result is null.
 
 

Query aQuery = new Query();

QueryClause aClause = new QueryClause();

aClause.ColumnName = "Name";

aClause.ColumnValue = "Oregon Cities";

aClause.Operator = QueryOp.EQ;

 

QuerySpan mOrgOrgGroupSpan = new QuerySpan();

mOrgOrgGroupSpan.Relations = new string[] { "Organization_OrganizationGroup"};

 

aQuery.Spans = new QuerySpan[] {mOrgOrgGroupSpan};

 

aQuery.Expressions = new QueryExpression[] { aClause };

 

Organization[] mOrgs = mWebService.GetOrganizations(aQuery, String.Empty);

Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 7:55am
I also have a [WebServiceVisable] method that should return an EntityList<> but is returning a string that says "Collection". Whats up with that?
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 8:43am
And because of this issue I am trying to do a work around by running multiple queries. Hopefully this does not become necessary.
 
In doing so I ran into an issue with using the QueryOp.In type of query. I have tried to use an string, object[], string[], Int64[], arraylist and list but they all return an error. String returns it has to be a collection and any collection returns:
The type xxx may not be used in this context.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 9:37am
1.  If you have a relational property called Organization.ParentOf then that property needs to be marked WebVisible too.
 
2. An EntityList<T> can't be returned from a web method, since the service should be consumable by any application.  The generated web methods by default return either an array or a Dataset, and non-scalar relational properties will return an array.
 
3.  I'm not sure what the resulting query looks like, but that may be a bug.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 9:43am
What about the span issue?
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 9:51am

I will make the return type = Organization[]. (This is still just  a work around I need the span to work.)

What I am trying to return with my original span is I want to get an Organization.OrganizationGroup.Organization.
 
Organization is attached to OrganizationGroup where it defines Parent and Child.
I want to get all Children for Organization X. Meaning I have to Span Organzation to OrganizationGroup to Organization.
 
Span is not returning any values for one leve let alone 2.
 
The Relation Name I am setting to span is the Name provided in the Object Mapper Relation Name for that entity.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 10:06am
changing that property to return to return an Array still returns a string.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 10:13am
ParentOf is the Organization_OrganzationGroup Relation Name
 
When doing the span do I do the Property Name or the Relation Name?
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2009 at 10:15am
Resolved..
 
Need Property Name not relation Name.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down