Re: PHP SOAP WSDL rookie needs help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29 December 2010 15:54, Mariaxx <sannamari28@gmail.com> wrote:
>
> unfortunately I don't have the access to the server. Only plain document
> listing the elements, types, values to be used. So you suggest, that I'll
> try to contact the the owner of the service?
>
>
> Ivan Rodriguez wrote:
>>
>> The service is programmed for you? Do you have access to the service
>> code? I recommend using JAX-WS to generate the Java service, most
>> likely the fault is in the service and not the client part written in
>> PHP, the NullPointerException is a Java error, so we need to view the
>> Java code ...
>>
>> On Wed, Dec 29, 2010 at 4:33 PM, Ivan Rodriguez <epplestun@gmail.com>
>> wrote:
>>> I'm looking de WSDL file and there are problems ... look this:
>>>
>>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>>> attributeFormDefault="qualified" elementFormDefault="qualified"
>>> targetNamespace="&quot;https://www.sveadirekt.se/services/ApplicationForLoan&quot;";>
>>>
>>> &quot; can not be used, you need a valid WSDL file to work with SOAP
>>>
>>> On Wed, Dec 29, 2010 at 4:10 PM, Mariaxx <sannamari28@gmail.com> wrote:
>>>>
>>>> Could I send it to you? I don't feel comfortble pasting it here.
>>>>
>>>> Maria
>>>>
>>>>
>>>> Ivan Rodriguez wrote:
>>>>>
>>>>> Do you have the service code?
>>>>>
>>>>> On Wed, Dec 29, 2010 at 3:56 PM, Mariaxx <sannamari28@gmail.com> wrote:
>>>>>>
>>>>>> I tried, but still
>>>>>>
>>>>>> Fatal error: Uncaught SoapFault exception: [soap:Client] Fault:
>>>>>> java.lang.NullPointerException in /home/admin/public_html/uusi.php:99
>>>>>> Stack
>>>>>> trace: #0 [internal function]: SoapClient->__call('createAppli...',
>>>>>> Array)
>>>>>> #1 /home/admin/public_html/uusi.php(99):
>>>>>> SoapClient->createApplication(Array) #2 {main} thrown in
>>>>>> /home/admin/public_html/uusi.php on line 99
>>>>>>
>>>>>> line 99 being the line for the call, E.g.
>>>>>>
>>>>>> $client->serviceCall((array) $myObject);
>>>>>>
>>>>>> Though I changed the $myObject to be $form in your example.
>>>>>>
>>>>>>
>>>>>> Ivan Rodriguez wrote:
>>>>>>>
>>>>>>> Looking your code, there is a error in the array declaration, in the
>>>>>>> key Firstname, you have two '
>>>>>>>
>>>>>>> One trick to pass objects to the service is doing the following:
>>>>>>> $client->serviceCall((array) $myObject);
>>>>>>>
>>>>>>> $form = array(
>>>>>>> Â Â Â 'myObject' => array(
>>>>>>> Â Â Â Â Â Â Â 'Loan' => array(
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'Product' => 1,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'LoanAmount' => 10000,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'PaymentTime' => 10,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'Insurance' => 0,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'Salary' => 40000,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'Bank' => 'some'
>>>>>>> Â Â Â Â Â Â Â ),
>>>>>>> Â Â Â Â Â Â Â 'PersonalInfo' => array(
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'FirstName' => 'Test',
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'LastName' => 'Example',
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'AddressCoName' => '',
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'StreetAddress' => 'Something 1',
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'ZipCode' => 12345,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'City' => 'Some'
>>>>>>> Â Â Â Â Â Â Â ),
>>>>>>> Â Â Â Â Â Â Â 'Living' => array(
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'ApartmentFee' => 0,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'Rent' => 0,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'StudyLoan' =>0,
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â 'Guarantee' => ''
>>>>>>> Â Â Â Â Â Â Â )
>>>>>>> Â Â Â )
>>>>>>> );
>>>>>>>
>>>>>>> foreach($form as $className => $items) {
>>>>>>> Â Â Â $cn = ucfirst($className);
>>>>>>>
>>>>>>> Â Â Â if(class_exists($cn)) {
>>>>>>> Â Â Â Â Â Â Â $$className = new $cn;
>>>>>>> Â Â Â Â Â Â Â foreach($items as $item => $value) {
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â if($value)
>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â $$className->$item = $value;
>>>>>>> Â Â Â Â Â Â Â }
>>>>>>> Â Â Â } else {
>>>>>>> Â Â Â Â Â Â Â $$className = $items;
>>>>>>> Â Â Â }
>>>>>>> }
>>>>>>>
>>>>>>> And them invoke service doing:
>>>>>>>
>>>>>>> $client->serviceCall((array) $myObject);
>>>>>>>
>>>>>>> Try with this trick, and good luck :)
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Dec 29, 2010 at 2:34 PM, Richard Quadling
>>>>>>> <rquadling@gmail.com>
>>>>>>> wrote:
>>>>>>>> On 29 December 2010 11:43, Mariaxx <sannamari28@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>> Ok, I'm still stuck with this one.
>>>>>>>>>
>>>>>>>>> headers seem to work, because Â$ok = $client->__setSoapHeaders(
>>>>>>>>> $soapHeaders
>>>>>>>>> ); returns true, correct?
>>>>>>>>>
>>>>>>>>> However I'm getting "Fault: java.lang.NullPointerException" when I
>>>>>>>>> try
>>>>>>>>> to
>>>>>>>>>
>>>>>>>>> $result = Â$client->createApplication(array(here starts extremely
>>>>>>>>> long
>>>>>>>>> array, see below...));
>>>>>>>>>
>>>>>>>>> According to several threads on this forum, the above error
>>>>>>>>> suggests
>>>>>>>>> that
>>>>>>>>> the error is in the server and nullPointerException should never be
>>>>>>>>> returned. Does it mean, that my data in in the wrong format and the
>>>>>>>>> server
>>>>>>>>> can't handle it/error, when I try to connect?
>>>>>>>>>
>>>>>>>>> Maria
>>>>>>>>>
>>>>>>>>> Here's the call:
>>>>>>>>> $result = Â$client->createApplication(array('Loan' =>
>>>>>>>>> array('Product'
>>>>>>>>> =>
>>>>>>>>> 1,
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'LoanAmount'
>>>>>>>>> =>
>>>>>>>>> 10000,
>>>>>>>>>
>>>>>>>>> Â'PaymentTime'
>>>>>>>>> =>
>>>>>>>>> 10,
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'Insurance'
>>>>>>>>> =>
>>>>>>>>> 0,
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'Salary' =>
>>>>>>>>> 40000,
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'Bank' =>
>>>>>>>>> 'some'),
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'PersonalInfo' => array(''FirstName'
>>>>>>>>> =>
>>>>>>>>> 'Test',
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'LastName'
>>>>>>>>> =>
>>>>>>>>> 'Example',
>>>>>>>>>
>>>>>>>>> Â'AddressCoName'
>>>>>>>>> => '',
>>>>>>>>>
>>>>>>>>> Â'StreetAddress'
>>>>>>>>> => 'Something 1',
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'ZipCode' =>
>>>>>>>>> 12345,
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'City' =>
>>>>>>>>> 'Some'),
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'Living' => array('ApartmentFee' =>
>>>>>>>>> 0,
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'Rent' => 0,
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'StudyLoan'
>>>>>>>>> =>0,
>>>>>>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'Guarantee'
>>>>>>>>> =>
>>>>>>>>> '')));
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> RQuadling wrote:
>>>>>>>>>>
>>>>>>>>>> On 22 December 2010 19:46, Mariaxx <sannamari28@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>> I'm new to SOAP. I need to pass information via form to wsdl
>>>>>>>>>>> service.
>>>>>>>>>>>
>>>>>>>>>>> I'm unable to understand few things:
>>>>>>>>>>>
>>>>>>>>>>> 1) Do I need to write <soapenv: Envelope... kind of tags, or do I
>>>>>>>>>>> just
>>>>>>>>>>> get
>>>>>>>>>>> them by using PHP functions such as $a = new SoapClient() ?
>>>>>>>>>>>
>>>>>>>>>>> 2) Do I still need to pass normal HTTP header with XML definition
>>>>>>>>>>> plus
>>>>>>>>>>> SOAP
>>>>>>>>>>> header + SOAP body with PHP
>>>>>>>>>>>
>>>>>>>>>>> I get response from the server saying that my Header is missing.
>>>>>>>>>>> Also what does this mean: "Uncaught SoapFault exception:
>>>>>>>>>>> [soap:Client]
>>>>>>>>>>> Fault: java.lang.NullPointerException "
>>>>>>>>>>>
>>>>>>>>>>> I'd really appreciate your help. I shouldn't have taken this job
>>>>>>>>>>> : |
>>>>>>>>>>
>>>>>>>>>> Take a look at
>>>>>>>>>> http://old.nabble.com/forum/ViewPost.jtp?post=30277723&framed=y
>>>>>>>>>> and subsequent messages. They talk about getting taking a wsdl
>>>>>>>>>> file
>>>>>>>>>> and creating a set of PHP classes from it, which allow you to talk
>>>>>>>>>> to
>>>>>>>>>> the service without the need of creating any XML.
>>>>>>>>>>
>>>>>>>>>> The error message you are getting is the same as
>>>>>>>>>> http://old.nabble.com/forum/ViewPost.jtp?post=30470719&framed=y
>>>>>>>>>>
>>>>>>>>>> A possibility to the cause was mentioned in
>>>>>>>>>> http://old.nabble.com/forum/ViewPost.jtp?post=30480330&framed=y
>>>>>>>>>> and a
>>>>>>>>>> possible solution in
>>>>>>>>>> http://old.nabble.com/forum/ViewPost.jtp?post=30480433&framed=y
>>>>>>>>>>
>>>>>>>>>> Richard.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Richard Quadling
>>>>>>>>>> Twitter : EE : Zend
>>>>>>>>>> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> PHP Soap Mailing List (http://www.php.net/)
>>>>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://old.nabble.com/PHP-SOAP-WSDL-rookie-needs-help-tp30516854p30550653.html
>>>>>>>>> Sent from the Php - Soap mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> PHP Soap Mailing List (http://www.php.net/)
>>>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> I don't think the array() is correct. It has to be of a type
>>>>>>>> passable
>>>>>>>> to the service.
>>>>>>>>
>>>>>>>> Where is the WSDL file?
>>>>>>>>
>>>>>>>> I'll show you how to build the classes.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Richard Quadling
>>>>>>>> Twitter : EE : Zend
>>>>>>>> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> PHP Soap Mailing List (http://www.php.net/)
>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/PHP-SOAP-WSDL-rookie-needs-help-tp30516854p30551650.html
>>>>>> Sent from the Php - Soap mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> --
>>>>>> PHP Soap Mailing List (http://www.php.net/)
>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> PHP Soap Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/PHP-SOAP-WSDL-rookie-needs-help-tp30516854p30551767.html
>>>> Sent from the Php - Soap mailing list archive at Nabble.com.
>>>>
>>>>
>>>> --
>>>> PHP Soap Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>>
>>
>> --
>> PHP Soap Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/PHP-SOAP-WSDL-rookie-needs-help-tp30516854p30552036.html
> Sent from the Php - Soap mailing list archive at Nabble.com.
>
>
> --
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

There is nothing in the WSDL file to help you build a proper request.
The SOAP Service is simply acting as a proxy for whatever junk you
wish to send.

If you have URLs to alternative instructions, then they will have to
be used and understood.

As it stands, the issue is entirely the SOAP Service providers fault.

If they want the data to be supplied using specific
names/structures/values, then their WSDL file should provide it. As it
doesn't, you have to interpret whatever resources they provide.



-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux