0
sash-ml
13.07.10
✎
14:21
|
Есть некий веб-сервис
Прокси = WSСсылки.C.СоздатьWSПрокси(...);
Ответ = Прокси.SetP(Par1,Par2);
При обращении к функции веб-сервиса ощибка.
Ошибка разбора SOAP сообщения: обязательный заголовок не найден.
Проблема в том что я ни малейшено понятия не имею как средсвами 1С передать SOAP заголовок. При том что я знаю даже чего в нем нехватает.
притом что на РНР это выглядит приблезительно вот так:
SH = New SoapHeader (&myHeaderString,...)
_SetSoapHeader(SH,...) и прекрасно работает
Есть идеи?
|
|
2
sash-ml
13.07.10
✎
17:23
|
так и знал что см быстрее разберусь чем ктото подскажет, VBA рулит.
Option Explicit
Sub Main()
Dim END_POINT_URL As String
Dim Method As String
Dim NS_URI_SOAP_ENC As String
Dim STOCKQUOTE_NS As String
Dim SOAP_ACTION As String
Dim Connector As HttpConnector
Dim Serializer As SoapSerializer
Dim Reader As SoapReader
' In the Java client, this is the first parameter to call.invoke
END_POINT_URL = "http://localhost:8080/soap/servlet/rpcrouter"
' Alternative for tracing
'END_POINT_URL = "http://localhost:81/soap/servlet/rpcrouter"
' In the Java client, this is the parameter to call.setMethodName
Method = "getQuote"
' In the Java client, this is the parameter to call.setEncodingStyleURI
NS_URI_SOAP_ENC = "http://schemas.xmlsoap.org/soap/encoding/"
' In the Java client, this is the parameter to call.setTargetObjectURI
STOCKQUOTE_NS = "urn:xmltoday-delayed-quotes"
' In the Java client, this is the second parameter to call.invoke
'SOAP_ACTION = "uri:" & Method
SOAP_ACTION = ""
Set Connector = New HttpConnector
Connector.Property("EndPointURL") = END_POINT_URL
Connector.Connect 'Nothing - parameter used in beta versions of the Toolkit
' As of SOAP Toolkit 2.0 SP2, it is not legal to specify an empty SOAP_ACTION,
' but the same affect is achieved by not setting
If Len(SOAP_ACTION) > 0 Then Connector.Property("SoapAction") = SOAP_ACTION
Connector.BeginMessage 'Nothing - parameter used in beta versions of the Toolkit
Set Serializer = New SoapSerializer
Serializer.Init Connector.InputStream
Serializer.startEnvelope
Serializer.SoapAttribute "xmlns:xsi", , _
"http://www.w3.org/1999/XMLSchema-instance"
Serializer.SoapAttribute "xmlns:xsd", , _
"http://www.w3.org/1999/XMLSchema"
Serializer.startBody
Serializer.startElement Method, STOCKQUOTE_NS, NS_URI_SOAP_ENC, "sq"
' In the Java client, this corresponds to a new Parameter(...)
Serializer.startElement "symbol"
Serializer.SoapAttribute "xsi:type", , "xsd:string"
Serializer.writeString "IBM"
Serializer.endElement
Serializer.endElement
Serializer.endBody
Serializer.endEnvelope
Connector.EndMessage
Set Reader = New SoapReader
Reader.Load Connector.OutputStream
If Not Reader.Fault Is Nothing Then
MsgBox Reader.faultstring.Text, vbExclamation
Else
MsgBox Reader.RPCResult.Text
End If
End Sub
|
|