I'm writing a web service for handling the tr-069 protocol
(urn:dslforum-org:cwmp-1-0). I try to call the web service with the following
request :
POST /ThomsonWS.asmx HTTP/1.1
Content-Type: text/xml; charset=ISO-8859-1
User-Agent: Thomson_cwmp-engine/r6.2.G.3
SOAPAction:
Host: localhost
<soapenv:Envelope
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cwmp="urn:dslforum-org:cwmp-1-0">
<soapenv:Header>
<cwmp:ID soapenv:mustUnderstand="1">43_THOM_TR69_ID</cwmp:ID>
</soapenv:Header>
<soapenv:Body>
...
</soapenv:Body>
</soapenv:Envelope>
Generated code by wscf is :
<System.Web.Services.Protocols.SoapHeaderAttribute("IDValue",
Direction:=SoapHeaderDirection.In), _
System.Web.Services.WebMethodAttribute(), _
System.Web.Services.Protocols.SoapDocumentMethodAttribute( _
"urn:dslforum-org:cwmp-1-0:iDIn", _
OneWay:=True, _
Use:=System.Web.Services.Description.SoapBindingUse.Literal, _
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare, _
Binding:="Thomson")> _
Public Overridable Sub
ID(<System.Xml.Serialization.XmlElementAttribute("ID",
[Namespace]:="urn:dslforum-org:cwmp-1-0")> ByVal iD1 As ID) Implements
IThomson.ID
Throw New System.NotImplementedException
End Sub
-----------------
<System.Xml.Serialization.XmlElementAttribute(ElementName:="IDValue")> _
Public Property IDValue() As ID
Get
Return Me._iDValue
End Get
Set(ByVal value As ID)
If (value Is Nothing) Then
Throw New System.ArgumentNullException("IDValue")
End If
Me._iDValue = value
End Set
End Property
----------------------------
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml",
"2.0.50727.42"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true,
TypeName:="ID"), _
System.Xml.Serialization.XmlRootAttribute([Namespace]:="urn:dslforum-org:cwmp-1-0", IsNullable:=false, ElementName:="ID"), _
System.ComponentModel.TypeConverterAttribute(GetType(System.ComponentModel.ExpandableObjectConverter))> _
Partial Public Class ID
Inherits System.Web.Services.Protocols.SoapHeader
'''<remarks/>
Private _value As String
Public Sub New()
MyBase.New
End Sub
<System.Xml.Serialization.XmlTextAttribute()> _
Public Property Value() As String
Get
Return Me._value
End Get
Set(ByVal value As String)
If (Me._value <> Value) Then
Me._value = Value
End If
End Set
End Property
End Class
----------------------------
My problem is that the SOAP Header ID is not recognized, bad declaration or
maybe because the SOAPAction is not specified. Here is the error returned :
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:MustUnderstand</faultcode><faultstring>System.Web.Services.Protocols.SoapHeaderException: L'en-tête SOAP ID n'a pas été reconnu.
à
System.Web.Services.Protocols.SoapHeaderHandling.SetHeaderMembers(SoapHeaderCollection
headers, Object target, SoapHeaderMapping[] mappings, SoapHeaderDirection
direction, Boolean client)
à System.Web.Services.Protocols.SoapServerProtocol.CreateServerInstance()
à System.Web.Services.Protocols.WebServiceHandler.Invoke()
à
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</faultstring></soap:Fault></soap:Body></soap:Envelope>
I don't have your solution, but fighting also with TR-069 on a Thomson
device. I am writing it in Python to integrate the service in another
tool, and have a WEB server speaking in SOAP with the device. The
connection is working fine with the device.
I managed to answer the BOOTSTRAP message correctly (but i said max
envelopes = 0), and now i'm trying to respond to the inform sent after
a connection request from the ACS to the CPE. I want to integrate a
Get or Set parameters in the same message. I tried to send:
<soapenv:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://
schemas.xmlsoap.org/soap/envelope/" soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header>
<cwmp:ID soapenv:mustUnderstand="1">22_THOM_TR69_ID</cwmp:ID>
</soapenv:Header>
<soapenv:Body>
<cwmp:InformReponse>
<MaxEnvelopes>2</MaxEnvelopes>
</cwmp:InformReponse>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://
schemas.xmlsoap.org/soap/envelope/" soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header>
<cwmp:ID soapenv:mustUnderstand="1">23_THOM_TR69_ID</cwmp:ID>
</soapenv:Header>
<soapenv:Body>
<cwmp:GetParameterValues>
<ParameterNames soap:arrayType="xsd:string[1]">
<string>InternetGatewayDevice.ManagementServer.</string>
</ParameterNames>
</cwmp:GetParameterValues>
</soapenv:Body>
</soapenv:Envelope>
But i don't get any response from the CPE, not even an error.
Any clue ?
Thanks
Fred
I have resolved my problems :-) I only needed to put on each web methods the
header tag ID.
For your problem, I think you can't send a set or get parameters immediatly
after an Inform.
You must send first an InformResponse to the CPE. Then the CPE contact you
again with an empty HTTP Request.
Here is a schema :
1. CPE -> ACS (Inform)
2. ACS -> CPE (InformResponse, MaxEnveloppe = 1)
3. CPE -> ACS (Empty HTTP Request)
4. ACS -> CPE (SetParameters, GetParameters, etc.)
Remarks
======
* I configured in the CPE (MaxEnveloppe = 1)
* Don't forget to set a cookie for the session (I think it's in the tr-69
documentation)
* If you work with IIS 5.1, you can have some problems with the empty
request of CPE. The transfer-encoding chunked is not managed correctly (use
IIS >= 6 or Apache proxy)
* Use a Network spy to see packets. I used Ethereal.
Best regards,
Zeljko
Hi, I am working with IIS 6. How should I go about handling the empty
(post) request from the CPE? Can I map this to a predefined method in
the service?
Regards,
Mike.