473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PHP5 soap request, complex type from wsdl issues

6
Hi All,

TIA, but currently I am trying to make a soap call to an API and I am not able to get the soap body to conform properly.

The current soap body that I am generating is
Expand|Select|Wrap|Line Numbers
  1. <SOAP-ENV:Body>
  2. <ns1:CancelEnhancedListing xsi:type="ns1:135">
  3. <item><key>ListingID</key><value>12</value></item>
  4. </ns1:CancelEnhancedListing>
  5. </SOAP-ENV:Body>
The problem is I need it to look like the following:
Expand|Select|Wrap|Line Numbers
  1. <soap:Body>
  2.     <ns1:CancelEnhancedListing xmlns="mynamespace">
  3.       <Arguments>
  4.         <ListingID>int</ListingID>
  5.       </Arguments>
  6.     </ns1:CancelEnhancedListing>
  7.   </soap:Body>
  8.  
Can some help me create the proper parameter to pass through with PHP code. I have been looking everywhere for an example similar to this but no luck.

This is what I have so far with somethings hidden for specific reasons
[PHP]
$param = new SoapVar(array('ListingID'=> 12), null, XSD_INT, "mynamespace");

client = new SoapClient('my wsdl location', array('trace'=>1));
$result = $client->CancelEnhancedListing($param);
[/PHP]

Thanks again for all your help,
Joe
Aug 27 '08 #1
1 5335
obj63
6
After some testing I have gotten closer with the following

[PHP]$myarg = new SoapVar(array('ListingID'=>12), SOAP_ENC_OBJECT, null, 'namespace', 'ListingID', 'namespace');
$myarg2 = new SoapVar(array('Arguments'=>$myarg), SOAP_ENC_OBJECT, null, 'namespace', 'Arguments', 'namespace' );

$result = $client->CancelEnhancedListing($myarg2);
[/PHP]

This then gives me the following:
Expand|Select|Wrap|Line Numbers
  1. <SOAP-ENV:Body>
  2.  <ns1:CancelEnhancedListing>
  3.   <ns1:Arguments>
  4.    <ListingID>12</ListingID>
  5.   </ns1:Arguments>
  6.  </ns1:CancelEnhancedListing>
  7. </SOAP-ENV:Body>
But I need it to be
Expand|Select|Wrap|Line Numbers
  1. <SOAP-ENV:Body>
  2.  <ns1:CancelEnhancedListing>
  3.   <ns1:Arguments>
  4.    <ns1:ListingID>12</ns1:ListingID>
  5.   </ns1:Arguments>
  6.  </ns1:CancelEnhancedListing>
  7. </SOAP-ENV:Body>
Any ideas why it is not assigning my variable ListingID to the same namespace?

Thanks
Joe
Aug 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Henrik Brautaset Aronsen | last post by:
I am having problems converting from Pear SOAP to PHP5 SOAP, especially when it comes to complex types. I would be grateful for any help on how this should be translated: ...
2
by: burdeen | last post by:
I've been trying to return an array with PHP5 soap. Is this not supported? or am i doing it wrong? Seems to return on the last element in the array. In my WSDL i've defined my return type as a...
0
by: David | last post by:
Hi everyone, I wonder how is it possible to make PHP SOAP extension convert the returned complex type to an instance of one of my classes. Here I give you a short example: complexTest.wsdl:...
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
0
by: dex | last post by:
Hi, I'm trying use a webservice with PHP5 soap extension in WSDL mode. I generated the php classes using wsdl2php. The problem is that 'auth' member of loginRequest (witch is a complex type)...
1
by: Gregor D. | last post by:
Hi, I want to consume an Apache Webservice with a C# .NET Client. Everything works fine, but I'm having problem with the deserialization of the complex type "Item" that is included in the...
0
by: Florian Laws | last post by:
Hello, to work around an interoperability problem with the PHP5 SOAP extension, I'd like to modify the generate XML SOAP request. (as described in...
1
by: akumar8k | last post by:
when i am excusing the below code i am getting the error. Error 1 − <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> − <SOAP-ENV:Body> −
0
by: jeffrey pry | last post by:
Hey, I am really having trouble with getting SOAP::Lite to function well when using a WSDL. Everywhere all over the internet people write tutorials but only address sending simple types to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.