Translation of a SOAP Envelope - Visual Basic/SOAP Toolkit to Java/Apache 
Author Message
 Translation of a SOAP Envelope - Visual Basic/SOAP Toolkit to Java/Apache

We are building a component with Visual Basic that will produce a SOAP
call to a Java class (servlet?) on an Apache server.

I am having problems building the SOAP Envelope (with the MS SOAP
toolkit) correctly.

Below is a 3-part exhibit. Part 1 is the data that the VB component
will receive. Part 2 displays the code used to create the envelope.
Part 3 is the expected output.

Note that part 2 is a snippet.

The primary problem is in translating the following line w/ the SOAP
toolkit:

<objects xmlns:ns2=' http://www.*-*-*.com/ '
xsi:type='ns2:Vector'>

Any suggestions? TIA

Please post responses to this newsgroup. All e-mail sent to the
address used to create this post is deleted.

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'Part 1
'Data received for populating the envelope
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<?xml version="1.0" encoding="UTF-8" ?>
<!--   Web Service Data -->
<object>
<data>
 <ID>001</ID>
 <dat>XYZ</dat>
</data>
<data>
 <ID>001</ID>
 <dat>ABC</dat>
</data>
</object>

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'Part 2
'Visual Basic Code using the Soapserializer to build the envelope
'All objects are declared and instantiated
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

objSerializer.startEnvelope ,
" http://www.*-*-*.com/ ;
objSerializer.SoapNamespace "xsi",
" http://www.*-*-*.com/ ;
objSerializer.SoapNamespace "SOAP-ENC",
" http://www.*-*-*.com/ ;
objSerializer.SoapNamespace "xsd", " http://www.*-*-*.com/ ;

objSerializer.startBody
objSerializer.startElement "fpMulti", "urn:fpProcess", , "method"

'Code used to retrieve the ID value from the XML stream (above) is not
'included here... the code works fine - not the problem

objSerializer.startElement "ID"
objSerializer.SoapAttribute "type", , "xsd:string", "xsi"
objSerializer.writeString ID
objSerializer.endElement

'vvvvvvvvvvvvv The translation problem is here vvvvvvvvvvvvvvvvvvvv

'Start objects
objSerializer.SoapNamespace "ns2", " http://www.*-*-*.com/ ;
objSerializer.startElement "objects"
objSerializer.SoapAttribute "type", , "ns2:Vector", "xsi"

'^^^^^^^^^^^^^ The translation problem is here ^^^^^^^^^^^^^^^^^^^^

'Loop through looking for the "data" tags
Set objDataNode = objXMLDoc.documentElement
Set objNodes = objDataNode.selectNodes("data")

For Each objChildNode In objNodes

 'Start Item
 objSerializer.startElement "data"
 objSerializer.SoapAttribute "type", , "ns1:object", "xsi"

 '<dat>TOYOTA</dat>
 '<dat xsi:type='xsd:string'>XYZ</dat>"
 objSerializer.startElement "dat"
 objSerializer.SoapAttribute "type", , "xsd:string", "xsi"
 objSerializer.writeString objChildNode.selectSingleNode("dat").Text
 objSerializer.endElement

 'End Item
 objSerializer.endElement

Next

'End objects
objSerializer.endElement

objSerializer.endElement
objSerializer.endBody
objSerializer.endEnvelope

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'Part 3
'Expected Output &#8211; Hard coding this string works. If there is
'an error here it is due to the manipulation of the string
'for posting the information to newsgroups.
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=' http://www.*-*-*.com/ '
xmlns:xsi=' http://www.*-*-*.com/ '
xmlns:xsd=' http://www.*-*-*.com/ '>
<SOAP-ENV:Body>
<ns1:fpMulti xmlns:ns1='urn:fpProcess'
SOAP-ENV:encodingStyle=' http://www.*-*-*.com/ '>
<ID xsi:type='xsd:string'>1</ID>

'vvvvvvvvvvvvv The translation problem is here vvvvvvvvvvvvvvvvvvvv
<objects xmlns:ns2=' http://www.*-*-*.com/ '
xsi:type='ns2:Vector'>
'^^^^^^^^^^^^^ The translation problem is here ^^^^^^^^^^^^^^^^^^^^

<data xsi:type='ns1:object'>
<dat xsi:type='xsd:string'>XYZ</dat>
</data>
<data xsi:type='ns1:object'>
<dat xsi:type='xsd:string'>XYZ</dat>
</data>
</objects>
</ns1:fpMulti>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



Tue, 07 Sep 2004 22:59:54 GMT  
 Translation of a SOAP Envelope - Visual Basic/SOAP Toolkit to Java/Apache

Quote:

> We are building a component with Visual Basic that will produce a SOAP
> call to a Java class (servlet?) on an Apache server.

> I am having problems building the SOAP Envelope (with the MS SOAP
> toolkit) correctly.

From what I know of this newsgroup, few - if any - of the regular posters use SOAP.
(Any lurkers who use SOAP extensively.)

The Microsoft SOAP newsgroups are usually quite active; might be better pickings there.

server: msnews.microsoft.com
group: microsoft.public.msdn.soaptoolkit

--
MikeC

Please reply to the group.



Wed, 08 Sep 2004 12:47:46 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. XML SOAP Message to Java Based SOAP Interface (Java Servlet)

2. SOAP Toolkit/Webservices and FileSystemObject

3. SOAP Toolkit/Web services and FileSystemObject...

4. Consuming WebService with VB6 Soap Toolkit under Win7

5. SOAP toolkit on Win2008 server and IIS7

6. How to call web service created by Soap toolkit wsdl Generator

7. Soap Toolkit Error

8. Time changed when calling a web service with Soap Toolkit

9. SOAP Toolkit/Web services and FileSystemObject...

10. Visual Basic 6 + PHP (SOAP) ?

11. Reading XML / SOAP response from call to a Web Service

12. XML/SOAP import to Outlook Contacts (personal) folder

 

 
Powered by phpBB® Forum Software