on 02-16-2007 7:33 AM
Hello everybody,
I have set up a EJB with the following code:
import javax.ejb.Stateless;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.soap.SOAPBinding;
import beans.HelloWorldEARBean;
@WebService(name="HelloWorldEARBean",serviceName="HelloWorldEARBeanService",targetNamespace="http://beans/",portName="HelloWorldEARBeanPort")
@SOAPBinding(style=SOAPBinding.Style.RPC )
@Stateless public class HelloWorldEARBean {
@WebMethod public String sayHello(@WebParam(name="testStr") String testStr){
return "Hello Mr. "+testStr;
}
}
Afterrwards I "converted" it to a WebService with the SAP Developer Studio wizard and deployed it.
Than I tried to call my WeService via SOAP (form a PHP script). The call works, but the sent parameter isn't processed, the result is "Hello Mr. null".
So I changed between
@SOAPBinding(style=SOAPBinding.Style.RPC )
and
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT )
it's crazy! So first I use
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT )
in the EJB, save the WSDL file locally.
Afterwards I changed the Annotation @SOAPBinding to
@SOAPBinding(style=SOAPBinding.Style.RPC )
Than I use the local XML file (provided by the WebService in DOCUMENT mode) to connect to the WebService.<b> Result: It works!</b>
Now I analysed both XML files and customized the "local" XML to nearly the WebService's XML. There is only one difference remaining (which makes the script working or not):
the "local" XML (working):
<wsdl:part name="testStr" element="tns:sayHello"/>
the remote XML (not working):
<wsdl:part name="testStr" type="p0:string"/>
I don't tried the SOAP connection only with PHP but also with JAVA (Apache AXIS).
In the PHP forum somebody mentioned that maybe the Java wizard creates a "broken" WSDL (link: ).
Is there any possibility to change this behavior?
Because I don't always want to use the "local" XML file. (I don't think this was the idea when providing WebServices.)
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.