Solved

Accessing an array through a WSDL

Posted on 2013-12-18
4
254 Views
Last Modified: 2013-12-18
Part of this is working.  I can get the MyID to show and FirstName, but do I return an ArrayOfPizzaSales value for FacName based on strMyID?

viviendo.ResidentService RS= new viviendo.ResidentService();
viviendo.CustomerResult RSA = new Viviendo.CustomerResult();
vividendo.PizzaSales PS = new viviendo.PizzaSales();

strMyID = tbMyID.Text;
try
{

RSA = RS.getCustomer(strMyID);

litMyID.Text = RSA.MyID;
litFirstName.Text = RSA.FirstName;

litFacType.Text = PS.FacName; //not working.
}

Thanks!

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="https://viviendo.mysite.net/Greek/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="https://viviendo.mysite.net/Greek/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:s="http://www.w3.org/2001/XMLSchema">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Provide Customer Lookup</wsdl:documentation>
<wsdl:types>
<s:schema targetNamespace="https://viviendo.mysite.net/Greek/" elementFormDefault="qualified">
<s:element name="getCustomer">
<s:complexType>
<s:sequence>
<s:element name="MySchoolid" type="s:string" maxOccurs="1" minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element><s:element name="getCustomerResponse">
<s:complexType>
<s:sequence><s:element name="getCustomerResult" type="tns:ABCDPatron" maxOccurs="1" minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element><s:complexType name="ABCDPatron">
<s:sequence>
<s:element name="MYSCHOOLID" type="s:string" maxOccurs="1" minOccurs="0"/>
<s:element name="FirstName" type="s:string" maxOccurs="1" minOccurs="0"/>
<s:element name="LastName" type="s:string" maxOccurs="1" minOccurs="0"/>
<s:element name="Contracts" type="tns:ArrayOfPizzaSales" maxOccurs="1" minOccurs="0"/>
<s:element name="Exception" type="s:string" maxOccurs="1" minOccurs="0"/>
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfPizzaSales">
<s:sequence>
<s:element name="PizzaSales" type="tns:PizzaSales" maxOccurs="unbounded" minOccurs="0" nillable="true"/>
</s:sequence>
</s:complexType>
<s:complexType name="PizzaSales">
<s:sequence>
<s:element name="Term" type="s:string" maxOccurs="1" minOccurs="0"/>
<s:element name="FacType" type="s:string" maxOccurs="1" minOccurs="0"/>
<s:element name="FacName" type="s:string" maxOccurs="1" minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="getCustomerSoapIn">
<wsdl:part name="parameters" element="tns:getCustomer"/>
</wsdl:message>
<wsdl:message name="getCustomerSoapOut">
<wsdl:part name="parameters" element="tns:getCustomerResponse"/></wsdl:message><wsdl:portType name="ResidentServiceSoap">
<wsdl:operation name="getCustomer"><wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Information Lookup</wsdl:documentation>
<wsdl:input message="tns:getCustomerSoapIn"/><wsdl:output message="tns:getCustomerSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ResidentServiceSoap" type="tns:ResidentServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getCustomer">
<soap:operation style="document" soapAction="https://viviendo.mysite.net/Greek/getCustomer"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output><soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ResidentServiceSoap12" type="tns:ResidentServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getCustomer">
<soap12:operation style="document" soapAction="https://viviendo.mysite.net/Greek/getCustomer"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ResidentService">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Provide Customer Lookup</wsdl:documentation>
<wsdl:port name="ResidentServiceSoap" binding="tns:ResidentServiceSoap"><soap:address location="https://viviendo.mysite.net/abcd/ws/residentservice.asmx"/>
</wsdl:port><wsdl:port name="ResidentServiceSoap12" binding="tns:ResidentServiceSoap12">
<soap12:address location="https://viviendo.mysite.net/abcd/ws/residentservice.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Open in new window

0
Comment
Question by:javierpdx
  • 2
  • 2
4 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
How did you generate the ResidentService, CustomerResult, and PizzaSales classes?
0
 

Author Comment

by:javierpdx
Comment Utility
I'm trying to access the web serviced share with me.  I didn't actually create this WSDL or classes in the WSDL.

When I debug, add a toggle point to RSA = RS.getCustomer(strMyID); in VS I can see the field and records being returned that I want when I mouse over and drill down.    So I thought I could just use litFacType.Text = PS.FacName but I am getting a NULL value.
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
Well, this line:

vividendo.PizzaSales PS = new viviendo.PizzaSales();

Open in new window


...just creates a new instance of a class within your program. It's not actually talking to the webservice. Talking to the web service occurs in this line:

RSA = RS.getCustomer(strMyID);

Open in new window


When you call the functions on the proxy object, you are actually making calls out to the webservice. Any data classes (e.g. PizzaSales) just hold data; they don't actually communicate with the webservice itself.

So the reason you are getting the null error is because the class doesn't actually have any data in it. You need to populate it by calling one of the service's functions.
0
 

Author Closing Comment

by:javierpdx
Comment Utility
Thanks for helping me think that one out.  I was able to call a service function and populate it.  I appreciate it!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now