.NET Web Services are a Snap

P

Paul J. Lay

I have had little difficulty writing .NET Web Services and
Web Service clients using Visual Studio .NET. However I
am running into problems trying to interface a .NET C# Web
Service Client to an IBM WebSphere Web Service. I
am starting with a simple Hello World WebSphere service
that returns a string "Hello World". I am able to drag
the WSDL reference to my C# project but I can't compile it
successfully. Has anyone done this? I have attached
both the .NET and WebSphere WSDL files for inspection. On
the surface it appears that the WebSphere file is
incomplete but I am told it works on the
WebSphere service tester. Any insight on this would be
greatly appreciated.

Thanks for your help.

Best Regards,

Paul J. Lay

===========================================================
=====
..NET Hello World Web Service WSDL File

<?xml version="1.0" encoding="utf-8"?>
<definitions
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://tempuri.org/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://tempuri.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/">
<s:element name="HelloWorld">
<s:complexType />
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="HelloWorldResult"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="string" nillable="true"
type="s:string" />
</s:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters"
element="s0:HelloWorldResponse" />
</message>
<message name="HelloWorldHttpGetIn" />
<message name="HelloWorldHttpGetOut">
<part name="Body" element="s0:string" />
</message>
<message name="HelloWorldHttpPostIn" />
<message name="HelloWorldHttpPostOut">
<part name="Body" element="s0:string" />
</message>
<portType name="Service1Soap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
</portType>
<portType name="Service1HttpGet">
<operation name="HelloWorld">
<input message="s0:HelloWorldHttpGetIn" />
<output message="s0:HelloWorldHttpGetOut" />
</operation>
</portType>
<portType name="Service1HttpPost">
<operation name="HelloWorld">
<input message="s0:HelloWorldHttpPostIn" />
<output message="s0:HelloWorldHttpPostOut" />
</operation>
</portType>
<binding name="Service1Soap" type="s0:Service1Soap">
<soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="HelloWorld">
<soap:eek:peration
soapAction="http://tempuri.org/HelloWorld"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<binding name="Service1HttpGet"
type="s0:Service1HttpGet">
<http:binding verb="GET" />
<operation name="HelloWorld">
<http:eek:peration location="/HelloWorld" />
<input>
<http:urlEncoded />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
<binding name="Service1HttpPost"
type="s0:Service1HttpPost">
<http:binding verb="POST" />
<operation name="HelloWorld">
<http:eek:peration location="/HelloWorld" />
<input>
<mime:content type="application/x-www-form-
urlencoded" />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
<service name="Service1">
<port name="Service1Soap" binding="s0:Service1Soap">
<soap:address location="http://localhost/WS Hello
World/Service1.asmx"
/>
</port>
<port name="Service1HttpGet"
binding="s0:Service1HttpGet">
<http:address location="http://localhost/WS Hello
World/Service1.asmx"
/>
</port>
<port name="Service1HttpPost"
binding="s0:Service1HttpPost">
<http:address location="http://localhost/WS Hello
World/Service1.asmx"
/>
</port>
</service>
</definitions>

===========================================================
========
IBM WebSphere Hello World Web Service WSDL File

<?xml version="1.0" encoding="utf-8"?>
<definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://ArunHello.com.wsdl/ArunHelloManager/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://ArunHello.com.wsdl/ArunHelloManager
/"
name="ArunHelloManager"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types />
<message name="getHelloResponseRequest" />
<message name="getHelloResponseResponse">
<part name="result" type="s:string" />
</message>
<message name="createNewHelloOrderRequest">
<part name="hellostring" type="s:string" />
</message>
<message name="createNewHelloOrderResponse">
<part name="result" type="s:int" />
</message>
<portType name="ArunHelloManager">
<operation name="getHelloResponse">
<input name="getHelloResponseRequest"
message="tns:getHelloResponseRequest" />
<output name="getHelloResponseResponse"
message="tns:getHelloResponseResponse" />
</operation>
<operation name="createNewHelloOrder"
parameterOrder="hellostring">
<input name="createNewHelloOrderRequest"
message="tns:createNewHelloOrderRequest" />
<output name="createNewHelloOrderResponse"
message="tns:createNewHelloOrderResponse" />
</operation>
</portType>
</definitions>
 
D

Dino Chiesa [MSFT]

That WSDL file from WebSphere does not include all you need.

By default WebSphere produces WSDL in 3 distinct files:
one for the messages (the "service". I think they call it)
one for the ports.
one to link them together (the binding)

I think what you need to do is:
1. modify the Websphere-generated WSDL to manually concatenate everything
together
2 .compile the proxy from the massaged WSDL file.

-or-
1. compile a proxy class for EACH separate wsdl.


I think there are articles on this if you google for them.
eg
http://www7b.software.ibm.com/wsdd/techjournal/0204_wosnick/wosnick.html#step5

(But in contrast to this article, I would combine the service and binding
into a single DLL)

-Dino
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top