Home All Groups Group Topic Archive Search About

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

Author
23 Nov 2007 6:59 PM
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

Author
24 Nov 2007 8:32 AM
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


Show quoteHide quote
"Bert Leu" <bol***@swissonline.ch> schreef in bericht
news:be33c$474722d3$54480741$9085@news.hispeed.ch...
> 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
>
>
Author
24 Nov 2007 1:24 PM
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 ?




Show quoteHide quote
"Michel Posseth [MCP]" <M***@posseth.com> schrieb im Newsbeitrag
news:OooHyRnLIHA.5684@TK2MSFTNGP04.phx.gbl...
>> 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
>
>
> "Bert Leu" <bol***@swissonline.ch> schreef in bericht
> news:be33c$474722d3$54480741$9085@news.hispeed.ch...
>> 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
>>
>>
>
>
Author
24 Nov 2007 2:35 PM
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:operation 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 :
m.poss***@nohausystems.com</wsdl:documentation>
  <wsdl:input message="tns:GetDataSoapIn" />
  <wsdl:output message="tns:GetDataSoapOut" />
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="NHSDataSoap" type="tns:NHSDataSoap">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="GetData">
  <soap:operation
soapAction="http://www.nohausystems.com/NHSService/NHSData/GetData"
style="document" />
- <wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
- <wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:binding name="NHSDataSoap12" type="tns:NHSDataSoap">
  <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="GetData">
  <soap12:operation
soapAction="http://www.nohausystems.com/NHSService/NHSData/GetData"
style="document" />
- <wsdl:input>
  <soap12:body use="literal" />
  </wsdl:input>
- <wsdl:output>
  <soap12:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
  </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 :
m.poss***@nohausystems.com")> _
     Public Function GetData(ByRef strXML As String) As Boolean
      '' code omitted

     End Function

End Class

</EXAMPLE>



HTH

Michel

Show quoteHide quote
"Bert Leu" <bol***@swissonline.ch> schreef in bericht
news:8e20e$474825de$54480741$7481@news.hispeed.ch...
> !!    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 ?
>
>
>
>
> "Michel Posseth [MCP]" <M***@posseth.com> schrieb im Newsbeitrag
> news:OooHyRnLIHA.5684@TK2MSFTNGP04.phx.gbl...
>>> 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
>>
>>
>> "Bert Leu" <bol***@swissonline.ch> schreef in bericht
>> news:be33c$474722d3$54480741$9085@news.hispeed.ch...
>>> 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
>>>
>>>
>>
>>
>
>