Click here to Skip to main content
15,861,168 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex10-May-19 10:31
samflex10-May-19 10:31 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx12-May-19 13:15
professionaljkirkerx12-May-19 13:15 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex16-May-19 14:39
samflex16-May-19 14:39 
Questionodata Pin
Member 140736591-May-19 2:33
Member 140736591-May-19 2:33 
AnswerRe: odata Pin
jkirkerx3-May-19 9:01
professionaljkirkerx3-May-19 9:01 
QuestionSOAP and using a Class containing two sub classes with same name problem Pin
Martin Stevens26-Apr-19 17:18
Martin Stevens26-Apr-19 17:18 
AnswerRe: SOAP and using a Class containing two sub classes with same name problem Pin
jkirkerx3-May-19 8:38
professionaljkirkerx3-May-19 8:38 
GeneralRe: SOAP and using a Class containing two sub classes with same name problem Pin
Martin Stevens10-May-19 20:03
Martin Stevens10-May-19 20:03 
Hi Jkirkerx

Thanks for your posting. I tried it the code compiles fine but the same error I described earlier arises from the asmx at runtime

Error
Types 'Library.DataModel.HardwareOrder.ResponseSet' and 'Library.DataModel.ProduceOrder.ResponseSet' both use the XML type name, 'ResponseSet', from namespace 'http://MyTest.com/'. Use XML attributes to specify a unique XML name and/or namespace for the type.


When serializing to xml or json the class works fine but in SOAP things start to get a little ugly.

I found a solution that makes it work by adding the following XmlElement tags to the routines.

VB
<WebMethod()>
    Public Function SubmitHardwareOrder(<XmlElement("Parameters", Namespace:="http://MyTest.com/HardwareOrder.Parameters")> Parameters As DataModel.HardwareOrder.Parameters) As XmlElement("ResponseSet", Namespace:="http://MyTest.com/HardwareOrder.ResponseSet")> DataModel.HardwareOrder.ResponseSet
	'other code logic here
	End Function
	
	<WebMethod()>
    Public Function SubmitProduceOrder(<XmlElement("Parameters", Namespace:="http://MyTest.com/ProduceOrder.Parameters")> Parameters As DataModel.ProduceOrder.Parameters) As XmlElement("ResponseSet", Namespace:="http://MyTest.com/ProduceOrder.ResponseSet")> DataModel.ProduceOrder.ResponseSet
	'other code logic here
	End Function


I note that yes the above makes it work but its not beautiful because when you generate your web reference in visual studio the generated class does not have levels eg not not do this "DataModel.ProduceOrder.ResponseSet" instead its just "ResponseSet" and so next time it sees another class called "ResponseSet" it renames it to "ResponseSet1" and next time "ResponseSet2" and so on. So if you are working of a large complicated namespace/class with many levels the web references created wont be overly intuitive if naming is not unique.

Clearly SOAP (Simple Object Access Protocol) is just that simple and this endeavor hits it's limitations bang on.

The foreseeable options are
-consume the webservice as per my above example with the inconvenience of none intuitive naming
-modify the class or create a separate duplicated class just for SOAP webservice
-use SOAP differently with passing/returning literals/datasets not strictly working of object model
-modify or build the wsdl class manually (this is the biggest time waster! I stay well away from wsdls that dont work as is especially if not generated by visual studio)
-just use xml or json and stream the data back via a handler
-use something else WCF?
GeneralRe: SOAP and using a Class containing two sub classes with same name problem Pin
jkirkerx12-May-19 13:03
professionaljkirkerx12-May-19 13:03 
Questionprint sql data from vb Pin
Member 1433060825-Apr-19 1:17
Member 1433060825-Apr-19 1:17 
AnswerRe: print sql data from vb Pin
Afzaal Ahmad Zeeshan25-Apr-19 1:36
professionalAfzaal Ahmad Zeeshan25-Apr-19 1:36 
QuestionSharing API's between multiple sites in IIS 8.5 Pin
Fred283424-Apr-19 21:39
Fred283424-Apr-19 21:39 
AnswerRe: Sharing API's between multiple sites in IIS 8.5 Pin
Richard Deeming25-Apr-19 1:17
mveRichard Deeming25-Apr-19 1:17 
GeneralRe: Sharing API's between multiple sites in IIS 8.5 Pin
Fred283425-Apr-19 1:47
Fred283425-Apr-19 1:47 
QuestionSo I finally got my Angular wrapped in .Net Core 2.2 app working in a Docker Container on a production server. Pin
jkirkerx16-Apr-19 11:14
professionaljkirkerx16-Apr-19 11:14 
SuggestionRe: So I finally got my Angular wrapped in .Net Core 2.2 app working in a Docker Container on a production server. Pin
Richard MacCutchan20-Apr-19 22:16
mveRichard MacCutchan20-Apr-19 22:16 
GeneralRe: So I finally got my Angular wrapped in .Net Core 2.2 app working in a Docker Container on a production server. Pin
jkirkerx21-Apr-19 8:17
professionaljkirkerx21-Apr-19 8:17 
Questionwithout using session and querty string value pass in another form Pin
UDTWS14-Apr-19 23:39
UDTWS14-Apr-19 23:39 
AnswerRe: without using session and querty string value pass in another form Pin
User 418025415-Apr-19 7:44
User 418025415-Apr-19 7:44 
QuestionExpiry date and Update Expiry Date Pin
Member 1370260513-Apr-19 1:49
Member 1370260513-Apr-19 1:49 
AnswerRe: Expiry date and Update Expiry Date Pin
User 418025415-Apr-19 7:55
User 418025415-Apr-19 7:55 
SuggestionRe: Expiry date and Update Expiry Date Pin
Richard Deeming15-Apr-19 8:25
mveRichard Deeming15-Apr-19 8:25 
AnswerRe: Expiry date and Update Expiry Date Pin
jkirkerx16-Apr-19 9:57
professionaljkirkerx16-Apr-19 9:57 
QuestionIn 3 tier architecture , filling textboxes with values from database table Pin
Member 1418527512-Apr-19 19:17
Member 1418527512-Apr-19 19:17 
AnswerRe: In 3 tier architecture , filling textboxes with values from database table Pin
User 418025415-Apr-19 7:49
User 418025415-Apr-19 7:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.