Android Question Problem with soap 1.1

Discussion in 'Android Questions' started by AbbasMohammed, Aug 10, 2015.

  1. AbbasMohammed

    AbbasMohammed Member Licensed 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
    Code:
    <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:

    Code:
    <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 @
    Code:
    http://ya......................ami9.no-ip.org/wcfTestAlias/Service1.svc
    but i get internel server error message, Knowing that iam using the following code.....

    Code:
    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 :

    Code:
    <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: Aug 10, 2015
  2. AbbasMohammed

    AbbasMohammed Member Licensed User

    Is there is a program that can extract xml and header....etc from WSDL file that can be used directly from B4A programm??
     
  3. AbbasMohammed

    AbbasMohammed Member Licensed User

    I have found the solution:):):) .....many thanks

    Code:
    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""")
     
    DonManfred and RandomCoder like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice