Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1112201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:40:19+00:00 2026-05-17T02:40:19+00:00

I have a WCF service with three methods. Two of the methods return custom

  • 0

I have a WCF service with three methods. Two of the methods return custom types (these work as expected), and the third method takes a custom type as a parameter and returns a boolean. When calling the third method via a PHP soap client it returns an ‘Object reference not set to an instance of an object’ exception.

Example Custom Type:

_
Public Class MyClass

Private _propertyA As Double
<DataMember()> _
Public Property PropertyA() As Double
    Get
        Return _propertyA
    End Get
    Set(ByVal value As Double)
        _propertyA = value
    End Set
End Property

Private _propertyB As Double
<DataMember()> _
Public Property PropertyB() As Double
    Get
        Return _propertyB
    End Get
    Set(ByVal value As Double)
        _propertyB = value
    End Set
End Property

Private _propertyC As Date
<DataMember()> _
Public Property PropertyC() As Date
    Get
        Return _propertyC
    End Get
    Set(ByVal value As Date)
        _propertyC = value
    End Set
End Property

End Class

Method:

Public Function Add(ByVal param As MyClass) As Boolean Implements IService1.Add
‘ …
End Function

PHP client call:

$client->Add(array(‘param’=>array(
‘PropertyA’ => 1,
‘PropertyB’ => 2,
‘PropertyC’ => “2009-01-01”
)));

The WCF service works fine with a .Net client but I’m new to PHP and can’t get this to work.

Is it possible to create an instance of ‘MyClass’ in PHP.

Any help would be appreciated.

Note: I’m using PHP 5 (XAMPP 1.7.0 for Windows).

Thanks

Matt

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:40:20+00:00Added an answer on May 17, 2026 at 2:40 am

    I no longer have XAMPP setup in order to test but here is some example code:

    PHP:

    $wsdl = "https://....../ServiceName.svc?wsdl";
    $endpoint = "https://...../ServiceName.svc/endpointName";
    $client = new SoapClient($wsdl, array('location'=>$endpoint));
    
    $container = new stdClass();
    
    $container->request->PropertyA = 'Test 1';
    $container->request->PropertyB = 'Test 2';
    $container->request->PropertyC = '05/10/2010';
    
    $response = $client->ServiceMethodA($container);
    

    request is the name of the parameter expected by the web service.

    If you have a custom type with references to other custom types you can set those properties as follows:

    $container->request->OtherCustomType->Property1 = 'Test';
    

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF service method which takes more than two hours to execute
I have a WCF service written against some DB, and I need to filter
I have my WCF service, I've created reference to it from MSTest project. Here
I am trying to solve a problem where i have a WCF system that
I am writing a remote service for an application using WCF, in which login
I have a bunch of WCF services at a domain: AuthenticationService (the standard MS
There is the following design: the back-end implemented as WCF, the public front site
We have an existing application for which one of our DTO object has a
I'm trying to create a web service using Azure. For the time being, everything
I'm struggling a bit with the right architecture for my app. Particularly having problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.