How to create a proxy class without a WSDL document?

I'm new to web services, so please forgive my ignorance. I need to
create an interface with a third party Web Service. From what I
understand about Web Services, I need to create a proxy class that
will let me call the Web Methods that are expose by the third party's
Web Service. However, the third party doesn't provide a WSDL document.
What they do provide in their documentation is the names of the
available "transactions" (which I assume is their word for Web
Methods), and also DTD's that are used by the transactions.
If I'm correct in that I need to create a proxy class, how would I
be able to do this without a WSDL document? Should I be able to do
this with just the method names, and the DTDs?
Any help would be much appreciated.

Advertisements

Hey Attila,
What's the third party?
What is the web services stack they use?
Can you show us the documentation?

All current, compliant web services stacks do WSDL. It is one of the
primary interop standards for web services.

Could it be that this third party does not actually expose web services at
all, but instead exposes a REST-ful XML interface ? In which case you
wouldn't need to use a WSDL and a generated proxy, but you'd need to send
XML docs of a well known format (Defined by the DTDs) to corresponding HTTP
endpoints. ? Or could it be XML-RPC ? In which case you'd need an XML-RPC
stack for .NET (there is at least one 3rd party implementation).

If not, then you could try to reverse-engineer the service and independently
construct your own WSDL, which would correspond to the wsdl-less service you
have, then generate a proxy from it. Start by converting the DTDs to XML
schema. Then, to zero in on the WSDL you may need to iterate over WSDL
designs and the messages each version generates. You can use wsdl /server
to generate a server stub corresponding to a given wsdl - this will give you
something to invoke against while iterating. Also check out proxytrace,
which will let you examine your xml messages on the wire.

-Dino

"Attila" <> wrote in message
news:...
> Hello,
>
> I'm new to web services, so please forgive my ignorance. I need to
> create an interface with a third party Web Service. From what I
> understand about Web Services, I need to create a proxy class that
> will let me call the Web Methods that are expose by the third party's
> Web Service. However, the third party doesn't provide a WSDL document.
> What they do provide in their documentation is the names of the
> available "transactions" (which I assume is their word for Web
> Methods), and also DTD's that are used by the transactions.
> If I'm correct in that I need to create a proxy class, how would I
> be able to do this without a WSDL document? Should I be able to do
> this with just the method names, and the DTDs?
> Any help would be much appreciated.
>
> Thanks,
> Attila

Advertisements

Thank you for your response. I recently contacted the third parties
technical support, and their response was "our interface is not a .NET
web service." Their documentation states "The XML Gateway supports
HTTPS post transactions using the XML -based file types." Originally,
I thought that sending XML over HTTP was considered a Web Service,
although this appears to not be the case.
Given that, I'm not sure how to proceed. Any there any MSDN
articles that you think would be helpful?

Thanks,
Attila

"Dino Chiesa [Microsoft]" <> wrote in message news:<>...
> Hey Attila,
> What's the third party?
> What is the web services stack they use?
> Can you show us the documentation?
>
> All current, compliant web services stacks do WSDL. It is one of the
> primary interop standards for web services.
>
> Could it be that this third party does not actually expose web services at
> all, but instead exposes a REST-ful XML interface ? In which case you
> wouldn't need to use a WSDL and a generated proxy, but you'd need to send
> XML docs of a well known format (Defined by the DTDs) to corresponding HTTP
> endpoints. ? Or could it be XML-RPC ? In which case you'd need an XML-RPC
> stack for .NET (there is at least one 3rd party implementation).
>
> If not, then you could try to reverse-engineer the service and independently
> construct your own WSDL, which would correspond to the wsdl-less service you
> have, then generate a proxy from it. Start by converting the DTDs to XML
> schema. Then, to zero in on the WSDL you may need to iterate over WSDL
> designs and the messages each version generates. You can use wsdl /server
> to generate a server stub corresponding to a given wsdl - this will give you
> something to invoke against while iterating. Also check out proxytrace,
> which will let you examine your xml messages on the wire.
>
> -Dino
>
>
>
> "Attila" <> wrote in message
> news:...
> > Hello,
> >
> > I'm new to web services, so please forgive my ignorance. I need to
> > create an interface with a third party Web Service. From what I
> > understand about Web Services, I need to create a proxy class that
> > will let me call the Web Methods that are expose by the third party's
> > Web Service. However, the third party doesn't provide a WSDL document.
> > What they do provide in their documentation is the names of the
> > available "transactions" (which I assume is their word for Web
> > Methods), and also DTD's that are used by the transactions.
> > If I'm correct in that I need to create a proxy class, how would I
> > be able to do this without a WSDL document? Should I be able to do
> > this with just the method names, and the DTDs?
> > Any help would be much appreciated.
> >
> > Thanks,
> > Attila

and call it like so:
String result= PostURI("https://server/whatever",
"arg1=7&arg2=42&arg3=Dino");

This approach (XML over HTTP) doesn't give you webservices goodness, like a
WSDL file that defines the interface, a tool that translates the interface
into platform-specific type definitions and request proxy classes (eg,
wsdl.exe). In other words, it's up to your app to make sure you are
sending the right request and parsing the response properly. There are
some pieces of .NET that may help, for example xsd.exe and the xml
serialization classes.

If you know the schema of the response you can generate a type corresponding
to that schema like so:
xsd.exe /c schema.xsd

Then you can instantiate that generated type from the returned string, by
using XML serialization and a StringReader. Like so:

"Attila" <> wrote in message
news:...
> Thank you for your response. I recently contacted the third parties
> technical support, and their response was "our interface is not a .NET
> web service." Their documentation states "The XML Gateway supports
> HTTPS post transactions using the XML -based file types." Originally,
> I thought that sending XML over HTTP was considered a Web Service,
> although this appears to not be the case.
> Given that, I'm not sure how to proceed. Any there any MSDN
> articles that you think would be helpful?
>
> Thanks,
> Attila
>

I must be missing something. The request that I send to the third
party is also supposed to be XML. I'm not sure that I can send the
parameters as you suggest.

I did create a class file, based on the request DTD, using the xsd.exe
tool. However, while I was able to create an object based on the
class, none of the properties (XML elements) were available to me.
When I view the class in the object browser it shows the properties,
but I get a compilation error when I try to access the properties in
my code. I'm not sure what the problem is.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!