Android Question Problem with soap 1.1

AbbasMohammed

Member
Licensed User
Longtime User
Dears,
Kindly, iam trying to reach my own iis self hosted Wcf which i can access it from SOAPUI programm using the following request
B4X:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:DoWork>
         <!--Optional:-->
         <tem:Nm>HI</tem:Nm>
      </tem:DoWork>
   </soapenv:Body>
</soapenv:Envelope>

and it returned me correct response as follows:

B4X:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <DoWorkResponse xmlns="http://tempuri.org/">
         <DoWorkResult>Hellow HI 4</DoWorkResult>
      </DoWorkResponse>
   </s:Body>
</s:Envelope>
and is addressed @
B4X:
http://ya......................ami9.no-ip.org/wcfTestAlias/Service1.svc

but i get internel server error message, Knowing that iam using the following code.....

B4X:
Sub Process_Globals

End Sub

Sub Globals

End Sub

Sub Activity_Create(FirstTime As Boolean)
    Dim j As HttpJob
    j.Initialize("j", Me)
    Dim msg As String
    msg=File.ReadString(File.DirAssets, "req1.xml")
'    msg = msg.Replace("$string$", "0")
    Msgbox(msg,"")
    j.PostString("http://yami............9yami9.no-ip.org/wcfTestAlias/Service1.svc", msg)
    j.GetRequest.SetContentType("text/xml; charset=utf-8")
End Sub

Sub JobDone (Job As HttpJob)
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
       Msgbox(Job.GetString,"")
    Else
        Log("Error: " & Job.ErrorMessage)
       Msgbox (Job.ErrorMessage,"Error")
    End If
    Job.Release
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

and the following req1.xml file :

B4X:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:DoWork>
         <!--Optional:-->
         <tem:Nm>HI</tem:Nm>
      </tem:DoWork>
   </soapenv:Body>
</soapenv:Envelope>
 
Last edited:

AbbasMohammed

Member
Licensed User
Longtime User
I have found the solution:):):) .....many thanks

B4X:
 Dim j As HttpJob
    j.Initialize("j", Me)
    Dim msg As String
    msg=File.ReadString(File.DirAssets, "req1.xml")
    j.PostString("http://ya.................mi.no-ip.org/wcfTestAlias/Service1.svc", msg)
    j.GetRequest.SetContentType("text/xml; charset=utf-8")
    j.GetRequest.SetHeader("SOAPAction", """http://tempuri.org/IService1/DoWork""")
 
Upvote 0
Top