Here is the code I received from a customer on how they access their web service from PHP. I will need to do the same but from VB.Net. There is no WSDL available and this is all the code I have from them. Is this even possible?
$Client = new SoapClient(NULL, array('location' => 'http://ipaddress/onyx/api/soap_api.php', 'uri' => 'not-used'));
print_r($Client->qty_available('124044'));
/* Output: Array ( [01] => Array ( [available] => 333 [name] => Alliance )
If the data being returned is in a custom format (I'm guessing this from the question) then the default web service stuff might not work in .Net, you'll have to manually get the data from the request and parse it based on what the service returns. If it is in a standard XML, you may have to get the raw data once just to create the WSDL yourself.
Here is some code from a console app we used to test one of our .Net web services. Basically its making the request and returning the raw data. You could run this once to get the data that is returned, and then write the code to parse the data. I replaced our values with the ones from your question.
Module Module1
Sub Main()
Dim x = System.Net.HttpWebRequest.Create("http://ipaddress/onyx/api/soap_api.php")
x.Method = "POST"
Dim MemStream As New System.IO.MemoryStream
Dim ReqData As New IO.StreamWriter(MemStream, System.Text.Encoding.UTF8)
ReqData.Write(My.Resources.Test2)
ReqData.Flush()
x.ContentLength = MemStream.Length
x.ContentType = "text/xml; charset=utf-8"
x.Headers.Add("SOAPAction", "not-used")
Dim WebReq = x.GetRequestStream
WebReq.Write(MemStream.GetBuffer, 0, MemStream.Length)
WebReq.Flush()
WebReq.Close()
Dim Res As System.Net.HttpWebResponse = x.GetResponse
If Res.StatusCode = Net.HttpStatusCode.OK Then
Dim SR = New IO.StreamReader(Res.GetResponseStream)
Console.WriteLine(SR.ReadToEnd)
Else
Console.WriteLine(Res.StatusCode & ", " & Res.StatusDescription)
End If
Console.ReadLine()
End Sub
End Module
The `My.Resources.Test2' is the pre-formatted request data we were using. Here is a possible example for your situation, it may not be correct.
<?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>
<qty_available>
124044
</qty_available>
</soap:Body>
</soap:Envelope>
There are probably 50 different ways to solve this, but they all involve developing some sort of metadata if you can't get some basic docs from the customer. Does the link below help?
http://framework.zend.com/manual/1.12/en/zend.soap.autodiscovery.html