Call/Consume .net webservice from PHP

N

Nattydreadlock

Hi,

I've written an ASP.Net webservice which takes somes specific .net
objects.
Now I want to caal this service by PHP, which normally would be
possible, after all that's the main reason of existence for web
services.

I have three function:

<WebMethod()> Public Function GetLastName( Name as string) as String
Dim LastName as string = "Test" 'get last name in real world
return LastName
End Function


<WebMethod()> Public Function GetLastNames(Names() as string) as
String()
dim list as new list(of string)
For Each item as String in Names
dim lastname as string = "test" 'get last name in real world
list.add(lastname)
Next
return list.toArray
End Function

<WebMethod()> Public Function GetID(Person as Person) as Integer
If Person.LastName = "test" then
Return 1
End IF
End Function

Public Class Person
Public Name as string
Public LastName as string

The first function I got to work, there we only pass in a parameter of
type string.
The second one is a problem because we pass in an array
The third one is also a problem because we pass in a custom defined
object

Soap looks kind of like this:

Method1:
<string>name</string>

Method2:
<Names>
<string>string</string>
<string>string</string>
</Names>

Method3
<Person>
<Name>string</Name>
<LastName>string</LastName>
</Person>


Does anyone have an idea about how we can pull this off?

With kind regards
Kenneth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top