|
Sponsored Links
Resources
.NET Research Library
Get .NET related white papers, case studies and webcasts
|
XML & Web services
XML & Web services
XML & Web services
|
Messages: 17
Messages: 17
Messages: 17
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
WSDL Code Generation
I am running SOAP based web services on an Unix platform, using Apache/Axis. (See also Linux/SOAP forum) It's wsdl2java and wsdl2c[++] work fine, so far.
However, there is a bug in Microsoft .NET's wsdl.exe code generator; it cannot generate proper C# code for multidimensional arrays, or arrays of complex types (structs). I've not yet tried PocketSOAP, which generates code for VB and C++, but not C#. Does anyone know of a WSDL to C# generator, other than Microsoft's wsdl.exe? Altova XML Spy generates C# code from DTD and XML/Schema, but not from WSDL.
|
|
Message #148206
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
WSDL URN
I'm not sure why you want the URL for my WSDLs. They are inside a firewall, under test, and not publicly available (yet). However, there are WSDLs available from tempuri.org, as well as the weather service. You can likely find more through UDDIs, such as uddi.microsoft.com.
The point is, I will be adding and changing my WSDLs, so I want to make such migrations smoother for users, via code generation. I am not the first to face the Microsoft nested sequences bug.
I am thinking of mitigating this, by seeing if Apache's wsdl2c will compile under Microsoft's .NET framework. Maybe PocketSOAP, which already supports .NET is an easier solution.
|
|
Message #148244
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Huh?
Strange - I thought you are seeking help, I offered you help. If I do not have the WSDL, I cannot say you what is wrong (regardless who to blame...). We wrote our own code generation tool for XSD and WSDL, so maybe we can solve your problem. But staying at an abstract level won't work.
PocketSoap is COM - yes you can use it via COM Interop in .NET... but that is a totally different story. Simon (Fell) is a great guy, bit we should try to solve the problems you face with the .NET tools, shouldn't we?
|
|
Message #148275
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
WSDL Code Generation
I understand your frustration. We use wsdl.exe heavily in our projects. The problem that we currently have is that we have found a bug in it. And we have right now an open case on it with Microsoft. (I think that our problem is of a different kind that yours.)
I'm also very interested if any other programs exist that could generate code from wsdl.
/dag http://buzzfrog.blogs.com
|
|
Message #148474
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Example WSDL
OK, here is an exerpted essence of what is going on. Again, Apache Axis's wsdl2j is happy, where wsdl.exe is not. Our wsdl is not (yet) ready for public consumption, especially until we have the bugs worked out.
OK, now that you are a bit more explicit, I understand. You can see below, that we have a complex type that contains a sequence. This complex type itself is stored in a sequence. In short, nested sequences.
Can you redistribute your wsdl tool? We'd need to provide this to our customers, and regenerate code as we add or change WSDL interfaces. ____________________
<wsdl:types> <schema targetNamespace="http://beans.pass.wsv.reg.com" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="Account"> <sequence> <element name="Name" nillable="true" type="xsd:string"/> <element name="id" type="xsd:int"/> </sequence> </complexType> <complexType name="AccountArray"> <sequence> <element maxOccurs="unbounded" name="allAccounts" nillable="true" type="tns1:Account"/> <element name="wSError" nillable="true" type="xsd:string"/> </sequence> </complexType> </schema> </wsdl:types>
|
|
Message #151754
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
follow up
Thanks for introducing me to WSCF. It seems simpler than Microsoft's wsdl.exe et. al. Unfortunately, WSCF seems to generate similar, if not simpler code than does Microsoft. This did not seem to help for my more complex WSDL problem. I ended up recompiling Apache's Axis/C from scratch under the .NET framework. This worked smoothly, after some time wasting false starts. I had problems calling the resulting generated .NET Managed C++ DLLs from C#, however. The code generation in .NET was smooth, so switching from C# to C++ is still possible.
After all that work, my customer ended up switching to Axis/Java :(
|
|
Message #156347
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Did you resolve this?
Bruce Ingalls, Did you resolve this issue. this stupid micro soft wsdl.exe is a pain in the neck. I love Microsoft except in this sinario. If you resolve this problem please let me know the answer ASAP (Please). Previously, I used to change the xsd's to solve the problem (which is the stupid solution provided by microsoft). Now i am at a stage that i cannot change the Xsd's. So please help me in this. My address is minguva@hotmail.com (732 692 3331) Thank You Murali
|
|
Message #156476
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Did you resolve this?
I gave up on using Microsoft wsdl.exe, and went with Java, instead. Here are alternatives I can recommend:
1) Try Christian Weyer / Thinktecture's wsdl code generator. It likely won't work any better than Microsoft's wsdl.exe for you, but it is fast and easy, meaning that you won't waste much time trying it.
2) Try simplifying your WSDL. Get rid of arrays and complex structures, and replace them with poorly coded, flattened primitive objects (xsd:int, xsd:string, etc.)
3) Try Apache's wsdl2c (normally generates C++, not C). Forget about wsdl2java under .NET, as Sun does not provide source code to many required .jar files. You must build your projects from scratch - don't waste time with the project files provided by Apache. You've now changed this to a problem of migrating unmanaged code to managed, and figuring out how to invoke C++ from C# code.
4) Change your choice of language to Java or C++, and move away from .NET. Or, find a way to comminicate between the two, such as shared memory, system messages, etc.
5) .NET remoting is based atop SOAP, and I understand that Java's WSDP Web Services Development Pack is able to cross communicate, somehow, but I have not tried this personally, so I don't know how well this works. I hope this helps; frankly, the picture is bleak.
|
|
Message #156668
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Thank you for the reply
Hi Bruce, Thank you very much for the help... Is there any way that i can get some more in this. I have to implement this. Is there any way that i can call you to discuss further more if you dont mind. Thanks again
|
|
Message #161015
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Not true
However, there is a bug in Microsoft .NET's wsdl.exe code generator; it cannot generate proper C# code for multidimensional arrays, or arrays of complex types (structs). This is not true.
There are examples of AXIS + .NET integration using complex types and arrays of same, and complex types that contain arrays of instances of the same complex types, and so on, and so forth.
Jagged arrays may require some special handling (introduction of the nestingLevel param on the arrayItem attribute) but they also work.
For one example, see http://dinoch.dyndns.org:7070/axis1.2/AboutCtService.jsp which illustrates interop between AXIS/Java 1.2RC3 and .NET v1.1, using arrays of complex types, which contain member arrays of complex types, and so on.
Nothing in this thread has explained just what the problem is. The only clear statement is "wsdl.exe cannot generate proper code". The working examples above show this to be not true.
-Dino Microsoft
|
|
Message #161114
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
An update
Couple of things. First, the URL is not hyperlinked properly in the above message. I think the auto-hyperlink logic in TSS.NET doesn't like :7070. Try this link instead (redirected through tinyurl.com) :
http://dinoch.dyndns.org:7070/axis1.2/AboutCtService.jsp
Also, I updated that example to show "jagged arrays".
Jagged arrays are a special case, and if you want interop between AXIS and .NET, it requires a particular style of XSD type definition in the WSDL. For a 2D array, follow this pattern:
<complexType name="MyComplexType"> <sequence> ... </sequence> </complexType>
<complexType name="ArrayCt"> <sequence> <element maxOccurs="unbounded" name="item" nillable="true" type="tns1:MyComplexType" /> </sequence> </complexType>
<complexType name="Array2DCt"> <sequence> <element maxOccurs="unbounded" name="item" nillable="true" type="tns1:ArrayCt" /> </sequence> </complexType> Of course you could substitute an xsd primitive type (int, float, string, whatever) for the named complextype in the above.
When the AXIS WSDL2Java tool consumes this schema definition, it produces several "container types", named after the xsd complexTypes. There is a java class named ArrayCt() which wraps a single member, which is an array of MyComplexType. There is also a java class Array2DCt, which wraps a single member, an array of ArrayCt. They are beans, and use the bean serializer, not the AXIS array serializer.
When .NET parses the WSDL, it does not generate container types for these complexTypes that contain only an array. In .NET, therefore, the generated type is simply a jagged array.
As a result of this difference, there is a different programming model on either end of the wire. In the AXIS/Java server, one must do something like this :
public proxyPackage.Array2DCt getJaggedArray(...) { ArrayCt[] a= new ArrayCt[n]; for(int i=0; i < n; i++) a[i]= new ArrayCt( new MyComplexType[m] ) ; Array2DCt a2d= new Array2DCt(a); return a2d; } ...whereas in the .NET client, the programming model is a simple jagged array:
MyComplexType[][] jagged= stub.getJaggedArray();
All of this is with AXIS 1.2RC3 and .NET v1.1.
|
|
Message #205005
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Tested with .NET WebService Studio and didn't work.
Hi there,
I'm having similar problems with the wdsl.exe generated code. The generated data structures look ok, but they don't get filled in case of a unbounded sequence of complexType.
I just tested the http://dinoch.dyndns.org:7070/axis1.2/services/ComplexTypeService?wsdl site. Only method getComplexType worked, the others that returned array types gave problems though.
Anybody got a work around for the unbounded sequence/wdsl.exe problems?
Kind regards,
Wout
|
|
Message #205024
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Unbounded sequences working, use document style/literal encoding
Hi,
I got use unbounded sequences working in a .NET 2.0 client (web service returns an unbounded sequence). The web service has to use document style and literal encoding though. When using rpc style and encoded encoding the wdsl.exe generates different code and the result array ends up empty.
Wout
|
|
 |
Hot threads
Hot threads
Hot threads
|
More hot threads
More hot threads
More hot threads
|
 |
Speaking at EclipseCon 2006, Java developer and independent consultant Madhu Siddalingaiah compared Microsoft's Visual Studio IDE to the open source development environment of Eclipse.
(32 comments,
last posted
December 29, 2007)
In this tech talk, Microsoft's Peter Provost talks about the design of the Composite UI Application Block and how the p&p team has led Microsoft in the adoption of Agile methodologies.
(0 comments,
last posted
April 17, 2006)
Chapter 4 of Framework Design Guidelines, titled "Type Design Guidelines," presents patterns that describe when and how to design classes, constructs and interfaces. In this chapter, Abrams and Cwalina divide types into four groups and discuss the do's and don'ts of type design.
(2 comments,
last posted
July 07, 2006)
Paul Ferrill caught up with prime open-source .NET applications driver Miguel De Icaza at Novell's BrainShare conference last week. They discussed the status of Windows Forms for Mono (it's coming along) and VB.NET for Mono (it looks like it's out).
(5 comments,
last posted
March 30, 2006)
In this tech talk, Microsoft Visual Studio architect Jack Greenfield discusses the company's approach to Domain-Specific Languages, or DSLs, and the part they play in software factories.
(0 comments,
last posted
March 15, 2006)
More hot threads »
|
|