ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Helen Luther" <helen_lut...@macktrucks.com>
Subject XMLSchema-instance and XMLSchema
Date Tue, 15 Jan 2002 18:22:07 GMT
   I am using VB6 as the client attempting to access an APACHE SOAP 2.2 Web
service.  If I set the xsi and xsd vars (bolded in VB6 code below) to :
   XSI = "http://www.w3.org/1999/XMLSchema-instance"
   XSD = http://www.w3.org/1999/XMLSchema
Everything works well.

However, when I set them to:
   XSI = "http://www.w3.org/2000/XMLSchema-instance"
   XSD = http://www.w3.org/2000/XMLSchema
		OR
   XSI = "http://www.w3.org/2001/XMLSchema-instance"
   XSD = http://www.w3.org/2001/XMLSchema

I get error :
No Deserializer found to deserialize a :Parameter1 using encoding style
"http://schemas.xmlsoap.org/soap/encoding/"

I even used the TcpTunnelGui troubleshooting tool to compare the XML
produced by the "1999" code versus the "2000" / "2001" code.  The generated
XML for all 3 is exactly the same.  The server XML response includes xsi and
xsd uri's of 1999, how does server pick the xsi and xsd uri's to respond
with?  I.e. why is it using 1999 instead of 2000 or 2001 - I thought it
responded based on what was in the requests' envelope.

SERVER RESPONSE using TCPTunnelGUI:

<?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/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">

<SOAP-ENV:Body>

......

Thanks
Helen



Dim Connector As SoapConnector
   Dim Serializer As SoapSerializer
   Dim Reader As SoapReader

   Dim ENC As String
   Dim XSI As String
   Dim XSD As String
   Dim LOCAL_URL As String
   Dim URI As String
   Dim Method As String

   ENC = "http://schemas.xmlsoap.org/soap/encoding/"
   XSI = "http://www.w3.org/1999/XMLSchema-instance"
   XSD = "http://www.w3.org/1999/XMLSchema"
   LOCAL_URL = "http://localhost:8080/soap/servlet/rpcrouter"

   URI = "urn:MyTest"
   Method = "someMethod"

   ' The Connector will handle the HTTP Connection
   ' Prepare the Connector to talk to the SOAP Server.

   Set Connector = New HttpConnector
   Connector.Property("EndPointURL") = LOCAL_URL
   Connector.Connect
   Connector.Property("SoapAction") = URI & "#" & Method
   Connector.BeginMessage

   ' The Serializer will help you build the SOAP Envelope
   Set Serializer = New SoapSerializer

   ' Associate the Serializer with the Connecter
   Serializer.Init Connector.InputStream

   ' Start the SOAP Enveloper and specify the Encoding and XML-Schema
   Serializer.startEnvelope "", "STANDARD"

   Serializer.SoapNamespace "xsi", XSI
   Serializer.SoapNamespace "xsd", XSD

   'Start the body of the message - the root element is always the Service
URI and method
   Serializer.startBody

   Serializer.startElement Method, URI, , "method"

   ' Write each method paramenter out as a child to the root element
   Serializer.startElement "Parameter1"
   Serializer.SoapAttribute "type", , "xsd:string", "xsi"
   Serializer.writeString "myParameter"
   Serializer.endElement

   ' End the root element, the body and the envelope
   Serializer.endElement
   Serializer.endBody
   Serializer.endEnvelope

   ' Ending the message causes it to be sent
   Connector.EndMessage

   'Retrieve a result if the method returned one
   ' The Reader will help you access the result
    Set Reader = New SoapReader
   ' Load the result into the Reader
   Reader.Load Connector.OutputStream

   ' If no fault loading the Reader, then you can go ahead
   ' and pull the result of the invocation out of the DOM
   ' contained in the reader.  There are many ways to do
   ' this ranging from methods highly specialized to the task
   ' at hand (and thus quite efficient) to more general and
   ' reusable methods that are not so efficient.

   strLocationInCode = "Check Reader for fault."
   If Not Reader.Fault Is Nothing Then
       MsgBox Reader.faultstring.Text, vbExclamation
   Else
       MsgBox Reader.RPCResult.Text
       ' Parse the DOM to extract the result set.
   End If

   Exit Sub

TestError:
    MsgBox "Error " & Err.Number & " " & Err.Description

End Sub


Mime
View raw message