WebService Test using IBM Websphere Studio or Eclipse

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

WebService Test using IBM Websphere Studio or Eclipse

Postby tstalzer » Wed Nov 29, 2006 4:34 am

Hi

We got a couple problems testing a WebService created in VA/ST 7.0.1.

The Services work fine in Smalltalk and may be tested using the VA Quicktester and a tool from the web (SOAP-UI).

However, our customer is using IBM WebSphere Studio developer and Eclipse 3.1.2 with the latest Web Services Explorer. If they use the WebServices Explorer to test our WebServices, both of them can't be used to test our WebServices.

Using IBM WebSphere Studio Developer, an error message is displayed saying "Incorrect binding" (The binding is correct and works using Quicktester and SOAP-UI on the same machine). In Eclipse, the input fields are generated, the call is issued, the service in Smalltalk performed, however, Eclipse does not show a result.

Any ideas?

BTW, the WSDL definition

<?xml version="1.0"?>
<!-- Generated by VisualAge Smalltalk Web Services on 26.11.2006 at 15:16:23 -->
<definitions name="MyMathService-impl" targetNamespace="http://www.MyMathService.com/MyMathService-impl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.MyMathService.com/MyMathService-impl"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:vastif="http://www.MyMathService.com/MyMathService-interface">
<import namespace="http://www.MyMathService.com/MyMathService-interface" location="MyMathService-interface.wsdl"/>
<service name="MyMathService">
<documentation>This is the MyMathService service.</documentation>
<port name="MyMathServicePort" binding="vastif:MyMathServiceBinding">
<soap:address location="http://vasthost:3802/SstWSServlet"/>
</port>
</service>
</definitions>

and the -interface definition

<?xml version="1.0"?>
<!-- Generated by VisualAge Smalltalk Web Services on 26.11.2006 at 15:16:23 -->
<definitions name="MyMathService-interface" targetNamespace="http://www.MyMathService.com/MyMathService-interface"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://www.MyMathService.com/MyMathService-interface"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mms="urn:MyMathService"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema targetNamespace="urn:MyMathService"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
</types>
<message name="calculations">
<part name="input1" type="xsd:decimal"/>
<part name="input2" type="xsd:decimal"/>
</message>
<message name="calculationsResponse">
<part name="input1" type="xsd:decimal"/>
<part name="input2" type="xsd:decimal"/>
<part name="product" type="xsd:decimal"/>
<part name="sum" type="xsd:decimal"/>
</message>
<portType name="MyMathServicePortType">
<operation name="calculations">
<input message="tns:calculations"/>
<output message="tns:calculationsResponse"/>
</operation>
</portType>
<binding name="MyMathServiceBinding" type="tns:MyMathServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="calculations">
<soap:operation soapAction="http://www.MyMathService.com/MyMathService-interface/calculations"/>
<input>
<soap:body use="literal" namespace="urn:MyMathService"/>
</input>
<output>
<soap:body use="literal" namespace="urn:MyMathService"/>
</output>
</operation>
</binding>
</definitions>

Thanks

--Thomas
tstalzer
[|]
 
Posts: 65
Joined: Mon Oct 16, 2006 12:07 am
Location: Palma de Mallorca - Spain

Postby Sam De Block » Mon Dec 04, 2006 12:26 am

This might seem silly but:

" <soap:address location="http://vasthost:3802/SstWSServlet"/> "

If you have 'vasthost' in your hosts file, all tests where server + client are on the same machine will work.
If you try this with a client on another machine, this won't work because the client can't find the 'vasthost'. Just replace the vasthost with the ip of the server.

for the Eclipse problem: What exactly do you mean with doesnt show a result?Are you sure it actually receives a response? (try Trivial Proxy to monitor your requests/responses)
Sam De Block
 
Posts: 17
Joined: Thu Nov 09, 2006 4:25 am

Postby tc » Mon Dec 04, 2006 10:38 am

Hello, I agree, if you run something like tcp tunnel then you can see exactly what messages are going back and forth and possibly locate the specific problem.

Tcp Tunnel can be found at:

http://apache.gr-linux.com/ws/soap/version-2.3.1/

. . . and run it (after unzipping it) where your server is running using a command like:

javaw -cp .;soap.jar org.apache.soap.util.net.TcpTunnelGui 8070 127.0.0.1 8080

Port 8080 is the port your server is running on and requests are sent to port 8070. Tcp tunnel listens on port 8070, displays messages received and forwards them to port 8080 (the server). Messages coming back from the server are also displayed.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Postby tstalzer » Wed Dec 06, 2006 3:07 am

Hi tc ;-)

Ok, I installed the TCP tunneling Monitor - thanks - that's really useful.

I get a send and an answer almost immediately after I issue the WebService call from Eclipse. However, Eclipse keeps waiting and waiting. After about 15 minutes (I guess, some kind of timeout) - the result is shown in Eclipse.

The request, as shown in the TCP Tunneling Monitor

POST /SstWSServlet HTTP/1.1
Host: 192.168.3.169:3803
Content-Type: text/xml; charset=utf-8
Content-Length: 329
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: IBM Web Services Explorer
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://www.MyMath.com/MyMath-interface/mathFunc"
Connection: close

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns0:mathFunc xmlns:ns0="urn:MyMath">
<input1>123</input1>
<input2>4</input2>
</ns0:mathFunc>
</soapenv:Body>
</soapenv:Envelope>


and the response:

HTTP/1.1 200 Ok
Content-Type: text/xml
Content-Length: 627

<SOAP-ENV:Envelope
xmlns:xsd1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd12="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd123="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1234="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<mm:mathFuncResponse
xmlns:mm="urn:MyMath">
<input1>123.0</input1>
<input2>4.0</input2>
<product>492.0</product>
<sum>127.0</sum>
</mm:mathFuncResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


I also disabled the Windows Firewall, tried using the local IP address for the binding and ...

Any ideas?

--Thomas[/img]
tstalzer
[|]
 
Posts: 65
Joined: Mon Oct 16, 2006 12:07 am
Location: Palma de Mallorca - Spain

Postby tc » Wed Dec 06, 2006 9:52 am

Hello,

It looks like the service is invoked and handled properly since the reply is coming back. However, in the reply, for product and sum, I do not see a type specified. Here is how a soap message looks for invoking a 'getTemperature' service':

<?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:getTempResponse xmlns:ns1="urn:xmethods-Temperature-Demo" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:float">52.0</return>
</ns1:getTempResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

. . . you'll notice the '52.0' is of type float. To check the type, web services explorer allows you to import a wsdl file and drill down to where it shows types, etc., right? See if explorer is able to determine the types. Also, the import on your wsdl file is 'www.MyMathService.com/MyMathService-interface'. If you enter that address in a browser, can you see the interface file?

Thanks.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Postby tc » Wed Dec 06, 2006 11:58 am

Hello,

Looking at it again, I can see the 'www.MyMathService.com' is only a namespace but the 'interface' file location is specified. However, it seems those types are not being picked up for some reason. See if web services explorer sees the types when you drill down.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Postby tstalzer » Wed Jan 10, 2007 3:29 am

Hi

After a longer inspecting session, I got it fixed. Somehow Eclipse and Websphere don't like the idea of having a SstConnection longer than the actual call of the WebService. So, by changing the following method (closing the connectio after the reply)

Code: Select all
SstConnectiveTransport>>reply:to:

reply: message to: destination

   | connection result sstTag |
   self configuration retryCount + 1 timesRepeat: [
      (result := connection := self connectionManager connectionFor: destination) isSstError not ifTrue: [
         (result := connection reply: message) isSstError not ifTrue: [
            monitor notNil ifTrue: [monitor event: #'SstTag:Reply' value: 1].
            "Start -- TS Need to close the connection for e.g. Eclipse WebService Explorer"
            connection close.
            "End -- TS"
            sstTag := #'SstTag:Reply'.     "Monitoring tag"
            ^result].
         connection close].
      result isNonRecoverable ifTrue: [^result]].
   ^result


the WebService is callable by Eclipse and WebSphere Studio.

I know, this is not pretty and actually works against the concepts of SstConnectionManager but it works.

--Thomas
tstalzer
[|]
 
Posts: 65
Joined: Mon Oct 16, 2006 12:07 am
Location: Palma de Mallorca - Spain

Postby tc » Wed Jan 10, 2007 8:54 am

Hello Thomas,

That is great info, we will jump on it here and investigate the issues more. Thanks.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest