Creating a Web Service (Service, not Client) from WSDL

B

Bert Leu

Hi

I understand, that the "normal way" in creating Web Services is:

Creating Web Service --> WSDL --> Creating Client

Unfortunately, I have to create a Web Service (Service, not Clinet) from an
existing WSDL.

Can somebody tell me, what's the right way to do this?

Any hint is much appreciated.

Bert Leu
 
M

Michel Posseth [MCP]

Unfortunately, I have to create a Web Service (Service, not Clinet) from
an
existing WSDL.

So in other words you have to reverse engineer a already existing webservice

This task should be easy , as the WSDL describes the method signatures you
only have to rewrite the logic in the methods , if you would create a
webservice with empty methods in the same style as the wsdl describes you
should end up with a same wsdl signature
 
B

Bert Leu

!! if you would create a
!! webservice with empty methods in the same style as the wsdl describes
you

and that - exactly - is my problem: how do I create a webservice with empty
methode from an existing wsdl ?
 
M

Michel Posseth [MCP]

afaik there is not an automated task to do something like that

Declare the same public methods with identical method signatures and
optionally structures and that`s it


<EXAMPLE>
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://www.nohausystems.com/NHSService/NHSData"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://www.nohausystems.com/NHSService/NHSData"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified"
targetNamespace="http://www.nohausystems.com/NHSService/NHSData">
- <s:element name="GetData">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="strXML" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="GetDataResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="GetDataResult"
type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="strXML" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <wsdl:message name="GetDataSoapIn">
<wsdl:part name="parameters" element="tns:GetData" />
</wsdl:message>
- <wsdl:message name="GetDataSoapOut">
<wsdl:part name="parameters" element="tns:GetDataResponse" />
</wsdl:message>
- <wsdl:portType name="NHSDataSoap">
- <wsdl:blush:peration name="GetData">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">platform
independent interface wrapper to NHSBL.dll , Version 2.0 , - : Last mod to
this service binary 07-12-2005 , Made by : Michel Posseth [Microsoft
Certified Professional] , info :
(e-mail address removed)</wsdl:documentation>
<wsdl:input message="tns:GetDataSoapIn" />
<wsdl:blush:utput message="tns:GetDataSoapOut" />
</wsdl:blush:peration>
</wsdl:portType>
- <wsdl:binding name="NHSDataSoap" type="tns:NHSDataSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:blush:peration name="GetData">
<soap:blush:peration
soapAction="http://www.nohausystems.com/NHSService/NHSData/GetData"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:blush:utput>
<soap:body use="literal" />
</wsdl:blush:utput>
</wsdl:blush:peration>
</wsdl:binding>
- <wsdl:binding name="NHSDataSoap12" type="tns:NHSDataSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:blush:peration name="GetData">
<soap12:blush:peration
soapAction="http://www.nohausystems.com/NHSService/NHSData/GetData"
style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:blush:utput>
<soap12:body use="literal" />
</wsdl:blush:utput>
</wsdl:blush:peration>
</wsdl:binding>
- <wsdl:service name="NHSData">
- <wsdl:port name="NHSDataSoap" binding="tns:NHSDataSoap">
<soap:address location="http://192.168.1.13:8080/nhsdata.asmx" />
</wsdl:port>
- <wsdl:port name="NHSDataSoap12" binding="tns:NHSDataSoap12">
<soap12:address location="http://192.168.1.13:8080/nhsdata.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


what does the above WSDL tell us ?

it tells us that the binary name is NHSData

it tells us that the full namespace of the service is
http://www.nohausystems.com/NHSService/NHSData
( ofcourse you must modify these namespaces to your own )

it tells us this webservice contains of one method named GetData with a
byref parameter called strXML ( it comes in and goes out so it must be a
byref parameter )

The method itself returns a Boolean so it must be a function

reverse engineering this WSDL would result in ofcourse we still don`t know
what happens inside the GetData method


Public Class NHSData
Inherits System.Web.Services.WebService
''' <summary>
''' made by : Michel Posseth [MCP]
''' last rev : 07-12-2005 by MP (dd-mm-yyyy)
''' version : 2.0
''' </summary>
''' <param name="strXML"></param>
''' <returns>boolean as return type and byref param strxml as string
</returns>
''' <remarks>Upgraded 05-12-2005 to VS.Net 2005 </remarks>
<WebMethod(Description:="platform independent interface wrapper to
NHSBL.dll , Version 2.0 , - : Last mod to this service binary 07-12-2005 ,
Made by : Michel Posseth [Microsoft Certified Professional] , info :
(e-mail address removed)")> _
Public Function GetData(ByRef strXML As String) As Boolean
'' code omitted

End Function

End Class

</EXAMPLE>



HTH

Michel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top