Jump to content

Consuming .net webservice with PHP


dlyxzen

Recommended Posts

hey guys,

 

i have been searching the forums and have found some similar threads however my php knowledge is not that great so find it hard to adapt anything i have read to my exact situation.

 

Simply all i want to do is consume a .net web service, all this service currently does is add two numbers and returns the result (for now anyway)  . I have been given an example .net script to access this service but unfortunatly i need it in PHP.

 

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>

 

<script language="VB" runat="server">

 

Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

If Not Page.IsPostBack then

 

Dim testwebservice as new SimpleWSTest 'This is called via the proxy class in the app_code folder. You will need to do a similar thing in PHP i would think.

 

lblresult.text = ws.AddNumbers(1,100)

 

End If

 

End Sub

 

</script>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Test consume web service</title>

</head>

<body>

 

<p>this is a test web service accessed at MyDomain/testwebservices/addtwonumbers.asmx.</p>

<p> Result:

  <asp:label runat=server id="lblresult" />   

</p>

</body>

</html>

 

Im struggling to get a PHP equivalent of this script, however no doubt very simple, as mentioned i am fairly new to php consuming web services hence wouldnt know where to start.

 

any help appreciated greatly,

 

cheers

 

 

dlyxzen

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.