473,322 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

WSDL.exe not round-trip?

My client has specified a WSDL file as contract for a web service that I have to implement. (It really must be that WSDL file, because it has been communicated already to other partners and so on, and they will implement their own web services and clients based on that WSDL too. It’s a WSDL file of 63 KB.)

With wsdl.exe I have created the proxy classes for the server side. So I could implement the web service.
BUT: if making use of wsdl.exe to create the client side proxy classes based on the original WSDL file, then that results in a client application that is not able to communicate with the web service!

INSTEAD: by adding “?wsdl” to the web service URL, I get another WSDL file. When making use of that second WSDL file to create the client side proxy classes, then that results in client applications which are perfectly able to communicate with the web service. Strangely, that second WSDL file has a size of 288 KB instead of the 63 KB of the original WSDL file.

So that should mean that the WSDL is not round-trip… (WSDL file -> wsdl.exe to create server side proxy classes -> web service -> adding “?wsdl” to web service URL -> results in another WSDL file as the original one (and worse: they are not compatible).)

Can anyone explain this? (For my project it is important, because the other parties will make use of the original WSDL file and so they won’t be able to communicate with my web service…)

I did tests with C# as well as with CLI. It is reproducible. I am making use of IIS 7.5 and .NET framework 3.5.
Jul 17 '11 #1

✓ answered by Koen Alban

After having modified slightly the code that was generated by my code wizard (a freely available template for CLI ASP.NET web services for Visual Studio 2008, but the standard C# web service template generates the same kind of code), I got something like that :

// MyWebService.cpp : main project file.
#include "stdafx.h"
#include "Global.asax.h"
#include "HeaderFileGeneratedByWsdlExe.h"

using namespace System;
using namespace System::Web;
using namespace System::Web::Services;

namespace MyWebService {

[WebService(Namespace = L"http://MyNamespace.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles::BasicProfile1_1)]
public ref class MyWebService : public System::Web::Services::WebService
{
public:

[WebMethod(Description = L"myMethod does something")]
System::Void myMethod(MyClass ^myInstance)
{
DoSth(myInstance);
}
};
}

"HeaderFileGeneratedByWsdlExe.h" is of course the header file that I generated with wsdl.exe (based on the specified WSDL file), specifying ‘serverInterface’ mode. (In that header file ‘MyClass’ is defined.)
At this point it is possible to build the web service correctly and run it. I could ‘discover’ the wsdl file of my web service, generate client side proxy classes for it and implement a client application that could communicate correctly with my web service. Unfortunately, when I made use of the original WSDL file to generate the client side proxy classes, the client application still could send a MyClass instance to the web service, but the web service was not able to serialize that MyClass instance.

The code must be changed as follows:

// MyWebService.cpp : main project file.
#include "stdafx.h"
#include "Global.asax.h"
#include "HeaderFileGeneratedByWsdlExe.h"

using namespace System;
using namespace System::Web;
using namespace System::Web::Services;

namespace MyWebService {

[WebService(Namespace = L"http://MyNamespace.org/")]
public ref class MyWebService : public InterfaceFromHeaderFile
{
public:

System::Void myMethod(MyClass ^myInstance)
{
DoSth(myInstance);
}
};
}

The modifications are:
- I removed the WebServiceBinding attribute.
- I deduced the class from the abstrµact server side proxy class in the generated header file instead of from ‘WebService’.
- I removed the WebMethod attribute.

After these modifications everything is working as expected.

1 2597
After having modified slightly the code that was generated by my code wizard (a freely available template for CLI ASP.NET web services for Visual Studio 2008, but the standard C# web service template generates the same kind of code), I got something like that :

// MyWebService.cpp : main project file.
#include "stdafx.h"
#include "Global.asax.h"
#include "HeaderFileGeneratedByWsdlExe.h"

using namespace System;
using namespace System::Web;
using namespace System::Web::Services;

namespace MyWebService {

[WebService(Namespace = L"http://MyNamespace.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles::BasicProfile1_1)]
public ref class MyWebService : public System::Web::Services::WebService
{
public:

[WebMethod(Description = L"myMethod does something")]
System::Void myMethod(MyClass ^myInstance)
{
DoSth(myInstance);
}
};
}

"HeaderFileGeneratedByWsdlExe.h" is of course the header file that I generated with wsdl.exe (based on the specified WSDL file), specifying ‘serverInterface’ mode. (In that header file ‘MyClass’ is defined.)
At this point it is possible to build the web service correctly and run it. I could ‘discover’ the wsdl file of my web service, generate client side proxy classes for it and implement a client application that could communicate correctly with my web service. Unfortunately, when I made use of the original WSDL file to generate the client side proxy classes, the client application still could send a MyClass instance to the web service, but the web service was not able to serialize that MyClass instance.

The code must be changed as follows:

// MyWebService.cpp : main project file.
#include "stdafx.h"
#include "Global.asax.h"
#include "HeaderFileGeneratedByWsdlExe.h"

using namespace System;
using namespace System::Web;
using namespace System::Web::Services;

namespace MyWebService {

[WebService(Namespace = L"http://MyNamespace.org/")]
public ref class MyWebService : public InterfaceFromHeaderFile
{
public:

System::Void myMethod(MyClass ^myInstance)
{
DoSth(myInstance);
}
};
}

The modifications are:
- I removed the WebServiceBinding attribute.
- I deduced the class from the abstrµact server side proxy class in the generated header file instead of from ‘WebService’.
- I removed the WebMethod attribute.

After these modifications everything is working as expected.
Jul 20 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Generic Usenet Account | last post by:
Does anyone have an opinion on how IDL and WSDL compare to each other? Are they equally powerful in their "expressive power"? Sometimes it appears to me that IDL is a little easier for humans to...
5
by: relaxedrob | last post by:
Hi All! I ran the following w3c example through my WSDL parser (SOA Editor from Cape Clear): http://www.w3.org/TR/wsdl#_rpcexample It told me that there were a bunch of erros about no...
0
by: Sonna Nach | last post by:
Hi All, I am writing a doc/lit web services, in which the elements under SOAPBody is unknown. That is, these two message are acceptable. 1. <SOAP-ENV:Body><Tag1>It is ok</Tag1></SOAP-ENV:Body>...
1
by: ffhansix | last post by:
Hi, I am having problems with generating a c# proxy class from a IBM websphere WSDL file, when running the wsdl.exe to create the c# proxy file command i recieve an error: Warning: one or...
0
by: Dave | last post by:
Hi, If anyone could help with this, I would greatly appreciate it! I've created my own WSDL file and referenced an XSD file too. I've generated a service side interface using wsdl /server, and...
0
by: saish | last post by:
Hello I am new to vb.net webservice. My requirement is to design a VB.net web service which will send and receive xml documents. The xml document send and received would be a very complex .xsd...
0
by: Elhanan | last post by:
hi.. i have a small Web Service which is consumed by dotnet application the webservice is located in 2 places. the first is my local tomcat, and the second is in websphere server. problems is...
6
by: Naveed Anwar | last post by:
how a tcp server running on given uri like "soap:tcp://localhost:8080/MyReceiver" will return wsdl. In normal web service case which runs on http returns wsdl by simply appending '?wsdl' in url,...
9
by: Cesar | last post by:
Hello there, A java programmer sent me a wsdl file, which I have to use to consume his web methods. When I run the wsld.exe tool to generate the class' code, I get the following message: ...
5
by: Nick K. | last post by:
I use wsdl.exe to generate client code to call a web service. The actual web service is generated with the BizTalk Web Services Publishing Wizard. I'm not sure this is particular to the BizTalk...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.