No, it do not work after changing it from "encoded" to "literal". I only could
create java classes with wsimport [1] after changing it. A teammate also told me
to change it to "literal" for Microsoft Dynamics AX because he is already
consuming soap services and they all use "literal".

The problem I have is, that I wrote an application and now I need a soap service
to provide functionality to non-php-applications. We begun to test the soap
service with Microsoft Dynamics AX but it won´t work. After I could not figure
out why (useless error messages, no possibility to check what the service is
doing) we tried to consume the service with an java soap client. There I got
usefull error messages so I could change Zend_Soap_AutoDiscover like mentioned
in my first email.

Now I could create java classes with wsimport to consume the soap service but I
always get NULL as return value. No error message, no empty result... only NULL.

Found another application that can consume the soap service. WSDL explorer of
WTP project (http://www.eclipse.org/webtools/). Don´t know what it is written
in, but I think it is writtn in java like all eclipse plugins :-)

[1] https://jax-ws.dev.java.net/jax-ws-ea3/docs/wsimport.html

-- Jan

> this is very valueable input. thank you very much.
> 
> I have to look into that. Unfortunatly the AutoDiscover and WSDL internals 
> are 
> in very bad shape to extend without easily breaking backwards compability, so 
> i cannot assure you that I can include it in the next mini or minor release.
> 
> Do i understand you correctly, that it worked for you with Java, when you 
> switched from encoded to literal?
> 
> greeetings
> Benjamin
> 
> On Tuesday 25 November 2008 21:23:30 Jan Pieper wrote:
>> Hi guys,
>>
>> I created a small soap service with Zend_Soap_Server and
>> Zend_Soap_AutoDiscover but I cannot consume its data via a java soap
>> client. I tried it all the day but it won´t work.
>>
>> ----- SNIP -----
>>
>> class MyFooService
>> {
>>     /**
>>      * @return string
>>      */
>>     public function getStaticString() {
>>         return 'Hello World';
>>     }
>> }
>>
>> ----- SNAP -----
>>
>> It is accessable (for me!) via http://jason/Laboratory/JMS/service.php
>> which is the service and http://jason/Laboratory/JMS/service.php?wsdl which
>> will show wsdl definition. The created wsdl definition looks like this:
>>
>> ----- SNIP -----
>>
>> <?xml version="1.0"?>
>> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/";
>> xmlns:tns="http://jason/Laboratory/JMS/service.php";
>>     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>>     xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/";
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
>>     name="MyFooService"
>> targetNamespace="http://jason/Laboratory/JMS/service.php";> <portType
>> name="MyFooServicePort">
>>         <operation name="getStaticString">
>>             <input message="tns:getStaticStringRequest" />
>>             <output message="tns:getStaticStringResponse" />
>>         </operation>
>>     </portType>
>>     <binding name="MyFooServiceBinding" type="tns:MyFooServicePort">
>>         <soap:binding style="rpc"
>> transport="http://schemas.xmlsoap.org/soap/http"; />
>>         <operation name="getStaticString">
>>             <soap:operation
>>
>> soapAction="http://jason/Laboratory/JMS/service.php#getStaticString"; />
>>             <input>
>>                 <soap:body use="literal"
>>                     namespace="http://jason/Laboratory/JMS/service.php"; />
>>             </input>
>>             <output>
>>                 <soap:body use="literal"
>>                     namespace="http://jason/Laboratory/JMS/service.php"; />
>>             </output>
>>         </operation>
>>     </binding>
>>     <service name="MyFooServiceService">
>>         <port name="MyFooServicePort" binding="tns:MyFooServiceBinding">
>>             <soap:address
>> location="http://jason/Laboratory/JMS/service.php"; /> </port>
>>     </service>
>>     <message name="getStaticStringRequest" />
>>     <message name="getStaticStringResponse">
>>         <part name="getStaticStringReturn" type="xsd:string" />
>>     </message>
>> </definitions>
>>
>> ----- SNAP -----
>>
>> As you can see I do not use Zend_Soap_AutoDiscover in its original version
>> (see attached MyAutoDiscover.diff, could not extend and use my own class
>> because I need access to private class properties). I needed to change
>> <soap:body use="encoded" encodingStyle="..." /> to <soap:body use="literal"
>> namespace="..." /> because wsimport (small tool included in jdk) cannot
>> handle "encoded". So I used following command to create java classes from
>> wsdl definiton:
>>
>> # wsimport -keep http://jason/Laboratory/JMS/service.php?wsdl
>>
>> So I got this two java classes:
>>
>> # jason.laboratory.jms.service.MyFooServicePort.java
>> # jason.laboratory.jms.service.MyFooServiceService.java
>>
>> After that I created a soap client using these classes (jdk1.6.0_10):
>>
>> ----- SNIP -----
>>
>> package jason.laboratory.jms.myfooclient;
>>
>> import jason.laboratory.jms.service.*;
>>
>> public class MyFooClient
>> {
>>     /**
>>      * @param args
>>      */
>>     public static void main(String[] args)
>>     {
>>         MyFooServiceService mfss = new MyFooServiceService();
>>         MyFooServicePort    mfsp = mfss.getMyFooServicePort();
>>         String result            = mfsp.getStaticString();
>>
>>         if (result != null) {
>>             System.out.println("Result: " + result);
>>         } else {
>>             System.out.println("Result is NULL");
>>         }
>>     }
>> }
>>
>> ----- SNAP -----
>>
>> I expected "Result: Hello World" but I always get "Result is NULL".
>> Zend_Soap_Client has no problems consuming the service.
>>
>> It looks like an java problem, but we also tested the same soap server
>> using a Microsoft Dynamics AX soap client and got the same result. Okay we
>> do not get "NULL" as return value from service, the Microsoft soap client
>> shows "1" as result.
>>
>> So I am searching for a solution how to get it working. I am absolutly
>> clueless why I do not get the correct result. Is there someone who can
>> verify or solve my problem? :-)
>>
>> If there are any questions or if there are more information needed, please
>> ask! If needed I can upload my sources.
>>
>> -- Jan
> 

Reply via email to