Consuming Third Party Web Services

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

Consuming Third Party Web Services

Postby koschate » Wed Feb 18, 2009 11:45 am

I'm attempting to connect to a third party, non-Smalltalk web service for which I only have the WSDL. The Is there a simple walkthrough that will guide me in wrapping this interface for use in VAST and setting up appropriate deserialization (the two paragraphs the Getting Started guide fail to discuss dealing with handling returned objects)? The Abx XML goodie will generate some of the classes involved, but stops far short of all that is needed. I can't believe there isn't some sort of generator that will do the necessary heavy lifting - VisualWorks is miles ahead in this regard.
koschate
[|]
 
Posts: 102
Joined: Thu Feb 01, 2007 7:24 am

Re: Consuming Third Party Web Services

Postby tc » Thu Feb 19, 2009 5:56 am

Hello,

Is this an external, on the net, web service or internal?

Thanks.

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

Re: Consuming Third Party Web Services

Postby koschate » Thu Feb 19, 2009 6:36 am

It's a third party application that we run on an in-house server.
koschate
[|]
 
Posts: 102
Joined: Thu Feb 01, 2007 7:24 am

Re: Consuming Third Party Web Services

Postby tc » Thu Feb 19, 2009 7:49 am

Hello,

I'm attempting to connect to a third party, non-Smalltalk web service for which I only have the WSDL.

. . . that is all that is needed, the WSDL file (which probably imports schema files, etc.). Having only the WSDL file is the normal situation.

The Is there a simple walkthrough that will guide me in wrapping this interface for use in VAST and setting up appropriate deserialization (the two paragraphs the Getting Started guide fail to discuss dealing with handling returned objects)?

. . . I do not have additional documentation.

Are you able to call the web service and get a soap message back? If you are unable to call it, what kind of error is returned?

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

Re: Consuming Third Party Web Services

Postby koschate » Thu Feb 19, 2009 10:19 am

Are you able to call the web service and get a soap message back? If you are unable to call it, what kind of error is returned?


I have no trouble calling the web service and getting soap messages back. However, I'd much prefer to be able to deserialize the returned soap messages into real Smalltalk objects. Right now, I'm resorting to sending a bunch of #getObjectNamed: messages to the result. This is not too horrible for some of the calls I'm wrapping, but others return objects whose elements are other objects that contain other objects. It's also not practical as this process scales.

So what I'm looking for is two things: First, some way of deriving and building classes to hold instances of the objects represented by the soap messages. I'm looking at in excess of a hundred classes, so doing it by hand isn't terribly appealing. The task is obviously not impossible - Ruby does it, Python does it, and VisualWorks does it. I suppose if I get desperate enough, I could generate the classes in VisualWorks and port them over to VAST

Second, I'm looking for instructions on how to resolve the soap messages into instances of those classes.
koschate
[|]
 
Posts: 102
Joined: Thu Feb 01, 2007 7:24 am

Re: Consuming Third Party Web Services

Postby tc » Thu Feb 19, 2009 4:31 pm

Hello,

Normally, a schema file (.xsd) is used to generate ST classes and a mapping file. The structure seen in the XML is being enforced by a schema file.

You mentioned 100 classes to be created, that would be a lot of work because if one expects ST to populate the variables automatically, the ivars would have to made public in the public interface editor.

Step 1 is get the soap message.
Step 2 is get the schema file that enforces the structure of the XML you see in the SOAP message.

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

Re: Consuming Third Party Web Services

Postby Elenthril » Wed Feb 25, 2009 2:46 am

tc wrote:Hello,

Normally, a schema file (.xsd) is used to generate ST classes and a mapping file. The structure seen in the XML is being enforced by a schema file.

You mentioned 100 classes to be created, that would be a lot of work because if one expects ST to populate the variables automatically, the ivars would have to made public in the public interface editor.

Step 1 is get the soap message.
Step 2 is get the schema file that enforces the structure of the XML you see in the SOAP message.

--tc


Hi,

We are dealing with the same issue. We are calling a third party seb services and want to deserialize the returned SOAP into smalltalk objects other than the default sstSoapMappedElement structure. I suppose we need to define the mapping between the SOAP payload and the smalltalk objects. My question is 'How do I tell the deserializer to use this mapping'. Can someone provide or can I find an example somewhere of how this is done?

Thanks,
Elenthril
Elenthril
 
Posts: 7
Joined: Wed Feb 25, 2009 2:35 am

Re: Consuming Third Party Web Services

Postby Diane Engles » Wed Feb 25, 2009 4:11 am

Hi,

You can define a deployment descriptor and specify mappings via xml. See the Insurance Example which is in the samples\sstws directory down your VA Smalltalk Installation path.
There is a discussion of customizing the deployment descriptor in the Web Services Guide Samples section.

Here is an example of how to resolve a mapping spec and add it to the container's serialization manager programmatically:

Code: Select all

| container ddStrategy mapping spec |

container := SstWSContainer createContainerNamed: 'SampleContainer' .
ddStrategy := SstWSVastServicesDeploymentDescriptorStrategy new.
mappingSpec := ddStrategy resolveMappingSpec: 'C:\myMappingSpec'.
container serializationManager addMappingSpec: mappingSpec named: mappingSpec nameSpaceURI.

Instantiations Smalltalk Support
diane@instantiations.com
Diane Engles
Moderator
 
Posts: 66
Joined: Mon Oct 16, 2006 2:40 pm


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest