Cześć mam problem ze zmapowaniem obiektu w Javie.
Komunikacja wygląda tak:
PHP -> soap/wsdl -> JAVA
Po stronie php jest SOAP serwer który generuje xml'a WSDL
Korzystam z
com.ibm.wsdl.;
javax.wsdl.;
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", true);
reader.setFeature("javax.wsdl.importDocuments", true);
Definition def = reader.readWSDL(null, mySoapURL);
String tns = mySoapTNS;
Service service = def.getService(new QName(tns, "myService"));
Port port = service.getPort("myPort");
//Message msg = new MessageImpl();
//Input input = new InputImpl();
//input.setName("test");
//input.setMessage(msg);
//Binding binding = port.getBinding();
//BindingOperation bo = binding.getBindingOperation("myMethod", "inputName", "outputName");
//bo.getOperation().setInput(input);
//Output output = bo.getOperation().getOutput();
Próbowałem tak:
Binding binding = port.getBinding();
BindingOperation bop = binding.getBindingOperation("suma", null,null); //zamiast null -> inputName i outputName
i:
WSDLHelper wsdlh = new WSDLHelper();
BindingOperation bop = wsdlh.getBindingOperation(binding, "suma");
System.out.println(bop);
Zwraca:
Retrieving document at 'http://mysite.com/soap?wsdl'.
BindingOperation: name=suma
BindingInput: name=null
SOAPBody ({http://schemas.xmlsoap.org/wsdl/soap/}body):
required=null
use=encoded
encodingStyles=[http://schemas.xmlsoap.org/soap/encoding/]
namespaceURI=http://mysite.com/soap
BindingOutput: name=null
SOAPBody ({http://schemas.xmlsoap.org/wsdl/soap/}body):
required=null
use=encoded
encodingStyles=[http://schemas.xmlsoap.org/soap/encoding/]
namespaceURI=http://mysite.com/soap
SOAPOperation ({http://schemas.xmlsoap.org/wsdl/soap/}operation):
required=null
soapActionURI=http://mysite.com/soap#suma
BUILD SUCCESSFUL (total time: 1 second)
Problem mam z wywołaniem metody "SUMA" i przekazaniem 2 parametrów.
Jeżeli ktoś miałby jakieś wskazówki z góry wielkie dzieki!