I have an file with an signature which needs to be send to a webservice.
This service expects the following:
The Xml I've build is exactly the same:
I'm calling the service with:
The log says:
The server cannot service the request because the media type is unsupported.
JobName = PutStatus, Success = false
Error: Unsupported Media Type
sParameter is the xml-code. Should I use an other call? What does the log "Error: Unsupported Media Type" mean?
This service expects the following:
B4X:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<PutStatusXML7 xmlns="http://tempuri.org/">
<iUser>int</iUser> 'int should be replaced with an integer
<sPass>string</sPass> 'string should be replaced
<XMLFile>anyType</XMLFile> 'anytype is an xmlfile with tags
</PutStatusXML7>
</soap:Body>
</soap:Envelope>
The Xml I've build is exactly the same:
B4X:
<?XML version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<PutStatus xmlns="http://tempuri.org/">
<iUser>1201</iUser>
<sPass>jds</sPass>
<XMLFile><zendingen><status><s01>1201</s01><s02>13-09-2012</s02><s03>0</s03><s04>14:52:52</s04><s05>13-09-2012</s05><s06>300406</s06><s07>2507</s07><s08>1201-300406-09132012.bmp</s08><s09>Op bestellijst</s09><s10>9448</s10><s11></s11><s12></s12><s13></s13><s14>1</s14><s15>0</s15>
</status></zendingen></XMLFile>
</PutStatus></soap:Body></soap:Envelope>
I'm calling the service with:
B4X:
Sub PutStatus
Dim I, iTotal, J As Int
Dim lFiles As List
Dim sParameter, sNewFile, sChar, sSoap, requestSoapXML As String
Dim Soap As HttpJob
I = 1
lFiles.Initialize
lFiles = File.ListFiles(Map_Wachtrij)
If (lFiles.Size>0) Then
sNewFile = lFiles.Get(0)
sParameter = "<?XML version="& QUOTE & "1.0" "E &" encoding=""E& "utf-8" & QUOTE&"?><soap:Envelope xmlns:soap=""E& "http://schemas.xmlsoap.org/soap/envelope/""E&"><soap:Body><PutStatus xmlns="& QUOTE& "http://tempuri.org/""E&">"
sParameter = sParameter & "<iUser>" & Main.uniqueID & "</iUser><sPass>" & Main.Pass& "</sPass><XMLFile>"
sParameter = sParameter & File.ReadString(Map_Wachtrij,sNewFile)
sParameter = sParameter & "</XMLFile></PutStatus></soap:Body></soap:Envelope>"
ProgressDialogShow(lFiles.size & " status(sen) te versturen...")
Soap.Initialize("PutStatus","GlobalService")
HttpUtils.CallbackUrlDoneSub = "" 'don't want to handle this event
Log(sParameter)
Soap.PostString(Main.MainUrl, sParameter.Trim)
End If
End Sub
The log says:
The server cannot service the request because the media type is unsupported.
JobName = PutStatus, Success = false
Error: Unsupported Media Type
sParameter is the xml-code. Should I use an other call? What does the log "Error: Unsupported Media Type" mean?