[JBossWS] - Re: JSR-109Client, Mapping problem and trying to connect to
by d_pavel
Once again the root cause of the problems are the JBossWS tools used to generate the required artifacts.
For comparison I used XFire (=open source Java SOAP framework).
I got a total of X artifacts generated using JBossWS wbservices stack and related tools.
In comparison I got a total of (X+10) artifacts generated using XFire (from these other 10 artifacts 7 are array type classes and the reminder of 3 are just simple object type classes...).
So in conclusion I used both and here is my opinion:
Not only that (different nr of artifacts), but there are discrepancies between the structure of the generated artifacts using JBossWS versus XFire even if the core of them should be in sync because I run against same WSDL. Please correct me if I'm wrong related with my last assumption.
Even the methods in the generated Service Endpoint Interface had different method signatures (well 2 of them but still !!!).
Now everything is working for me without issues (sorry no offence) but I was wondering about the different result from the tools in the 2 cases mentioned above....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037774#4037774
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037774
18 years, 12 months
[JBossWS] - How to provide soapAction from dispatch call?
by oskar.carlstedt
Hello!
I've tried a to fix this for some hours know. Maybe I'm doing something completely wrong here.
I have a web service client that that is using the dispatch technique. I will use the dispatch because I'm using xmlbeans to bind my data. Here is a little code snippet of what I'm trying to do:
| // names
| String targetNamespace = "http://test/test-service";
| QName serviceQName = new QName(targetNamespace, "TestService");
| QName portQName = new QName(targetNamespace, "TestServiceSoap11Port");
| URL wsdlURL = new URL("http://lpt-osca:8080/service-testservice-jaxws-web?wsdl");
|
| // create service
| Service service = Service.create(serviceQName);
| service.addPort(portQName, SOAPBinding.SOAP11HTTP_BINDING, wsdlURL.toExternalForm());
| Dispatch<StreamSource> dispatch = service.createDispatch(portQName, StreamSource.class, Mode.PAYLOAD);
|
| // set SOAPAction
| dispatch.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
| dispatch.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, "uri:placeBuyOrder");
|
| // create xml options for pretty print
| XmlOptions xmlOptions = new XmlOptions();
| xmlOptions.setSavePrettyPrint();
|
| // create request
| TestRequestDocument testRequestDocument = TestRequestDocument.Factory.newInstance();
| ...
|
|
| // print request
| System.out.println("REQUEST");
| testRequestDocument.save(System.out, xmlOptions);
| System.out.println();
|
| // save request in a stream
| ByteArrayOutputStream requestByteArrayOutputStream = new ByteArrayOutputStream();
| testRequestDocument.save(requestByteArrayOutputStream);
|
| // create a new stream source
| StreamSource requestStreamSource = new StreamSource(new ByteArrayInputStream(requestByteArrayOutputStream.toByteArray()));
|
| // invoke
| StreamSource responseSource = dispatch.invoke(requestStreamSource);
|
| // parse result
| XmlObject xmlObject = XmlObject.Factory.parse(responseSource.getInputStream());
|
| // print response
| System.out.println("RESPONSE");
| xmlObject.save(System.out, xmlOptions);
|
When doing this. it seems like the soap action attribute is not sent to the server, at least not in the http headers. So, my question is: Is the soapAction sent to the sever? If so, where can I find it in the messageContext?
My service is a web service endpoint provider implementation like
| @Stateless
| @WebServiceProvider(
| serviceName = "TestService",
| portName = "TestServiceSoap11Port",
| targetNamespace = "http://test/test-service",
| wsdlLocation = "WEB-INF/wsdl/test-service.wsdl")
| @ServiceMode(value = Service.Mode.PAYLOAD)
| public class FundOrderEndpointProvider implements Provider<Source> {
|
| ...
|
| }
|
|
I will look for the soap action http header to decide what method to invoke in another stateless session bean.
Can anyone help me we this?
Best Regards
Oskar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037613#4037613
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037613
18 years, 12 months